[css3-fonts] why subscript/superscript metrics can't be used for text decorations

As part of today's F2F discussion regarding how to draw text
decorations for superscript/subscript variant glyphs, fantasai
proposed dictating that user agents use the superscript/subscript
metrics of the font to determine the placement of decorations (e.g.
underline, overline, strikethru).

The reason this doesn't work was precisely what was discussed on
www-style [1] and at the Hamburg F2F last year [2], namely that the
metrics don't match the bounds of the variant glyph in a consistent
way, so there are not reliable metrics to achieve the intended effect.

Here's the set of examples presented in Hamburg:

  http://people.mozilla.org/~jdaggett/tests/subsupermetrics.png

In each of the examples, the variant super/subscript glyph appears
first, followed by a glyph synthesized using the super/subscript
metrics of the font (in red).

What these examples show is that *if* you dictate that user agents
must place decorations on super/subscript variants based on the
metrics you will have cases where the placement is wildly wrong.  An
underline for Gabriola superscript variants based on these metrics
will end up as a line at the top of the superscript variant glyph. An
overline for a Minion Pro superscript glyph will display as a
strikethru instead.

During the discussion today, fantasai said regarding the metrics [3]:

> if they exist it will be right, and otherwise they
> will be slighty off

Unfortunately, this isn't correct, there just isn't a reliable way to
define the desired feature here, which is what I explained in Hamburg
and what I was saying today.

Cheers,

John Daggett

[1] post on subscript/superscript variant metrics 
http://lists.w3.org/Archives/Public/www-style/2012May/0369.html

[2] Hamburg discussion of superscript/subscript metrics
http://lists.w3.org/Archives/Public/www-style/2012May/0530.html

[3] http://www.w3.org/2013/06/06-css-minutes.html

Received on Thursday, 6 June 2013 09:29:18 UTC