Re: [csswg-drafts] [css-fonts] Specifying changes to parameters for fallback fonts (#126)

>  I thought that the existing descriptors in @font-face such as font-weight are for matching/finding fonts, rather than modifying them.

[These descriptors define the characteristics of a font face and are used in the process of matching styles to specific faces.](https://drafts.csswg.org/css-fonts-4/#font-prop-desc)

So yes, the descriptors are used for matching against - the _properties_ (requests for styling) are matched against the _descriptors_ (descriptions of the fonts that are available).

The descriptors _typically_ contain values extracted from the font; but they need not do so. And the font is not automatically opened and checked against the descriptors, if that is what you were thinking.

So for example the font family name is usually the same as what the font contains - but it need not be. It is common to make the name shorter for example. And it can be something different entirely. 

And the font weight is typically what the font says it is, but (for non-variable fonts) could be set to anything. I could point to a heavy, ultrabold font which is weight 800 and have the descriptor say it is weight 200, for example (not very useful, but possible). More usefully I could decide that this particular font looks heavier than it claims to be, so I could set the `font-weight` descriptor to 830 instead.

An issue is that, while massaging (or lying about, as some prefer to say) non-variable fonts is easy, it becomes harder for variable fonts because we are trusting the font more. A variable font with a weight axis may cover, say the range 200 to 500. I can massage this by using a `font-weight` descriptor of 280 500, meaning I don't want it to match for weights below 280; but if it does match, there is no way for me to say "given a weight **n**, ask this font for weight **a + n * b**.

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/126#issuecomment-778359837 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 12 February 2021 18:18:41 UTC