Bug 227353

Summary: Font optical sizing is broken when set to default value
Product: WebKit Reporter: Ernst <herr.ernst>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, gsnedders, mmaxfield, stephen, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: macOS 11   
See Also: https://bugs.webkit.org/show_bug.cgi?id=257401
Attachments:
Description Flags
test case
none
screenshot documenting the issue none

Description Ernst 2021-06-24 08:37:16 PDT
Created attachment 432167 [details]
test case

When setting the `opsz` axis in a variable font to the default value, it gets sized incorrectly.

Attached is an example where Source Sans (with its default opsz value of 20) is used as a variable font, and for testing purposes the optical size is set to increasing values. Notice the wrong jump when set to 20, which is the default (nearby values like 19.999 and 20.001 work correctly). Firefox and Chrome work correctly.
Comment 1 Ernst 2021-06-24 08:40:36 PDT
Created attachment 432168 [details]
screenshot documenting the issue
Comment 2 Radar WebKit Bug Importer 2021-07-01 08:38:16 PDT
<rdar://problem/80026031>
Comment 3 Sam Sneddon [:gsnedders] 2021-08-04 09:16:11 PDT
This appears not to reproduce in macOS 12 (but does reproduce with STP 128 on macOS 11).
Comment 4 Ahmad Saleem 2023-02-20 15:21:56 PST
@Myles - will it be fixed by your recent work around this?
Comment 5 Ahmad Saleem 2023-07-13 16:26:27 PDT
Safari 16.5.1 seems to have fixed it but Safari Technology Preview 174 and WebKit ToT seems to have it as broken. Confused!
Comment 6 zalan 2023-07-21 07:14:57 PDT
This has regressed at 264750@main
Comment 7 Stephen Nixon 2024-05-27 08:44:20 PDT
Confirming this is still an issue in Safari Version 17.3.1 (19617.2.4.11.12) and Safari Tech Preview Release 195 (Safari 17.4, WebKit 19619.1.15.0.1).

This bug is super disruptive in fonts that have wider opsz ranges than Source Serif. A major benefit of optical sizing is that it can be automatic, but WebKit is holding it back across browsers. Please consider prioritizing this issue. 🙏