Bug 107517 - SVG export from Impress will trim "Tab" in tspan
Summary: SVG export from Impress will trim "Tab" in tspan
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.3.2.2 release
Hardware: All All
: medium enhancement
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.5.0 target:7.4.2
Keywords: filter:svg
: 115267 (view as bug list)
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2017-04-29 11:00 UTC by fxwan
Modified: 2022-12-13 18:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fxwan 2017-04-29 11:00:05 UTC
Description:
"Tab" in <a:t> won't exported to SVG tspan correctly. And the corresponding tabSize setting is also not respected.

Steps to Reproduce:
1.  Open a PPTX which contains "tab" in text fields
            </a:rPr>
               <a:t>   123456
               </a:t>
2. It displays good in LibreOffice UI
3. Export to SVG the "tab" is gone.

Actual Results:  
"tab" is not exported to SVG

Expected Results:
Support export "tab" in tspan with correct tabSize.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36
Comment 1 Regina Henschel 2017-04-29 13:25:56 UTC
SVG does not have tabulators at all and if LibreOffice wrote one or more &#x09; that would be collapsed to a space by the XML whitespace collapsing algorithm.

But I think, that LibreOffice can use a dx attribute or an x attribute on the following <tspan> element, having a value that results in a gab that is equal to the current gap in the text in the slide. That would fake the tabulator.
Comment 2 fxwan 2017-04-30 08:15:22 UTC
<svg xmlns="http://www.w3.org/2000/svg"
     width="500" height="40" viewBox="0 0 500 40">
  <text x="0" y="35" font-family="Verdana" font-size="35" style="tab-size:400px">&emsp;Hello, out there
  </text>
</svg>

Tab actually works in SVG if you encode it to &emsp;, but we can't control the tab-size as HTML does. So your solution would be robust.
Comment 3 Buovjaga 2018-02-16 19:29:18 UTC
*** Bug 115267 has been marked as a duplicate of this bug. ***
Comment 4 Buovjaga 2018-02-16 19:30:37 UTC
Not limited to PPTX source.
Comment 5 Stéphane Guillou (stragu) 2021-06-08 10:52:44 UTC
I can reproduce with:

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 399a6472f666ae6c3e20b6f8367f9fd089c15605
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-05_17:38:40
Calc: threaded

Steps to reproduce:

1. Open Impress
2. Click in text box
3. Write a word, press tab a couple of times, write another word
4. File > Export... > use SVG format
5. Open the SVG file (in an image viewer or in a web browser)

Result: words are not spaced.
Comment 6 Miklos Vajna 2022-10-07 15:01:49 UTC
I think I fixed this with core.git e7ca10a35fd665722c67eea85e15f71c11c66248
Comment 7 Stéphane Guillou (stragu) 2022-12-13 18:47:20 UTC
Fix verified:

Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: ad085990b8073a122ac5222e5220f8f1d6826dcf
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Was also cherrypicked for 7.4: https://gerrit.libreoffice.org/c/core/+/140971