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'