-
Notifications
You must be signed in to change notification settings - Fork 756
Description
@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.