Skip to content

Allow floating point value for webview body font size

Guillaume Castagnino requested to merge (removed):master into master

I discovered that the webview part of the evolution UI (the one displaying the mail headers and content) does not respect the system font size if you set a floating point font size. My case is setting a font size of 10.5pt, corresponding to 14px or 0.875em (the material design default value for body) at 96dpi.

Allowing a floating point value is important as 10pt corresponds to 13px and 11pt corresponds to 15px. 10.5pt is needed to fill the gap between those sizes. Moreover, setting a floating point font size is perfectly valid for pango.

The issue is that the value injected in the user CSS webview is rouded to an integer by a side effect of a computation.

This MR converts this to a double value. This way, the 10.5 value configured in GTK/Xsettings settings is correctly translated into the webkit user CSS. I am using g_ascii_dtostr with an intermediate buffer instead of directly a "%f" in the g_string_append_printf as this exhibits a side effect of locales (my locale uses a comma instead of dot as decimal separator for example, which is invalid in CSS).

This patch is applyed here against master, but it applies correctly (with a hunk) on 3.30 branch too (that I currently using for day to day use)

Merge request reports