Fonts in GTK4 apps are ugly

Fonts in GTK4 apps are ugly. Why?

Here is simple GTK3 app color picker.

And here is simple GTK4 app gtk4-demos

Here is my /etc/fonts/local.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

    <!--
        per-user config    ~/.config/fontconfig/fonts.conf
        global config      /etc/fonts/local.conf 
    -->

    <match target="font">
        <edit name="antialias"      mode="assign"><bool>true</bool></edit>
        <edit name="hinting"        mode="assign"><bool>true</bool></edit>
        <edit name="autohint"       mode="assign"><bool>false</bool></edit>
        <edit name="hintstyle"      mode="assign"><const>hintfull</const></edit>
        <!-- hintstyle = hintfull | hintmedium | hintslight | hintnone -->
        <edit name="rgba"           mode="assign"><const>none</const></edit>
    </match>

</fontconfig>

Do I miss something?

You should use hintslight not hintfull for hintstyle.

No, it didn’t help. Result is the same. :anguished:

To enable this use the following file and option

~/.config/gtk-4.0/settings.ini

[Settings]
[...]
gtk-hint-font-metrics=1
[...]

https://wiki.archlinux.org/title/GTK#Text_in_GTK_4_applications_is_blurry_or_renders_incorrectly

It is also noted in this issue:

That you may need to also set

gtk-font-rendering=manual

For the above to be effective.

The following options may or may not also be helpful

gtk-xft-hintstyle=hintslight
gtk-xft-hintstyle=hintfull
gtk-xft-antialias=0
gtk-xft-hinting=1

(obviously choose either hintslight or hintfull for the hintstyle, and either 0 or 1 for the others)

Notes for Gnomes

Gnome will override your settings. Because Gnome.
You must use gsettings to actually apply any of the options described above. ex;

gsettings set org.gnome.desktop.interface font-rendering 'manual'
1 Like

This helped me
~/.config/gtk-4.0/settings.ini

[Settings]
gtk-hint-font-metrics=1
gtk-font-rendering=manual

Thanks!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.