[csswg-drafts] [css-fonts-4] Matching fallback fonts when a variation font is defined by @font-face rule

vlevantovsky has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-fonts-4] Matching fallback fonts when a variation font is defined by @font-face rule ==
In "[Matching font styles](https://drafts.csswg.org/css-fonts-4/#font-style-matching)", step 4 refers to "[Feature and variation precedence](https://drafts.csswg.org/css-fonts-4/#apply-font-matching-variations)", where steps 2 and 3 define precedence for font variation properties. However, nothing is mentioned about the processing of [OpenType registered variation axis tags](https://www.microsoft.com/typography/otspec/dvaraxisreg.htm) (such as 'wght', 'wdth', 'ital', etc.).

Let's assume that an author selects a desired variation font that is defined using @font-face rule, and defines "Arial" as a fallback font family. The primary font choice is defined with its weight axis value selected using font weight property descriptor:
`@font-face {
   font-family: myVariableFontA;
   font-weight: 700;
}
`
According to the font style matching algorithm, if `myVariableFontA` fails to load, a browser should select "Arial Bold" as a fallback font.

However, if the same variable font supports multiple variation axes, the author could use @font-face rule to define e.g. condensed bold face using two or more variation settings in a single line using font-variation-settings
`@font-face {
   font-family: myVariableFontA;
   font-variation-settings: 'wght' 700, 'wdth' 70;
}
`
If `myVariableFontA` fails to load, "Arial Bold Condensed" should be chosen as a fallback font; however, the font style matching algorithm is completely silent about how known / registered variation tags should be treated as part of the font property settings. (The same is true even if only a single variation axis tag is defined by font-varation-settings - known / registered tags should be processed and matched the same way as their explicitly defined counterparts (font-weight, font-style, font-stretch, etc.).


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2218 using your GitHub account

Received on Tuesday, 23 January 2018 15:21:24 UTC