I cannot enable font hinting in programs which (as far as I understand) do not use the global fontconfig settings.
I first thought it was related only to urxvt.
urxvt -fn "xft:Consolas:pixelsize=15:hinting=true:hintstyle=hintfull:antialias=true"
or grep hint .Xresources
Xft.hinting: true
Xft.hintstyle: hintfull
URxvt.font: xft:Consolas:pixelsize=15:hinting=true:hintstyle=hintfull:antialias=true
There is no hinting. But in experimenting with other terminals such as xterm or st, they also have the same issue of ignoring the hinting.
Similar to another question here, I can also use pango-view:
$ export FC_DEBUG=1
$ pango-view --hinting=full --backend=xft --font=Consolas -t 'Hello world' | grep hint
hintstyle: 3(i)(w)
hinting: True(s)
$ pango-view --hinting=none --backend=xft --font=Consolas -t 'Hello world' | grep hint
hintstyle: 3(i)(w)
hinting: False(s)
Despite the debug message with hinting True/False difference, there is absolutely no difference at all in the font rendering: Both render as hinting=none
. However, with option --backend=cairo
, then the hinting takes place and there is a noticeable difference in the rendered fonts.
I've tried hintfull
, hintmedium
, hintslight
– none have any effect.
My story is that I have in fact used urxvt with hinting for a few years. I'd been using this "infinality" freetype patch and configuration, but this now no longer works. So, I'm now using the default freetype (version 2.9-2) package provided by Arch Linux.
The only configuration I did is to enable hinting in the global configuration as follows:
~/.config/fontconfig/fonts.conf
<match target="font">
<edit name="hintstyle" mode="assign">
<const>hintmedium</const>
</edit>
</match>
This successfully applies hinting for all programs except urxvt and friends. (One irregularity here is that I used hintmedium
here instead of hintfull
– for unknown reasons, inside fonts.conf hintfull
has no effect whatsoever and is the same as hintnone
)
So, any ideas on why hinting might not be working for urxvt or st?