-
Notifications
You must be signed in to change notification settings - Fork 715
[css-fonts-4] [varfont] Applying a variation with font-variant-settings should actually clamp the applied value to the range the font supports #517
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
This clamping should not occur for the low-level font-variant-settings property. |
We could also clamp only |
2bf006e specifies how to do the clamping for For font-optical-sizing, there is nothing to clamp because the values are just "none" and "auto". As per #517 (comment), this clamping shouldn't occur for font-variation-settings. Therefore, this should be done. |
The clamping happens in rendering software anyway. However, what needs CSS support is IMO, if @font-face declares a range narrower than what the font supports, then browser should clamp to the @font-face range indeed, even though the font supports wider. |
The clamping does not happen in CoreText. The values in @font-face are only designed to be used for font selection, ad therefore should not affect which variation values get applied. |
"which variation values get applied" is font selection! Same way that unicode-range limits a font, @font-face ranges must limit the font IMO. |
Yes, this would be consistent with what we do with unicode-range for example - if the descriptors have a narrower range than what the font actually supports, then we enforce those restrictions. Because the stylesheet designer had some reason to do so (not liking glyphs in a particular unicode range / not liking the bolder weights so preventing them from being used). |
It's fairly clear that everyone else wants clamping. I'll change the spec to do that. |
For variation fonts, if you say something like:
font-weight: 814;
but the font file only supports weights of 400-700, then we should clamp 814 to that range and end up applying a weight of 700 instead.The text was updated successfully, but these errors were encountered: