Bug 64462

Summary: SVG image text with sub-/superscript is not shown properly
Product: LibreOffice Reporter: ilikebigbugs
Component: DrawAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: ChrRossmanith, rb.henschel, vsfoote
Priority: medium Keywords: filter:svg
Version: 4.0.3.3 release   
Hardware: Other   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=152123
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on: 62284    
Bug Blocks: 88278    
Attachments: image showing the behavior
file from Bug 62284
screenshot for attachment 79149
Adjustment to attachment 79149
How it looks in upcomming 5.0

Description ilikebigbugs 2013-05-11 11:41:22 UTC
Created attachment 79148 [details]
image showing the behavior

XP, LO Version 4.0.4.0+

Insert->Picture->From File
Text with sub-/superscript is cut where the sub-/superscript is and the sub-/superscript is shown as a single letter/sign with a much bigger text size
Comment 1 ilikebigbugs 2013-05-11 11:42:37 UTC
Created attachment 79149 [details]
file from Bug 62284
Comment 2 Jorendc 2013-05-22 18:00:23 UTC
I can reproduce this using Linux Mint 15 x64 with LibreOffice 4.0.3.3 and Version: 4.2.0.0.alpha0+ Build ID: 66c315bcf2b78c4928d1e436d1a853f58f4cccd

Kind regards,
Joren
Comment 3 Christina Rossmanith 2013-09-18 21:11:22 UTC
Created attachment 86109 [details]
screenshot for attachment 79149 [details]

text is rendered correctly here

Version: 4.2.0.0.alpha0+
Build ID: f4d3954fc6106b3ae0ee16ab0fcde15d8cb945e3

Linux (Ubuntu)
Comment 4 Sebastian Hölz 2014-01-16 16:21:25 UTC
I have the same problem when using an SVG created with Inkscape. I was able to track this down to the following line in the SVG:

<tspan
   style="font-size:65.00091553%;baseline-shift:super"
   id="tspan6747">-3</tspan>

Here, the font-size is specified in "%", which I think is incorrectly interpreted by LibreOffice as a pixel-size. 

If I manually change this to let's say "10.5px" it looks better, even though the formating is still not correct.
Comment 5 Sebastian Hölz 2014-01-16 21:36:56 UTC
I have taken a look at the SVG-file, which is already posted as attachment 79148 [details] to this bug. According to the header this file was also created using Inkscape. It also uses the exact same syntax with the font-size being specified in % of the main font-size:

    <text
       font-size="12pt"
       x="97.300003"
       y="148.5"
       id="text76"
       style="font-size:15px;fill:#000000;font-family:helvetica">SO<tspan
   baseline-shift="sub"
   font-size="75%"
   id="tspan78"
   style="font-size:75%;baseline-shift:sub">2</tspan>
Cl</text>

Sebastian

PS.: This is in LO Version 4.1.4.2, Win7
Comment 6 Sebastian Hölz 2014-01-16 22:10:54 UTC
Created attachment 92247 [details]
Adjustment to attachment 79149 [details]

I have taken attachment 79149 [details] and manually removed the font-sizes, which are specified as % and replaced them by px (e.g. font-size="75%" replaced by font-size="12px"). This resolves the issue of the huge fonts. The chemical formula is now almost rendered correct, but if you take a closer look you will see that baseline-shift="sub" is ignored. It seems that LO does not interpret all text attributes which are part of SVG 1.1 ...
Comment 7 Jorendc 2015-05-02 13:11:05 UTC
Created attachment 115268 [details]
How it looks in upcomming 5.0

Looks fixed in upcomming LibreOffice 5.0 release.

Marking as RESOLVED WORKSFORME
Comment 8 Robinson Tryon (qubit) 2015-12-17 05:50:09 UTC
Migrating Whiteboard tags to Keywords: (filter:svgInsert)
[NinjaEdit]