W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2016

Re: [csswg-drafts] [css-fonts-4] include WOFF 2.0 in font format (src descriptor) strings

From: litherum via GitHub <sysbot+gh@w3.org>
Date: Wed, 21 Sep 2016 22:47:36 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-248764764-1474498054-sysbot+gh@w3.org>
 on behalf of @jfkthame:

The problem with `format("woff2", "variation")` (etc) is that if I 
understand correctly, this will not prevent the resource being used by
 browsers that don't support variation fonts. The current CSS Fonts 
spec [says](https://www.w3.org/TR/css-fonts-3/#src-desc):

> The format hint contains a comma-separated list of format strings 
that denote well-known font formats. Conformant user agents must skip 
downloading a font resource if the format hints indicate only 
unsupported or unknown font formats. If no format hints are supplied, 
the user agent should download the font resource.

which, at least as implemented in Firefox (I haven't tested this in 
other browsers) means that if *any* of the format strings indicates a 
supported format, the resource will be used.

I think what we want here is the opposite behavior, whereby if *any* 
of the format hints indicates an unsupported format or feature, the 
resource should be skipped. Then an author could say things like

    src: url("MyVarFont.woff2") format("woff2", "variation"),
           url("MyFont.woff2") format("woff2");

to provide a variation font to browsers that support it, and a 
non-variation one to legacy UAs. But that won't work in current 
Firefox; the first (variation) font will be used even though its 
"variation" format hint is not supported.

Maybe we can change this in the spec, and expect browsers to adjust as
 needed? I'm not aware that there has been any real use of multiple 
format hints at this point; it's not clear to me what current use-case
 would require them.

GitHub Notification of comment by litherum
Please view or discuss this issue at 
using your GitHub account
Received on Wednesday, 21 September 2016 22:47:43 UTC

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