GNOME Bugzilla – Bug 758367
GTK+ 3 does not respect bold in org.gnome.desktop.interface font-name
Last modified: 2015-11-23 13:22:16 UTC
Reproduction steps ---------------- 1. Open "dconf-editor" and set org.gnome.desktop.interface font-name to "DejaVu Sans Mono Bold 10". (Using gnome-tweak-tool works as well.) 2. Notice that gtk_label_new("any text") is NON-bold. Expected behavior ---------------- GTK apps respect the users' font-setting, even when it is a bold font. This is a degrade from GTK+2 to GTK+3. It is easy to see when compiling Wikipedia's "hello world" exampl, https://en.wikipedia.org/wiki/GTK%2B#Example # Correct. Shows bold fonts. $ cc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs gtk+-2.0) # Wrong. Does not show bold fonts. $ cc -Wall helloworld.c -o helloworld $(pkg-config --cflags --libs gtk+-3.0) More information ---------------- I first saw this on Fedora 22 and Ubuntu 14.04, but the problem is also in today's origin/gtk-3-18 (bd3ea2355bee3ff51647131bf2294afd245dd5a) and origin/master (0434649cc14f1e860dca6ff14a2d3ce3aec68ac4). Workaround (proofs that GTK is indeed requesting the non-bold font): ---------------- Add this to your .fonts.conf <match target="pattern"> <test compare="eq" name="family" qual="any"> <string>DejaVu Sans Mono</string> </test> <edit binding="same" mode="prepend" name="weight"> <const>bold</const> </edit> </match>
GTK+ only takes the family name and the size from the font setting. This is in line with what CSS does.