GNOME Bugzilla – Bug 768902
Font too small when using gtk_widget_override_font()
Last modified: 2016-07-29 17:33:54 UTC
There is a font size problem in GtkSourceView with GTK+ 3.21, the font size is too small. See the 'Changes in GTK+ 3.22': https://developer.gnome.org/gtk3/unstable/ch32s11.html """ The CSS parser has gotten a bit more selective in what it accepts as valid values for the font: shorthand. Following the CSS specification, at least a size and a family name are required now. If you want to change an individual facet of the font, like the weight, use the individual CSS properties: font-weight, font-size, font-family, etc. """ See also this commit: https://git.gnome.org/browse/gtk+/commit/?id=99c2423043f0c95a60093c618e00823e42e0ddfa It is maybe how CSS treats pt vs px.
It's actually a problem with gtk_widget_override_font(). That function is deprecated, but is still used in gedit for example.
This affects us in Eclipse/SWT as well, a big blocker.
Can we have a testcase for this? How much smaller is it?
This bug is tracked upstream for us: https://bugs.eclipse.org/bugs/show_bug.cgi?id=494183 Our "fix" is to use CSS to set the font, but that only seems to work for the default/initial font size. Changing the font size doesn't change the size of the widget it belongs to, so the font is huge but the widget hasn't adjusted its size. This breaks all of our setFont() API. The ideal solution would be to fix gtk_widget_override_font() so that it's working again as with GTK3.20 and below.
Created attachment 332269 [details] Test with GtkEntry
Thats using gtk_widget_override_font...
A deprecated API is supposed to still work as intended.
As per discussions on IRC, Benjamin is going to commit a patch that does font size conversions properly.
Thanks, I confirm that the font seems to have again the good size in gedit and other text editors.