Linux – Dethestifying Font Appearance on Linux : The Proper Way

debianfontslinuxUbuntu

Can someone enlighten me on the way font appearance (hinting, antialiasing) works? As far as I understand,

  1. There is .fonts.conf
  2. There are individual font settings for Gnome, XFCE and KDE (or do they just modify .fonts.conf; or else where do they keep their font configurations?) For XFCE, it is in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml for example.
  3. Then there are .Xresources and libXFT.
  4. Then there is some info regarding BCI which is not enabled by default, however this seems rather obsolete as far as I understand.
  5. Finally, there is the issue of a DPI setting, which I can specify in Xorg, or in each WM.

I am confused as to which setting is used when. To add more confusion, some terminal programs have an option to antialias fonts.

It seems that .fonts.conf is the best of these options; but still with a .fonts.conf the appearance seems to differ under different WMs.

I am running Debian and Ubuntu btw.

Best Answer

  • /etc/fonts hold Xft settings, while .fonts.conf is a per-user override of /etc/fonts/*
  • DEs set their settings using X settings daemon (there are several of them, one in each DE, and also several standalone for use with lightweight WMs)
  • applications get settings either from Xft directly (/etc/fonts), or from X settings daemon if it is active.
  • some applications (e.g. Google Chrome) only get settings from X settings daemon. so the only way to get proper fonts in Chrome running under lightweight WM is to run some sort of xsettingsd
  • gtk and qt apps treat some of Xft settings differently, so it can be tricky to create fonts.conf that works in the same way in Qt and GTK.

and here's what i think, but didn't really check:

  • GDK/Pango uses Xft with its default settings, either from fonts.conf or X settings.
  • Qt adds extra tweaks to fonts.conf settings, which breaks some of the settings.
  • Cairo seems to respect xft settings, but rendering looks slightly differently compared to Pango.
Related Question