| Summary: | REGRESSION(r254506): [Freetype] Spektra variable font does not work properly | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> | ||||||
| Component: | Text | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | cgarcia, clopez, mmaxfield, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Local Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| URL: | https://v-fonts.com/fonts/spektra | ||||||||
| Attachments: |
|
||||||||
|
Description
Adrian Perez
2020-08-06 06:07:20 PDT
Created attachment 406082 [details]
Side by side comparison of Epiphany (WebKitGTK) and Firefox
Screenshot showing Epiphany (left, with a WebKitGTK build from trunk)
and Firefox (right) with the test URL loaded and the “Italic” parameter
set to +20 in both cases.
WebKitGTK 2.28.4 (the most recent stable release at the moment) also shows this issue, so it does not seem to be a recent regression. It turns out the problem is not the spektra font, not even the font variation implementation, it's the webkit-font-smoothing cairo implementation that breaks font variations. So, what's different in https://v-fonts.com/fonts/spektra is that webkit-font-smoothing is used. This regressed in r254506, when a font smoothing mode is passed to drawGlyphsToContext() a new cairo font options is set, using the default font options and changing the antialiasing. This means the font options from the font (the ones containing the variation settings), set in the context by cairo_set_scaled_font() are lost. We should copy the scaled font options instead, then set the antialiasing and apply them. I'll prepare a patch and try to add a test. Created attachment 406518 [details]
Patch
Tested patch locally as well, worked like a charm! Committed r265648: <https://trac.webkit.org/changeset/265648> |