W3C home > Mailing lists > Public > www-style@w3.org > November 2015

[css-inline] 'dominant-baseline' values

From: Tavmjong Bah <tavmjong@free.fr>
Date: Thu, 26 Nov 2015 15:39:17 +0100
Message-ID: <1448548757.17404.128.camel@free.fr>
To: www-style@w3.org

Hi,

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
point).

* 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.[1] 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-
baseline' property.[2]

Tav

[1] http://www.w3.org/TR/xsl/#area-alignment, specifically this
figure: http://www.w3.org/TR/xsl/AlignIntroB-2FS.gif
 
[2] http://tavmjong.free.fr/SVG/WRITING_MODES/baseline_test.svg
Received on Thursday, 26 November 2015 14:39:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:58 UTC