Bug 117386 - EXPORT SVG Text spacing not preserved by SVG export filter
Summary: EXPORT SVG Text spacing not preserved by SVG export filter
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, filter:svg, regression
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2018-05-02 12:06 UTC by Florian Reisinger
Modified: 2023-11-07 12:52 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Top left: Exported SVG Bottom left: Corrected SVG ight: Draw preview (154.14 KB, image/png)
2018-05-02 12:08 UTC, Florian Reisinger
Details
Draw example file (page 2) (37.06 KB, application/vnd.oasis.opendocument.graphics)
2018-06-08 04:58 UTC, Florian Reisinger
Details
SVG export with LO 3.6.7.2 (5.59 KB, image/svg+xml)
2023-11-07 12:52 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Reisinger 2018-05-02 12:06:44 UTC
Description:
See attached files (my first bug report for a long time, unable to see "upload attachment")

On page 2 of the attached fodg file there is a rectangle with rounded corners with the text "GUI". It has a custom spacing of 100pt, which is lost on SVG export

Steps to Reproduce:
Open file (or create one with a custom line spacing)

Actual Results:  
Line spacing not preserved

Expected Results:
Line spacing exported (SVG supports it)


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Comment 1 Florian Reisinger 2018-05-02 12:08:27 UTC
Created attachment 141835 [details]
Top left: Exported SVG Bottom left: Corrected SVG ight: Draw preview

Added attachment
Comment 2 Florian Reisinger 2018-05-02 12:10:06 UTC
Same result with:

Version: 6.1.0.0.alpha1 (x64)
Build-ID: cb47f0d320994e001bc38dc2ee9b7d957b15e6ab
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; 
Gebietsschema: de-AT (de_AT); Calc: CL
Comment 3 Buovjaga 2018-06-07 17:38:33 UTC
You only attached a screenshot, please attach test files.
Comment 4 Florian Reisinger 2018-06-08 04:58:09 UTC
Created attachment 142606 [details]
Draw example file (page 2)

Page 2 of this file is the example file...
Comment 5 Buovjaga 2018-06-08 11:58:07 UTC
Repro, already in 4.3.0 (Win), but not yet in 3.6.7

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 67aaa98600269e6b8fa631146c3649a261369471
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on June 7th 2018

Arch Linux 64-bit
Version 3.6.7.2 (Build ID: e183d5b)
Comment 6 Buovjaga 2018-07-10 20:25:55 UTC
Bibisected with Linux 43all to range https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=5b195fbcf7a441aeb193f6abd08b877e580938e0...7c4d3ea6ba4d42b4dda5148a00c8c411b5d7703d

It has several SVG export commits from Thorsten.

Adding Cc: to Thorsten Behrens
Comment 7 QA Administrators 2019-12-04 04:20:38 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2021-12-04 04:42:16 UTC Comment hidden (obsolete)
Comment 9 Gabor Kelemen (allotropia) 2022-06-02 17:51:58 UTC
Still bad in:

Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: 754eb1541a6ca709f78afbc7fb2b75f626562dcc
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded
Comment 10 Stéphane Guillou (stragu) 2023-07-12 16:57:13 UTC
Same in recent master build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 77fca616e0bd79e0b405fd0b3543cf8e94e15df3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 11 Stéphane Guillou (stragu) 2023-11-07 12:52:03 UTC
Created attachment 190701 [details]
SVG export with LO 3.6.7.2

Before the regression, the three letters would each have their fixed x position:

     <g fill="rgb(53,211,50)" stroke="none">
      <text x="5676" y="19928">G</text>
      <text x="11778" y="19928">U</text>
      <text x="17652" y="19928">I</text></g>

In a recent trunk build, they are grouped in a single text element:

        <text class="SVGTextShape"><tspan class="TextParagraph"><tspan class="TextPosition" x="5678" y="19927"><tspan font-family="Franklin Gothic Demi, sans-serif" font-size="5292px" font-weight="400" fill="rgb(53,211,50)" stroke="none" style="white-space: pre">GUI</tspan></tspan></tspan></text>

Our filter could maybe use the attribute "letter-spacing"?
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/letter-spacing

For example, replace the above with:

        <text class="SVGTextShape"><tspan class="TextParagraph"><tspan class="TextPosition" x="5678" y="19927" letter-spacing="1500"><tspan font-family="Franklin Gothic Demi, sans-serif" font-size="5292px" font-weight="400" fill="rgb(53,211,50)" stroke="none" style="white-space: pre">GUI</tspan></tspan></tspan></text>