Intent to Ship: CSS font-synthesis property

153 views
Skip to first unread message

Munira Tursunova

unread,
Oct 5, 2021, 12:56:46 PM10/5/21
to blin...@chromium.org, Dominik Röttsches

Contact emails

moo...@google.com, dr...@chromium.org


Explainer

https://drafts.csswg.org/css-fonts-4/#font-synthesis-intro

https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis


Specification

https://drafts.csswg.org/css-fonts/#font-synthesis


Summary

The font-synthesis CSS property controls whether user agents are allowed to synthesize oblique, bold and small-caps font faces when a font family lacks oblique, bold and small-caps faces, respectively.



Blink component

Blink>Fonts


TAG review status

Already shipped in other browsers, see below, no TAG review required.


Risks



Interoperability and Compatibility
Low, feature already shipped in Firefox and Safari.


Expected graceful degradation if an engine has so far not implemented this feature: if the font-synthesis: property is not understood by an engine, this means unintended synthesis can occur. That's expected and the reason why this property was designed.


Signals


Gecko: Shipped/Shipping (https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis#browser_compatibility) https://bugzilla.mozilla.org/show_bug.cgi?id=1706080


WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=144180)


Web developers: No signals


Activation

None expected, feature already implemented in other browsers.



Debuggability

Same as any other CSS property, css_properties.json will be rolled to DevTools during development.



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

Yes, 36 new web tests pass: 16 new internal platform specific tests were added, 12 new WPT tests were added and 8 existing WPT tests are now passing.



Requires code in //chrome?

False


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=509989


Sample links


https://drafts.csswg.org/css-fonts-4/#font-synthesis-intro


Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5640605355999232


This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Oct 7, 2021, 3:09:21 AM10/7/21
to Munira Tursunova, blink-dev, Dominik Röttsches
LGTM1
Thanks for working on this!! This seems like an important thing to catch up on!



--
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/CAAO7W_AmPR6X7evqGz9P7bkW2ysRmr%3DqP4ajgGA%2BjOGfsp_FrA%40mail.gmail.com.

Daniel Bratell

unread,
Oct 7, 2021, 3:59:51 AM10/7/21
to Yoav Weiss, Munira Tursunova, blink-dev, Dominik Röttsches

Philip Jägenstedt

unread,
Oct 7, 2021, 4:28:57 AM10/7/21
to Daniel Bratell, Yoav Weiss, Munira Tursunova, blink-dev, Dominik Röttsches
It's great to see this feature getting ready to ship, it's one of a relatively small number of features already supported by Firefox and Safari but not by Chromium browsers, so it's been on my radar :)

I just have a few questions.

Looking at the font-synthesis-* tests in https://wpt.fyi/results/css/css-fonts?label=experimental&label=master&aligned, many pass in Firefox and Safari, but not all of them. Do all of these tests pass with the implementation now in Blink?

In the chromestatus entry I see "There are additional tests for system fonts with platform specific results, so we keep those as internal tests." Is the problem there that the tests rely on system fonts, or that there are platform-specific results? The latter is possible with WPT using the regular third_party/blink/web_tests/platform/ expectations. For system fonts, perhaps these tests could be written to pass if the fonts aren't present? If these are testharness.js tests, https://web-platform-tests.org/writing-tests/testharness-api.html#optional-features might be a path forward.

Also, looking at https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis#browser_compatibility I wonder if small-caps is going to be supported? If that table is correct it's not supported by Safari and it's only just now coming to Firefox.

Munira Tursunova

unread,
Oct 7, 2021, 6:34:18 AM10/7/21
to blink-dev, Philip Jägenstedt, yoav...@chromium.org, Munira Tursunova, blink-dev, Dominik Röttsches, Daniel Bratell

> Looking at the font-synthesis-* tests in https://wpt.fyi/results/css/css-fonts?label=experimental&label=master&aligned, many pass in Firefox and Safari, but not all of them. Do all of these tests pass with the implementation now in Blink?

Yes, they do. Actually these tests had been added with the Chrome implementation and they are responsible for longhands for font-synthesis property which is not supported by other browsers yet.

> In the chromestatus entry I see "There are additional tests for system fonts with platform specific results, so we keep those as internal tests." Is the problem there that the tests rely on system fonts, or that there are platform-specific results? The latter is possible with WPT using the regular third_party/blink/web_tests/platform/ expectations. For system fonts, perhaps these tests could be written to pass if the fonts aren't present? If these are testharness.js tests, https://web-platform-tests.org/writing-tests/testharness-api.html#optional-features might be a path forward.

Yes, they rely on particular aspects of which fonts are available on the system. As the font-synthesis property, when applied to system fonts, is closely connected to font matching and identifying whether a true bold / true italic variant exists, it’d be hard to make those flexible in terms of a default passing when the font does not exist. They are ref tests for that purpose.

>Also, looking at https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis#browser_compatibility I wonder if small-caps is going to be supported? If that table is correct it's not supported by Safari and it's only just now coming to Firefox.

Yes, small-caps support was also implemented in Blink (as longhand and as part of the shorthand). Also I’m not sure if that table is correct because Safari also supports ‘small-caps’ (only as a keyword in the shorthand) . They just have a bug in ref for this test: https://wpt.fyi/results/css/css-fonts/font-synthesis-06.html?label=experimental&label=master&aligned

Chris Harrelson

unread,
Oct 7, 2021, 3:27:56 PM10/7/21
to Munira Tursunova, blink-dev, Philip Jägenstedt, yoav...@chromium.org, Dominik Röttsches, Daniel Bratell

traci phebus

unread,
Oct 8, 2021, 1:06:20 AM10/8/21
to blink-dev, Chris Harrelson, blink-dev, Philip Jägenstedt, yoav...@chromium.org, Dominik Röttsches, Daniel Bratell, moo...@google.com
Guys i guess i don't deserve to have  this , because I don't really understand what it is and how it works, any tips?

Philip Jägenstedt

unread,
Oct 11, 2021, 6:04:23 AM10/11/21
to Munira Tursunova, blink-dev, yoav...@chromium.org, Dominik Röttsches, Daniel Bratell
Thanks for confirming, Munira!

Sounds like this is pretty well tested, and Chrome will pass almost all of the tests.

Regarding small-caps, the tables on MDN can definitely be wrong, I've sent https://github.com/mdn/browser-compat-data/pull/12782 to fix the Safari support here.

Finally, if there's a problem with https://github.com/web-platform-tests/wpt/blob/master/css/css-fonts/font-synthesis-06-ref.html, can you file a bug or a PR to fix the ref?

You already have 3xLGTM, but LGTM4.

Best regards,
Philip

Munira Tursunova

unread,
Oct 11, 2021, 7:14:27 AM10/11/21
to blink-dev, Philip Jägenstedt, blink-dev, yoav...@chromium.org, Dominik Röttsches, Daniel Bratell, Munira Tursunova
Thank you, Philip!

>Finally, if there's a problem with https://github.com/web-platform-tests/wpt/blob/master/css/css-fonts/font-synthesis-06-ref.html, can you file a bug or a PR to fix the ref?

No, there is no problem with https://github.com/web-platform-tests/wpt/blob/master/css/css-fonts/font-synthesis-06-ref.html, it's just not working correctly on Safari, I guess Safari has some bug.
Reply all
Reply to author
Forward
0 new messages