Issue 118 (Was: [CSS21] Issues with inline formatting model (particularly 10.8))

I have an action item to write text for issue 118[1]. Here it is:

The current text says (section 10.8.1[2])

    > User agents center glyphs vertically in an inline box, adding
    > half-leading on the top and bottom. For example, if a piece of
    > text is '12px' high and the 'line-height' value is '14px', 2pxs of
    > extra space should be added: 1px above and 1px below the letters.  

What is centered is, of course, not the "ink" of each glyph, but the 
glyph's em-box, otherwise a small letter such as "o" would end up 
higher than a tall one such as "h" rather then being aligned on the 
baseline.

Also, what is centered is not individual glyphs, but the whole run of 
glyphs. That makes a difference if the glyphs come from a fallback font 
that has a different baseline position, because some glyphs will then 
be shifted up or down with respect to other glyphs in order to match up 
their baselines.

Here is a rewrite that tries to avoid all confusion:

    | User agents align glyphs in an inline box to each other by their
    | baselines and then vertically center them as a group in the inline
    | box. To find the height of the group, each glyph is replaced by
    | its em-box and the height is measured from the top of the highest
    | em-box to the bottom of the lowest one. (If some glyphs come from
    | a fallback font with a different baseline, they will be aligned a
    | bit higher or lower than other glyphs, thus the total height may
    | be more than 1em.) For example, if a piece of text is '12px' high
    | and the 'line-height' value 'is 14px', 2pxs of extra space should
    | be added: 1px above and 1px below the letters.

[1] http://wiki.csswg.org/spec/css2.1#issue-118
[2] http://www.w3.org/TR/CSS21/visudet.html#leading
[3] http://lists.w3.org/Archives/Public/www-style/2009Mar/0004.html



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 7 July 2010 19:28:00 UTC