The following font changes it slant (backwards to forwards) depending
on a variable parameter: https://v-fonts.com/fonts/spektra
With a current WebKitGTK build from “trunk” the slant is always backwards.
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]
Tested patch locally as well, worked like a charm!
Committed r265648: <https://trac.webkit.org/changeset/265648>