Intent to Ship: font-variant-alternates and the @font-feature-values at-rule

95 views
Skip to first unread message

Dominik Röttsches

unread,
Dec 7, 2022, 9:50:36 AM12/7/22
to blink-dev

Contact emails

dr...@chromium.org

Explainer / Specification

https://drafts.csswg.org/css-fonts-4/#font-variant-alternates-prop
(This section contains details examples including images on how this feature enables easier activation of font features.)

Summary

font-variant-alternates enables simpler access to glyph alternates in fonts such as swashes, character-variants, ornaments and more. It provides an easier method over having to use 4-letter-codes (e.g. 'swsh', 'cv01'...) as arguments to font-feature-settings. font-variant-alternates refers to the @font-feature-values at-rule to map speaking feature names to OpenType feature numbers. In the font-variant-alternates style rule, the requested feature activation becomes easy to use and to read and allows flexible combination of font features.


Motivation

As part of Interop 2022 we committed to supporting font-variant-alternates and @font-feature-values in order to reach parity with Firefox and Safari on this aspect of OpenType feature selection through CSS.


The ergonomics of font-variant-alternates are better than having to know OpenType feature codes and passing them to font-feature-settings.



Blink component

Blink>Fonts

TAG review

Shipping in two browsers for a long time.

TAG review status

Not applicable

Risks



Interoperability and Compatibility

Low, extensively tested in WPT, shipped in Firefox and Safari.



Gecko: Shipped/Shipping (https://caniuse.com/?search=font-variant-alternates) Shipped in Firefox since 34.

WebKit: Shipped/Shipping (https://caniuse.com/?search=font-variant-alternates) Shipped in Safari since 9.1

Web developers: Web developers opinions were taken into account in the interop 2022 process - so I'd tend to say the fact it's part of Interop 2022 indicates: "positive".

Other signalshttps://wpt.fyi/interop-2022 - font-variant-alternates amounts to 16% improvement in the Fonts and Typography Category of Interop 2022, about ~1% of the total score.

Ergonomics

This feature provides an ergonomics improvement over font-feature-settings.



Activation

Developers can immediately benefit from this feature when they write their own @font-feature-values mappings to font features, based on the font's documentation or tools such as https://wakamaifondue.com/. On top of that, if the font foundry provides a @font-feature-values block, it becomes even easier to activate font features.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?



Debuggability

The font-variant-alternates property is debugged through DevTools as usual. This way parsing issues or invalid values can be detected. There's no extra support for the @font-feature-values rule.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

Flag name

Atm available behind experimental web platform features (sson in Canary, from 12/8/22)

Requires code in //chrome?

False

Tracking bug

https://crbug.com/716567

Sample links

https://roettsch.es/montecarlo.html

Estimated milestones

110


Anticipated spec changes

None


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5070560260784128

Philip Jägenstedt

unread,
Dec 7, 2022, 10:41:56 AM12/7/22
to Dominik Röttsches, blink-dev
LGTM1, I'm very happy to see this ship. I tried out https://roettsch.es/montecarlo.html in Firefox and Safari, and those are some very swishy swashes, looking forward to that demo also working in Chrome :)

And the tests are here:

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN6muBsWXm4CYzT_%2BsTVW8X%3DKMJfkmVEv40_QHTjmDOV%3DSwAHA%40mail.gmail.com.

Chris Harrelson

unread,
Dec 7, 2022, 10:44:29 AM12/7/22
to Philip Jägenstedt, Dominik Röttsches, blink-dev

Yoav Weiss

unread,
Dec 7, 2022, 10:47:55 AM12/7/22
to Chris Harrelson, Philip Jägenstedt, Dominik Röttsches, blink-dev

Šime Vidas

unread,
Mar 20, 2023, 1:43:49 PM3/20/23
to blink-dev, yoav...@chromium.org, Philip Jägenstedt, dr...@chromium.org, blink-dev, Chris Harrelson
Could you also update MDN’s browser compat data? It still says that Chrome does not support things like styleset(). See https://caniuse.com/?search=font-variant-
Reply all
Reply to author
Forward
0 new messages