-
Notifications
You must be signed in to change notification settings - Fork 708
[css-fonts-5] Add font-size descriptor to @font-face which allows ranges (for optical sizing) #806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there a reason you didn't propose using If we do add a |
My mistake: If extending the |
Nope. Currently, for variation fonts, the descriptors allow ranges but the properties only allow a single value. |
See also: #731 |
The |
Can you please clarify (at least for me) if the number match the value in |
The current draft of the Fonts module defines the
font-optical-sizing
property, which will automatically chooses a variable font instance along the optical size axis for the given text span/block. I propose that this be extended to support automatic optical style switching for static font families as well.Option 1:
Add a
font-size-range
property to @font-face rules. This property defines the size range for which this @font-face rule is applicable.Option 2:
The above handles web fonts but not locally installed fonts. For local fonts, we can take advantage of the STAT table introduced in the OpenType 1.8 spec. In static fonts, the STAT table provides the same sort of information that an @font-face rule does for web fonts (except src, which is already known). One of the parameters in the STAT table defines a size range for which the given font is applicable (provides the functional equivalent to
font-size-range
, above).So, one could simply have the following in CSS:
Browsers that want to support this would have to extend their font selection algorithm to also include PreferredFamilyName (NameID 16 from the name table) as the value for PreferredFamilyName will be exactly the same for all fonts in the font family.
The text was updated successfully, but these errors were encountered: