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

Re: superiors, inferiors, ordinals, etc.

From: John Hudson <tiro@tiro.com>
Date: Mon, 29 Mar 2010 10:22:46 -0700
Message-ID: <4BB0E1E6.9080809@tiro.com>
To: John Daggett <jdaggett@mozilla.com>
CC: www-style list <www-style@w3.org>
John Daggett wrote:

>> Is the method of simulation specified or recommended? In theory, there
>> is font info that can be used to define best scaling and positioning for
>> simulated superscript and subscript; in practice, in a lot of fonts (the
>> majority?), this information is not accurately set. It's one of those
>> vicious circles in which app makers ignore the data, discouraging font
>> makers from taking the time to calculate best values, which in turn
>> discourages app makers from making use of them.

> Ideally this would be specified normatively so that it would be as
> consistent as possible across user agents.  If you have the details
> for how this should be done or can point me at a reference for this,
> that would be great.  I was planning on experimenting with this once
> we have a partial implementation up and running.

The in-font scaling and offset positioning values for inferior/superior 
simulation are located in the OS/2 table [1]:

	ySubscriptXSize
	ySubscriptYSize
	ySubscriptXOffset
	ySubscriptYOffset

	ySuperscriptXSize
	ySuperscriptYSize
	ySuperscriptXOffset
	ySuperscriptYOffset

My recommendation would be to use these values to simulate inferior and 
superior glyphs, since if these values have been intelligently set by 
font makers they will provide the best possible relationship between 
simulated glyphs and <subs>/<sups> feature variant glyphs.

As I mentioned earlier, in a lot of fonts these values are not 
intelligently set by font makers -- and I'm guilty of this too --, but 
in general this won't mean that the values are 'wrong', only that 
they're not optimal. I suspect a lot of font makers simply leave these 
values as e.g. FontLab defaults, so the simulated glyphs will at least 
be scaled down and lowered/raised accordingly.

[Note to Adam and other font tool makers: it would encourage correct 
setting of these values if there were some way to preview the results 
inside the tool.]

Doubtless there a number of fonts in which these values are completely 
wrong and will produce unacceptable results. But I don't anticipate that 
number being large, and this is easily classed as a font bug and not 
something that browser makers should have to worry about.

If use of these values for simulated inferior/superior glyphs is 
specified normatively in CSS, I can make a strong case to my colleagues 
that we need to start giving these values more attention, especially in 
web fonts.

John Hudson


[1] http://www.microsoft.com/typography/otspec/os2.htm
Received on Monday, 29 March 2010 17:23:20 GMT

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