W3C home > Mailing lists > Public > www-style@w3.org > June 2013

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

From: John Daggett <jdaggett@mozilla.com>
Date: Thu, 6 Jun 2013 02:28:47 -0700 (PDT)
To: www-style list <www-style@w3.org>
Message-ID: <1384944919.20669724.1370510927599.JavaMail.root@mozilla.com>

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:


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.


John Daggett

[1] post on subscript/superscript variant metrics 

[2] Hamburg discussion of superscript/subscript metrics

[3] http://www.w3.org/2013/06/06-css-minutes.html
Received on Thursday, 6 June 2013 09:29:18 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:12 UTC