W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2019

[csswg-drafts] [css-fonts] Suggest allowing a list of font-family values in @font-face (#3691)

From: Mike Bremford via GitHub <sysbot+gh@w3.org>
Date: Thu, 28 Feb 2019 12:10:29 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-415593033-1551355827-sysbot+gh@w3.org>
faceless2 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-fonts] Suggest allowing a list of font-family values in @font-face ==
@font-face only allows a single value for the "font-family" entry, but I can't think of a reason that a list shouldn't be allowed here, and at times it could be useful.

An example: "NotoSans-Black.ttf" has two names in the OpenType name table: "Noto Sans" and "Noto Sans Blk". While best practice would be to define the Noto sans families like so:
```
@font-face {
    font-family: "Noto Sans";
    font-weight: 900;
    url(NotoSans-Black.ttf);
}
@font-face {
    font-family: "Noto Sans";
    font-weight: 400;
    url(NotoSans.ttf);
}
```
I can't think of any ambiguity that would arise if you could also do this:
```
@font-face {
    font-family: "Noto Sans", "Noto Sans Blk";
    font-weight: 900;
    url(NotoSans-Black.ttf);
}
@font-face {
    font-family: "Noto Sans";
    font-weight: 400;
    url(NotoSans.ttf);
}
```
This would be also useful if the font has names in several languages, eg "MS Mincho" and "MS 明朝". In fact that's probably a more compelling usecase, I should have opened with that really.

Finally, it's also an advantage when generating @font-face rules automatically from font files; there's no need to choose which of the several names an OpenType font is known by as the definitive one, you can just list all the appropriate entries.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3691 using your GitHub account
Received on Thursday, 28 February 2019 12:10:30 UTC

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