One of the hardest parts about building beautiful Linux systems is fonts. Fonts on Linux are generally handled with fontconfig . Unfortunately, fontconfig has no real GUI editors or usable interactive configuration tools, so users are expected to manually edit XML configuration files.
As with most Unix styling topics, Eevee has a great piece on fontconfig’s complexities. She digs into how to disable and re-configure fonts, how to set fallbacks, and how to verify that the correct resolution order is set.
Fontconfig relies on a set of config files, generally in
, which are loaded in alphabetical order. These are usually prefixed with a number, so it’s easy to determine the order.
Unfortunately, it can be very complex to determine where a specific font or option is configured. In my recent case, I wanted to switch from
as my default to
, and I spent the better part of an hour flipping around different files changing mentions of
Deja Vu X
Bitstream Vera X
Eventually, I settled on the following methodology:
rgto search for the incorrectly resolved font (e.g.
rg DejaVu .*).
69-language-selector-zh-tw.conf, it was only selecting DejaVu Sans Mono for language
zh-tw, which is actually correct as Bitstream Vera Mono doesn’t include
I’ve been very successful with this methodology so far. In my specific case, I had to modify
, which was setting the default serif, sans serif, and monospace fonts to resolve to DejaVu followed by Emoji One.