Bug 148180 - Overline text decoration misses in exported SVG
Summary: Overline text decoration misses in exported SVG
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:svg
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2022-03-25 11:25 UTC by AndyG
Modified: 2023-11-21 16:18 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
ODG example file (9.67 KB, application/vnd.oasis.opendocument.graphics)
2022-08-13 11:18 UTC, Roman Kuznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description AndyG 2022-03-25 11:25:26 UTC
Description:
Although LibreOffice correctly exports two of the three text decorations (underline and strike-through), overlines are missing. There are two places (that I know of) where text decoration attributes may occur, dependent on whether a whole paragraph line is decorated, or just part of a paragraph line.

Steps to Reproduce:
On a blank LibreOffice Draw page, insert a text box. In the text box, enter the following sentences:
	First full line, underlined
	Second full line, struck through
	Third full line, overlined
	First partial line, underlined
	Second partial line, struck through
	Third partial line, overlined
	Fully underline, strike through, and overline the first through third sentences, respectively.
In the second set, underline, strike through, and overline the respective "partial line" phrases. Manually export to SVG (File > Export… with Save as type: SVG) to get an SVG 1.2 file. Open the file in (for example) Inkscape to quickly see that underlining and strike-through are correct, but overlining is missing.

Actual Results:
Overlines are missing

Expected Results:
Open the SVG file in a text editor, and verify that you exported <svg version="1.2"...>. Skip the embedded definitions and any Master_Slide, or search for the element <g class="Page">. That element contains the following section, where details of x, y placement and font may be different:

<g class="TextShape">
	<g id="id3">
		<rect class="BoundingBox" stroke="none" fill="none" x="2500" y="3200" width="10101" height="5901"/>
		<text class="SVGTextShape">
			<tspan class="TextParagraph" font-family="Noto Sans, sans-serif" font-size="494px" font-weight="400" text-decoration="underline">
				<tspan class="TextPosition" x="2750" y="3854">
					<tspan fill="rgb(0,0,0)" stroke="none">First full line, underlined</tspan>
				</tspan>
			</tspan>
			<tspan class="TextParagraph" font-family="Noto Sans, sans-serif" font-size="494px" font-weight="400" text-decoration="line-through">
				<tspan class="TextPosition" x="2750" y="4527">
					<tspan fill="rgb(0,0,0)" stroke="none">Second full line, struck through</tspan>
				</tspan>
			</tspan>
			<tspan class="TextParagraph" font-family="Noto Sans, sans-serif" font-size="494px" font-weight="400">
				<tspan class="TextPosition" x="2750" y="5200">
					<tspan fill="rgb(0,0,0)" stroke="none">Third full line, overlined</tspan>
				</tspan>
			</tspan>
			<tspan class="TextParagraph" font-family="Noto Sans, sans-serif" font-size="494px" font-weight="400">
				<tspan class="TextPosition" x="2750" y="6546">
					<tspan fill="rgb(0,0,0)" stroke="none">First </tspan>
					<tspan text-decoration="underline" fill="rgb(0,0,0)" stroke="none">partial line</tspan>
					<tspan fill="rgb(0,0,0)" stroke="none">, underlined</tspan>
				</tspan>
			</tspan>
			<tspan class="TextParagraph" font-family="Noto Sans, sans-serif" font-size="494px" font-weight="400">
				<tspan class="TextPosition" x="2750" y="7219">
					<tspan fill="rgb(0,0,0)" stroke="none">Second </tspan>
					<tspan text-decoration="line-through" fill="rgb(0,0,0)" stroke="none">partial line</tspan>
					<tspan fill="rgb(0,0,0)" stroke="none">, struck through</tspan>
				</tspan>
			</tspan>
			<tspan class="TextParagraph" font-family="Noto Sans, sans-serif" font-size="494px" font-weight="400">
				<tspan class="TextPosition" x="2750" y="7892">
					<tspan fill="rgb(0,0,0)" stroke="none">Third </tspan>
					<tspan fill="rgb(0,0,0)" stroke="none">partial line</tspan>
					<tspan fill="rgb(0,0,0)" stroke="none">, overlined</tspan>
				</tspan>
			</tspan>
		</text>
	</g>
</g>

The third TextParagraph tspan should read:
	<tspan class="TextParagraph" font-family="Noto Sans, sans-serif" font-size="494px" font-weight="400" text-decoration="overline">
The middle tspan in the TextPosition element in the sixth TextParagraph should read:
	<tspan text-decoration="overline" fill="rgb(0,0,0)" stroke="none">partial line</tspan>

Why it matters:	In circuit diagrams of digital systems, inverted signals are sometimes denoted by overlines. A missing overline makes a circuit or system diagram faulty and meaningless.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
It seems that both the SVG standard and LibreOffice Draw internally handle overlines similar to underlining and strike-through. Both systems call them "text decorations". So it is remarkable that the overlines are missing from exported SVGs. 

Draw has quite a few options: single line, double line, bold, etc. But SVG has only one option, so it would be correct to channel any option of overlining into the same SVG result (same as is done for underlines and strikethrough).
Comment 1 Roman Kuznetsov 2022-08-13 11:17:39 UTC
Confirm in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: f4027dd967a3292cfba689ca735d839b16ac2d92
CPU threads: 4; OS: Mac OS X 12.5; UI render: Skia/Metal; VCL: osx
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: threaded Jumbo
Comment 2 Roman Kuznetsov 2022-08-13 11:18:10 UTC
Created attachment 181756 [details]
ODG example file
Comment 3 BogdanB 2023-11-04 19:08:26 UTC
Also in
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: dabedcaf27b0af1e38a611b8d8e48444f848e01d
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 4 Stéphane Guillou (stragu) 2023-11-21 16:18:42 UTC
No overline either when exporting with:

Version: 5.4.0.3
Build ID: 92c2794a7c181ba4c1c5053618179937228ed1fb
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group