Issue 122524 - [SVG import] sub-/superscript is rendered wrongly
[SVG import] sub-/superscript is rendered wrongly
Status: RESOLVED FIXED
Product: Draw
Classification: Application
Component: open-import
4.0.0-dev
All All
: P3 normal (vote)
: 4.0.0
Assigned To: Armin Le Grand
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-12 14:39 UTC by datbug
Modified: 2013-07-12 16:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
image showing the behaviour (38.97 KB, image/png)
2013-06-12 14:39 UTC, datbug
no flags Details
test file (36.87 KB, image/svg+xml)
2013-06-12 14:39 UTC, datbug
no flags Details
Overlay of Mozilla and AOO40 SVG (97.62 KB, application/vnd.oasis.opendocument.graphics)
2013-06-14 08:54 UTC, Armin Le Grand
no flags Details
Compare with three major SVG importers (180.59 KB, application/vnd.oasis.opendocument.graphics)
2013-06-18 08:50 UTC, Armin Le Grand
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description datbug 2013-06-12 14:39:30 UTC
Created attachment 80831 [details]
image showing the behaviour

XP, AOO400m2(Build:9701) - Rev. 1489073 2013-06-03 13:48:37 (Mo, 03 Jun 2013)
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 textsize
Comment 1 datbug 2013-06-12 14:39:51 UTC
Created attachment 80832 [details]
test file
Comment 2 Armin Le Grand 2013-06-14 08:53:47 UTC
ALG: Confirmed, created overlay file. Grepping.
Comment 3 Armin Le Grand 2013-06-14 08:54:23 UTC
Created attachment 80847 [details]
Overlay of Mozilla and AOO40 SVG
Comment 4 Armin Le Grand 2013-06-17 13:57:47 UTC
This one is two-folded, too:
(a) The font-size is given as font-size="75%". The SVG1.1. spec says in http://www.w3.org/TR/SVG/text.html 10.10 Font selection properties: 'If a <length> is provided with one of the unit identifiers (e.g., 12pt or 10%), then the SVG user agent converts the <length> into a corresponding value in the current user coordinate system by applying the rules described in Units.'.

This is done, but obviously wrong in this case. It also says (one line below): 'Except for any additional information provided in this specification, the normative definition of the property is in CSS2 ([CSS2], section 15.2.4).'. This leads to http://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#propdef-font-size where in 15.2.4 Font size: the 'font-size' and 'font-size-adjust' properties is explained: 'A percentage value specifies an absolute font size relative to the parent element's font size. Use of percentage values, or values in 'em's, leads to more robust and cascadable style sheets. '.

Thus, font-size="75%" should be interpreted relative to the parent font size, but this is not clearly stated in SVG1.1. Looks as if I have to change this. This would count as defect.

(b) The attributes described in '10.9.2 Baseline alignment properties' are not yet supported. These are ‘dominant-baseline’, ‘alignment-baseline’ and ‘baseline-shift’ (which is used here). This would count as Enhancement.
Comment 5 Armin Le Grand 2013-06-18 08:46:54 UTC
ALG: (a) is not too hard to do, works well after adapting. For (b) adding and working on 'alignment-baseline' works well. Created a test doc with Mozilla, Safari and Inkscape compare (will add it).
Comment 6 Armin Le Grand 2013-06-18 08:50:21 UTC
Created attachment 80877 [details]
Compare with three major SVG importers
Comment 7 Armin Le Grand 2013-06-18 08:57:25 UTC
ALG: (b) looks good so far, just the whitespace handling looks different.
- Mozilla 'SO' '2' 'CL' seems to not add a space after 'SO', but after '2'
- Safari and Inkscape seems to add nop spaces at all
I checked our current Whitespace handling (looking at 10.15 White space handling in SVG1.1, also the example at the end of '10.5 The ‘tspan’ element'), it is correct to add one space after each 'word' which is not the last, thus the result is 'SO ' '2 ' 'CL' is correct. Seems as if others add an exception for super/subscript, but I found no reference in the net for doing so.
Comment 8 Armin Le Grand 2013-06-18 09:41:38 UTC
ALG: Decided to adapt whitespace handling with super/sub-script on empirical base (lloks as the others do). Preparing checkin.
Comment 9 Armin Le Grand 2013-06-18 09:45:35 UTC
ALG: Okay, done. Happy assimilation, guys ;-)