[css-inline] 'dominant-baseline' values
Tavmjong Bah <tavmjong <at> free.fr>
2015-11-26 14:39:17 GMT
In reworking the SVG 2 text section I've come across a number of issues
with the values for 'dominant-baseline':
* The 'initial' value is given as 'normal' which is not defined. SVG
1.1 uses 'auto' which is defined.
* SVG 1.1 (and XSL) has the additional values:
'use-script', 'no-change', 'reset-size', 'ideographic',
'middle', 'text-after-edge', 'text-before-edge'
I'm not too worried about losing 'use-script' and 'no-change' but I
think 'ideographic' and 'middle' should be kept. Both are supported by
Firefox and Blink. 'reset-size' also has a useful purpose (see next
* In both SVG 1.1 and XSL the baseline tables are not changed when the
font size changes. See the figure in the XSL spec. The tables are
only changed when the 'dominant-baseline' has a value of 'reset-size'.
It's not clear that this is the prescribed behavior in the CSS Inline
spec and browsers don't seem to follow this.
* It would be useful to suggest default values for the various
baselines if they cannot be extracted from the font (and are not
otherwise clearly defined). Or, for example, one could try to measure
the hanging baseline by measuring the ascent of various glyphs in the
the Devangari, Bengali, Gujarati, etc scripts. The math baseline could
be found by finding the middle of the 'minus' character.
* The 'auto' value for vertical text when coupled with the obsolete SVG
'glyph-orientation-vertical' values '90deg' and '90' breaks SVG
content. This is because these values for 'glyph-orientation-vertical'
are mapped to the 'text-orientation' value 'sideways' which dictates
that the 'dominant-baseline' has a value of 'alphabetic' where in SVG
1.1 the auto value of 'dominant-baseline' for all vertical text is
'central'. This is important as in SVG, text is positioned so that the
dominant baseline is aligned to the 'x' attribute of the <text> element
(for vertical text). Using the 'alphabetic' baseline for sideways text
will result in shifting the text by the difference between the
alphabetic and central baselines.
I've created a test SVG file with a custom font for the 'dominant-
 http://www.w3.org/TR/xsl/#area-alignment, specifically this