W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2018

Re: [csswg-drafts] [css-fonts] font property descriptors for variable fonts

From: jfkthame via GitHub <sysbot+gh@w3.org>
Date: Wed, 11 Apr 2018 08:25:06 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-380370078-1523435105-sysbot+gh@w3.org>
> So in the above example the variable font should be clamped to 400 and 900 weights.

What exactly do you mean by this? As I understand it, in your example the variable font will be used *only* at weights 400 and 900, providing two distinct faces that correspond to the non-variable Regular and Black; it will not be used at intermediate weights. So you have two faces, each of which is "clamped" to a single weight. Was that your intention?

If you wanted the variable font's rendering to provide a *range* of weights from 400 to 900, you should use something like

    @font-face {
        font-family: 'SourceSans';
        src: url('source-sans-variable.woff2') format("woff2" requires variations);
        font-weight: 400 900;
    }

Adding your no-weight-descriptor rule provides a face that (in the Apple/Microsoft interpretation) is considered to have weight 400 for font-selection purposes, but for rendering will use whatever range of weights the variable font actually supports. (But in the Chrome interpretation -- a more precise reading of the current spec text, AIUI -- this rule is equivalent to the one with `font-weight: 400`.)

(Oh, and this "requires variations"... something like that has been discussed, I know, but it's not spec'd yet, is it? According to the current text, it's `format("woff2-variations")`.)

-- 
GitHub Notification of comment by jfkthame
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2485#issuecomment-380370078 using your GitHub account
Received on Wednesday, 11 April 2018 08:25:09 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:28 UTC