Re: [csswg-drafts] Clarify precedence of font-feature-settings descriptor and font-variant property (#7498)

I think the issue here is a question of what the `normal` value for `font-variant` (and its subproperties) means. It's been a while since I worked on this, but my recollection is that our intention when designing this stuff was that `normal` means "use the default behavior for the font", not "set this particular collection of features that are considered normal". This could probably be made clearer in the spec, but I think it is the most natural interpretation of the [Feature Precedence](https://drafts.csswg.org/css-fonts-3/#feature-precedence) section:

> General and font specific font feature property settings are resolved in the order below, in ascending order of precedence. This ordering is used to construct a combined list of font features that affect a given text run. 
> 1. Font features enabled by default, including features required for a given script.
> 2. If the font is defined via an [@font-face](https://drafts.csswg.org/css-fonts-3/#at-font-face-rule) rule, the font features implied by the font-feature-settings descriptor in the [@font-face](https://drafts.csswg.org/css-fonts-3/#at-font-face-rule) rule.
> 3. Font features implied by the value of the [‘font-variant’](https://drafts.csswg.org/css-fonts-3/#propdef-font-variant) property, the related [‘font-variant’](https://drafts.csswg.org/css-fonts-3/#propdef-font-variant) subproperties and any other CSS property that uses OpenType features (e.g. the ‘[font-kerning](https://drafts.csswg.org/css-fonts-3/#propdef-font-kerning)’ property).
> 4. Feature settings determined by properties other than [‘font-variant’](https://drafts.csswg.org/css-fonts-3/#propdef-font-variant) or [‘font-feature-settings’](https://drafts.csswg.org/css-fonts-3/#propdef-font-feature-settings). For example, setting a non-default value for the ‘letter-spacing’ property disables optional ligatures.
> 5. Font features implied by the value of [‘font-feature-settings’](https://drafts.csswg.org/css-fonts-3/#propdef-font-feature-settings) property.

The `font-variant-*` properties come in at step 3 here, but (as I understand it), the `normal` value of a `font-variant-*` property does *not* mean "set it to a specific 'normal' value", but rather "don't touch it". Remember that default features such as common ligatures are already enabled at step 1; `font-variant-ligatures: normal` doesn't have to do anything in order to make this happen.

The `font-feature-settings` descriptor, then, which is step 2 here, is a tool to *modify the defaults for the font*, providing an updated base state to which `font-variant` properties can be applied. So if the `@font-face` rule says `font-feature-settings: "liga" off`, the default behavior of this font is to *not* use common ligatures. It's still possible for the author to override this, using `font-variant-ligatures: common-ligatures`, but `font-variant-ligatures: normal` does *not* change the ligature features from the (descriptor-modified) default.

I hope that's coherent enough to make sense.... I believe this reflects the implementation we've been shipping for some years now, and (as I understand it) this was always the intended relationship.

-- 
GitHub Notification of comment by jfkthame
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7498#issuecomment-1190529172 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 20 July 2022 17:01:21 UTC