Bug 62254 - SVG: lists in dy, dx, x, y in <tspan> is rendered incorrectly
Summary: SVG: lists in dy, dx, x, y in <tspan> is rendered incorrectly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: x86-64 (AMD64) All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
 
Reported: 2013-03-12 18:31 UTC by Jørgen Elgaard Larsen
Modified: 2023-08-02 18:12 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file with lists in "dx" and "dy" attributes of <tspan>. (5.93 KB, image/svg+xml)
2013-03-12 18:31 UTC, Jørgen Elgaard Larsen
Details
Test file with lists in "x" and "y" attributes of <tspan> (8.56 KB, image/svg+xml)
2013-03-12 18:32 UTC, Jørgen Elgaard Larsen
Details
First test file rendered in LibreOffice: The "dx" and "dy" attributes are ignored. (9.55 KB, image/png)
2013-03-12 18:35 UTC, Jørgen Elgaard Larsen
Details
Second test file rendered in LibreOffice: "x" and "y" lists jumbles the output. (10.19 KB, image/png)
2013-03-12 18:36 UTC, Jørgen Elgaard Larsen
Details
First test file as rendered in Firefox. (11.58 KB, image/png)
2013-03-12 18:37 UTC, Jørgen Elgaard Larsen
Details
Second test file as rendered in Firefox. (11.69 KB, image/png)
2013-03-12 18:37 UTC, Jørgen Elgaard Larsen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jørgen Elgaard Larsen 2013-03-12 18:31:31 UTC
Created attachment 76424 [details]
Test file with lists in "dx" and "dy" attributes of <tspan>.

Text in SVG files with a list-of-coordinates in the "x" or "y" attribute of <tspan> or <text> elements are not rendered correctly. The same goes for list-of-lengths in "dx" and "dy" attributes of the same elements.

Tested on LibreOffice 3.5.4.2, Build ID: 350m1(Build:2) on Ubuntu Linux on AMD64.

Attached are two simple SVG test files and screendump of how they are rendered in Firefox and LibreOffice, respectively.
Comment 1 Jørgen Elgaard Larsen 2013-03-12 18:32:42 UTC
Created attachment 76426 [details]
Test file with lists in "x" and "y" attributes of <tspan>
Comment 2 Jørgen Elgaard Larsen 2013-03-12 18:35:17 UTC
Created attachment 76428 [details]
First test file rendered in LibreOffice: The "dx" and "dy" attributes are ignored.
Comment 3 Jørgen Elgaard Larsen 2013-03-12 18:36:13 UTC
Created attachment 76429 [details]
Second test file rendered in LibreOffice: "x" and "y" lists jumbles the output.
Comment 4 Jørgen Elgaard Larsen 2013-03-12 18:37:14 UTC
Created attachment 76430 [details]
First test file as rendered in Firefox.
Comment 5 Jørgen Elgaard Larsen 2013-03-12 18:37:54 UTC
Created attachment 76431 [details]
Second test file as rendered in Firefox.
Comment 6 Owen Genat (retired) 2013-11-22 10:51:47 UTC
Confirmed. Status set to NEW. Component should perhaps be "graphics stack" or "filters and storage" rather than Writer. Provided files tested under Crunchbang 11 x86_64 running:

- v3.3.4.1 OOO330m19 Build: 401
- v3.4.6.2 OOO340m1 Build: 602
- v3.5.7.2 Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b
- v3.6.7.2 Build ID: e183d5b
- v4.0.6.2 Build ID: 2e2573268451a50806fcd60ae2d9fe01dd0ce24
- v4.1.3.2 Build ID: 70feb7d99726f064edab4605a8ab840c50ec57a

Results (short references are to the graphics provided in comment #0 and comment #1): 

v3.3.4.1 - no text displayed for either graphic
v3.4.6.2 - no text displayed for either graphic
v3.5.7.2 - #0 displayed as indicated in comment #2 (for LO)
         - #1 displayed as indicated in comment #3 (for LO)
v3.6.7.2 - #0 displayed as indicated in comment #2 (for LO)
         - #1 displayed as indicated in comment #3 (for LO)
v4.0.6.2 - #0 displayed as indicated in comment #2 (for LO)
         - #1 displayed as indicated in comment #5 (for Firefox)
v4.1.3.2 - #0 displayed as indicated in comment #2 (for LO)
         - #1 displayed as indicated in comment #5 (for Firefox)

So there does seem to have been some improvement, which is encouraging.
Comment 7 QA Administrators 2015-04-19 03:22:00 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2015-06-17 11:25:35 UTC
Confirmed attachments are like in the screenshots, when inserted to a document.
If opened with LibO Draw, however, no text is visible.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 80ec99db4325a439a8a3f1d420d0a80f8bf9c439
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-16_00:00:20
Locale: fi-FI (fi_FI)
Comment 9 Xisco Faulí 2015-11-10 09:11:32 UTC
*** Bug 95399 has been marked as a duplicate of this bug. ***
Comment 10 QA Administrators 2017-01-03 19:35:25 UTC Comment hidden (obsolete)
Comment 11 Roman Kuznetsov 2018-12-03 20:09:09 UTC
first file looks wrong in Draw
Second file looks same as in Inkscape

still repro in

Version: 6.2.0.0.beta1 (x64)
Build ID: d1b41307be3f8c19fe6f1938cf056e7ff1eb1d18
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: CL
Comment 12 QA Administrators 2019-12-04 04:20:52 UTC Comment hidden (obsolete)
Comment 13 QA Administrators 2021-12-04 04:43:58 UTC Comment hidden (obsolete)
Comment 14 Hossein 2021-12-19 20:17:27 UTC
Still reproducible in LibreOffice 7.2 and the latest LibreOffice 7.4 master.

First one (attachment 76424 [details] kern_test.svg) looks wrong.
Second one (attachment 76426 [details] kern_test2.svg) looks correct.

Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 6ca94dbd576be7aaa643393e2a9e2ee1c723c357
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 15 Hossein 2021-12-20 03:46:59 UTC
This small example shows the problem:

<svg xmlns="http://www.w3.org/2000/svg">
	<text x="20" y="20">
	    <tspan dy="0 20 20">ABC</tspan>
	</text>
</svg>

SVG tspan element
http://tutorials.jenkov.com/svg/tspan-element.html
Comment 16 IvoErMejo 2023-06-28 09:57:25 UTC
bug tested and not corrected yet

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9fc0b2b9b96d87eb642a3b29e9dcb5d6273265eb
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: it-IT (it_IT); UI: it-IT
Calc: threaded
Comment 17 Xisco Faulí 2023-08-02 12:20:53 UTC
The horizontal kernel is now fixed after the fixes for bug 156283 and bug 156577
Comment 18 Xisco Faulí 2023-08-02 16:27:50 UTC
In order to fix the Dy part, TextSimplePortionPrimitive2D and TextDecoratedPortionPrimitive2D should also support Dy array ( at the moment, only dx array is supported and rendered in drawinglayer/source/processor2d/vclprocessor2d.cxx )
@Khaled, is it something you could be interested to implement since it involves text rendering?
Comment 19 ⁨خالد حسني⁩ 2023-08-02 18:12:10 UTC
We don’t have a way to change y position of individual letters, you would need to plump this all the way into VCL’s SalLayout.

But I don’t see why you need to apply a y array, if a part of text has a different base line it has to be handled separately and then positioned at the desired position, you don’t want to kern or apply ligatures across the different base lines.