[csswg-drafts] [css-fonts-4] `font-variant-alternates` implementation (#5799)

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

== [css-fonts-4] `font-variant-alternates` implementation ==
The [`font-variant-alternates`](https://drafts.csswg.org/css-fonts-4/#font-variant-alternates-prop) property controls things like stylistic sets, alternate forms, swashes, ornaments, annotation numbers, and the like.

![styleset](https://drafts.csswg.org/css-fonts-4/images/ssnn.png)
![swash](https://drafts.csswg.org/css-fonts-4/images/swsh.png)
![annotation](https://drafts.csswg.org/css-fonts-4/images/nalt.png)

It was [dropped from CSS Fonts 3 in June 2018](https://github.com/w3c/csswg-drafts/commit/b6c4ba8463b89d7884b3ed04d808a469ecbf5f3e#diff-43296ff16ba6c335b677458589ed2d9fdd35650b9483e3babd020e8157162191) to allow that spec to move to Proposed Rec, because [only Firefox implemented it](https://test.csswg.org/harness/results/css-fonts-4_dev/grouped/section/6.8/).

It [looks like Chrome was implementing it](https://bugs.chromium.org/p/chromium/issues/detail?id=716567&q=font-variant&can=2) in 2018, but that issue recently went from `Assigned` to `Available`.

The same functionality is available via the [CSS Fonts 3 `font-feature-settings` property](https://www.w3.org/TR/css-fonts-3/#font-feature-settings-prop), but that is a cryptic and low-level property. Also, it [doesn't cascade](https://github.com/w3c/csswg-drafts/issues/552), while `font-variant-alternates` does.

Note that [Chrome implements `font-feature-settings`](https://test.csswg.org/harness/results/css-fonts-3_dev/grouped/section/6.10/) and thus, the base functionality is implemented and available. The only thing missing, therefore, is parsing the property, getting the feature set in use on the current element, making the union of that set and the one specified, and putting the new feature set back. This is the exact same way that all the other, already implemented, higher-level properties like [`font-variant-ligatures`](https://www.w3.org/TR/css-fonts-3/#font-variant-ligatures-prop), [`font-variant-position`](https://www.w3.org/TR/css-fonts-3/#font-variant-position-prop), [`font-variant-caps`](https://www.w3.org/TR/css-fonts-3/#font-variant-caps-prop), [`font-variant-numeric`](https://www.w3.org/TR/css-fonts-3/#font-variant-numeric-prop) and [`font-variant-east-asian`](https://www.w3.org/TR/css-fonts-3/#font-variant-east-asian-prop) work, hiding the obscure low-level syntax and making it cascade.

Can anyone from Chromium comment on implementation status? Was it dropped because of an implementation difficulty, or just because someone moved on to other projects?

Given the [generally good typography on MacOS](https://www.macworld.com/article/3052388/how-to-access-advanced-opentype-features-in-a-variety-of-mac-apps.html), it would certainly make sense to see this implemented in Safari, too.

This is one of the ways that typography on the Web currently [lags behind native applications](https://typofonderie.com/font-support/opentype-features/) and print.

(Scroll down to "Which feature works in which program?" on [this support page](https://ilovetypography.com/OpenType/opentype-features.html)).

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


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

Received on Wednesday, 16 December 2020 16:46:43 UTC