Apache OpenOffice (AOO) Bugzilla – Issue 122524
[SVG import] sub-/superscript is rendered wrongly
Last modified: 2022-10-28 12:54:17 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
Created attachment 80832 [details] test file
ALG: Confirmed, created overlay file. Grepping.
Created attachment 80847 [details] Overlay of Mozilla and AOO40 SVG
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.
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).
Created attachment 80877 [details] Compare with three major SVG importers
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.
ALG: Decided to adapt whitespace handling with super/sub-script on empirical base (lloks as the others do). Preparing checkin.
ALG: Okay, done. Happy assimilation, guys ;-)