Summary: | [GTK] System font scaling not applied to 'font-size: XXXpt' | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Milan Crha <mcrha> | ||||||||||||||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||||
Severity: | Normal | CC: | badshah400, berto, bugs-noreply, cgarcia, ews-watchlist, gustavo, kozinov, webkit-bugs, zan | ||||||||||||||||||
Priority: | P2 | ||||||||||||||||||||
Version: | Other | ||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=221033 | ||||||||||||||||||||
Attachments: |
|
Description
Milan Crha
2020-11-02 09:38:06 PST
Hi, what about this issue, that affects Evolution's mail rendering. Anyone here wanting to get more information? Best Thomas For the record, the font scaling factor is stored in GSettings, at: org.gnome.desktop.interface text-scaling-factor I do not see it being read in the WebKit sources. One other thing, the pages define font sizes in points quite often, with which the application cannot do much, thus when the user wants bigger/smaller fonts, the WebKit can help with it internally. (It would be quite inefficient to traverse the whole document and apply font scaling factor for each affected element within the application.) I did some further tests and tested the effect of desktop scaling to the different forms of text size declaration. I created a HTML table containing text with size declared via CSS in pt, px and rem. I also test the outdated font tag with both relative size ("-2" - "+4") and absolute size (1-7). You can find the HTML in attached file mail.html. The I opened the file in Gnome Web and Chrome, you can find screenshots for both browsers with scaling 100%, 150% and 200%. The summary: While Chrome scales all kind of size declaration, Chrome Web scales only text with size declaration in rem and font tags with both relative and absolute size specification. Please review the attached screenshots to reproduce my findings! Created attachment 415205 [details]
HTML test file
Created attachment 415206 [details]
Screenshot with Chrome 100% scaling
Created attachment 415207 [details]
Screenshot with Chrome 150% scaling
Created attachment 415208 [details]
Screenshot with Chrome 200% scaling
Created attachment 415209 [details]
Screenshot with Gnome Web 100% scaling
Created attachment 415210 [details]
Screenshot with Gnome Web 150% scaling
Created attachment 415211 [details]
Screenshot with Gnome Web 200% scaling
Unfortunately I can't edit my comment: The (fixed) summary: While Chrome scales all kind of size declarations, Gnome Web scales only text with size declaration in rem and font tags with both relative and absolute size specification. WE are indeed getting and monitoring the text scale changes by GtkSettings:gtk-xft-dpi, but we are only applying it to the default font size and the calculations are not correct. I think we should always set the text scale factor as the WebPageProxy text zoom factor. That will be applied in all the cases. Created attachment 416505 [details]
Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API Committed r271354: <https://trac.webkit.org/changeset/271354> |