Aligning specs of OT1.8.1 wght variation axis and CSS font-weight

There are some oddities in the CSS spec, in OT1.8.1 and in the WebKit implementation about valid values for a font’s weight.

CSS:
<number> "Only values greater than 0 and less than 1000 are valid" [1]
This implies that the values 0 and 1000 are both invalid. By use of <number>, integers are not mandated, and indeed fractional values will presumably be common with variable fonts. It’s unclear what the smallest and largest valid values are, but maybe that doesn’t matter. I suggest it would be more elegant if the spec allowed the extremes, thus 0 <=  n <= 1000.

OT1.8.1:
"Values must be in the range 1 to 1000." [2]
This conflicts with CSS in two ways: that the value 1000 is now valid, and that values between 0 and 1 (exclusive) are now invalid. I suggest this be modified along with the CSS spec, to allow all values between 0 and 1000 inclusive.

WebKit:
"Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors" [3]
I note from this WebKit changeset that Myles Maxfield (for Apple) has assumed that the CSS spec is correct. The characterization as parse errors seems a little odd.

If it is intended that the wght axis corresponds exactly to CSS font-weight, then the specs should align. Otherwise there may be many fonts where the maximum weight can never quite be achieved, at least not via CSS font-weight.

- L

[1] https://drafts.csswg.org/css-fonts-4/?c=S%3BO%3DA#font-weight-prop
[2] https://www.microsoft.com/typography/otspec/fvar.htm
[3] https://trac.webkit.org/changeset/214507/webkit

Received on Friday, 31 March 2017 16:38:00 UTC