Re: [csswg-drafts] [css-fonts-4] Missing restrictions of multi-valued feature values (#9926)

The irregularities stem from the fact that `font-variant-alternates` tries to squeeze different kind of OpenType feature semantics into one property.

It's important to look at what kind of mapping the underlying OpenType feature is, and whether it is a) a toggle (like historical-forms), b) has "registers" or sets of mappings of which one can be selected, like `swsh` or c) has multiple sets of mappings, which can be combined (like stylistic sets or character variants) (and can be just toggled I) `ss(nn)` or be assigned a values II) `cv(nn)`.

1) When looking at `historical-forms` in `font-variant-alternates`, note that it does not have an argument - and can only be switched on or off. Think of it as working just like `font-variant-ligatures` or so. [`hist`](https://learn.microsoft.com/en-us/typography/opentype/spec/features_fj#hist) is a single on/off feature in OpenType. - So in my opinion, the general `@character-variant` production in [6.9.1](https://drafts.csswg.org/css-fonts-4/#font-feature-values-syntax) is not very useful. Mapping anything there would not be accessible in `font-variant-alternates`.

2) Stylistic sets, and character variants exist as `ss00-ss99`, `cv00-cv99` as OpenType features. Their maps contain multiple lookups 1:1 or n:1. They can be combined. Character variant features can be set to a value, example "cv00 = 3", so these are even a special case here.

3) Lookups that take a value, like the ones mentioned above: 
> @annotation, @ornaments , @stylistic, @swash
cannot be combined, and only one argument is possible. 

So Chrome decides to check these things at declaration time, but even if we were more lenient during the declaration phase, any other value cardinalities would not practically make sense in shaping when the features are selected from the fonts.

So to answer @svgeesus question, it's:
> 2. we are doing the right thing because (reasons) and the spec should change to reflect that

because reasons above. If we change the specs perhaps that can be done in a way that does not copy too much of OpenType but looks at the categories of feature settings. 


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


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

Received on Friday, 22 March 2024 16:26:28 UTC