W3C home > Mailing lists > Public > www-style@w3.org > February 2010

[css3-fonts] OpenType subscript/superscript support

From: John Daggett <jdaggett@mozilla.com>
Date: Thu, 25 Feb 2010 01:46:22 -0800 (PST)
To: www-style <www-style@w3.org>
Message-ID: <304053961.164652.1267091182251.JavaMail.root@cm-mail03.mozilla.org>
One of the things that I did *not* add to the CSS3 Fonts spec was support for OpenType subscript/superscript/inferior features.  The reason for this is somewhat complicated but it was highlighted during the November F2F.

In CSS 2.1 subscripts and superscripts are styled using a combination of properties.  The default stylesheet in Firefox uses the property settings below for the sub and sup tags.  The vertical-align property shifts the baseline and font-size is reduced to produce the subscript/superscript effect: 

sub {
  vertical-align: sub;
  font-size: smaller;
  line-height: normal;
}

sup {
  vertical-align: super;
  font-size: smaller;
  line-height: normal;
}

Ideally, subscripts and superscripts should fit on the line and not cause changes in line height.  This is what OpenType subscript/superscript support enables, these use a variant glyph designed for subscript/superscript use that sits within the em-box so that no baseline adjustments are necessary.  The glyph is typically slightly bolder than a resized version of the default glyph, this allows it to match the surrounding text and remain readable.

For fonts that have subscript/superscript support enabled, simply enabling those features without any change to font-size or line-height makes sense.  But if the font doesn't support subscript/superscript features then the existing resizing/baseline swizzling still needs to happen.  Those two capabilities are hard to combine.

I'm still struggling to come up with a reasonable solution here. Some sort of property that somehow either uses the variant subscript/superscript glyph or simulates an equivalent for fonts that lack the right glyphs possibly.

John
Received on Thursday, 25 February 2010 09:46:56 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:24 GMT