NEW 260196
Full hinting broken by subpixel positioning
https://bugs.webkit.org/show_bug.cgi?id=260196
Summary Full hinting broken by subpixel positioning
Pierre Ossman
Reported 2023-08-15 03:43:52 PDT
Modern versions of Epiphany have random blurry text if the system is configured with full hinting (and you are using strongly hinted fonts). This issue has been reported to some other places already: https://bugzilla.redhat.com/show_bug.cgi?id=1999078 https://gitlab.freedesktop.org/cairo/cairo/-/issues/511 The problem might be with how WebKit uses cairo, though, not in cairo itself. GTK has also struggled with this issue: https://gitlab.gnome.org/GNOME/gtk/-/issues/3787 Right now, they seem to have landed in disabling sub-pixel positioning for standard DPI displays: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6190 Hopefully, something similar can be done in WebKit?
Attachments
Michael Catanzaro
Comment 1 2023-08-15 07:11:19 PDT
I'm pretty sure WebKit does not do subpixel positioning at all? I thought it only does hinting. So I doubt any of those issues are relevant.
Pierre Ossman
Comment 2 2023-08-15 07:20:51 PDT
That was the diagnosis in the Red Hat bug linked above, given the various tests with pango and cairo. Especially the last test, where a special build of cairo without subpixel positioning got rid of the issue. Could it be that subpixel positioning is the new default in cairo, and WebKit needs to do something explicit to turn it off? That merge request for GTK shows some extra cairo calls. Could those be relevant for WebKit?
Michael Catanzaro
Comment 3 2023-08-15 07:54:58 PDT
(In reply to Pierre Ossman from comment #2) > Could it be that subpixel positioning is the new default in cairo, and > WebKit needs to do something explicit to turn it off? Maybe and maybe. > That merge request for GTK shows some extra cairo calls. Could those be > relevant for WebKit? Maybe. Truth is, nobody here understands font rendering except Carlos Garcia, and he is telling me "I don't know." I will try asking around, but we probably won't change anything unless a font expert decides to get involved and tell us specifically what to do. What I do know is that subpixel positioning is incompatible with hinting, so you need to do only one or the other in a particular direction (horizontal or vertical). By default, FreeType does vertical hinting only and does not perform horizontal hinting, so horizontal subpixel positioning should be OK, but we need to make sure not to do any vertical subpixel positioning. It sounds like there are not currently any problems with that. But when you configure "full" hinting (which is not recommended by the FreeType developers and font experts I have talked to) then hinting may be performed horizontally too, so then we need to make sure we are additionally not doing any horizontal subpixel positioning. Sounds like something is wrong there.
Michael Catanzaro
Comment 4 2023-08-15 08:03:29 PDT
(In reply to Pierre Ossman from comment #0) > Right now, they seem to have landed in disabling sub-pixel positioning for > standard DPI displays: > > https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6190 > > Hopefully, something similar can be done in WebKit? What that merge request does is forcibly enable "hint metrics" when the display scale factor is 1, and forcibly disables "hint metrics" at all other scale factors. Presumably that indirectly disables/enables subpixel positioning as well? I don't know. There is no subpixel positioning setting. I also don't know what "hint metrics" are or how this setting interacts with the separate "hint style" setting.
Note You need to log in before you can comment on or make changes to this bug.