W3C home > Mailing lists > Public > www-font@w3.org > April to June 2017

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

From: Myles C. Maxfield <mmaxfield@apple.com>
Date: Fri, 31 Mar 2017 18:00:11 -0700
Message-id: <F701734F-2200-43EB-B6CC-9213EB8AF019@apple.com>
Cc: Laurence Penney <lorp@lorp.org>, "www-font@w3.org" <www-font@w3.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Or maybe [1, 1000]. I dunno, it doesn’t matter much to me.

https://github.com/w3c/csswg-drafts/issues/1157 <https://github.com/w3c/csswg-drafts/issues/1157>

> On Mar 31, 2017, at 5:57 PM, Myles C. Maxfield <mmaxfield@apple.com> wrote:
> 
>> 
>> On Mar 31, 2017, at 5:40 PM, Tab Atkins Jr. <jackalmage@gmail.com <mailto:jackalmage@gmail.com>> wrote:
>> 
>> On Fri, Mar 31, 2017 at 5:01 PM, Myles C. Maxfield <mmaxfield@apple.com <mailto:mmaxfield@apple.com>> wrote:
>>> 
>>>> On Mar 31, 2017, at 9:37 AM, Laurence Penney <lorp@lorp.org <mailto:lorp@lorp.org>> wrote:
>>>> 
>>>> 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.
>>> 
>>> 0 can’t be allowed here because of parsing ambiguity in the “font” shorthand. In particular, length values of 0 don’t have to include a unit. This means that if 0 weight would be allowed, there would be no way to differentiate between a weight of 0 and a font-size of 0 inside the font shorthand. I took the same approach with 1000 just for symmetry.
>> 
>> Note that open ranges (such as (0, 1000)) aren't allowed in CSS.
>> Disallowing 0 is fine, but you have to provide a lower bound, such as
>> 1, or define a behavior that handles values that approach 0 (such as a
>> UA-defined minimum that values are floored to).  Disallowing 1000 (but
>> allowing 999.9999999) isn't allowed.  (This is all per CSS design
>> principles; there's nothing that magically disallows this stuff except
>> convention).
> 
> So it should be [1, 999] instead of (0, 1000), I guess.
>> 
>> ~TJ
Received on Saturday, 1 April 2017 01:00:45 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 1 April 2017 01:00:45 UTC