brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: fc-match tells you which font Linux really picks for a name

Troubleshooting
~/tips/tip-troubleshooting-fc-match-font

fc-match Helvetica

See the fallback font you get when the requested one is missing.

A generated PDF, a server side screenshot or a chart comes out with odd letter shapes. Usually the font you asked for isn’t there and something else took its place without telling you.

Ask fontconfig what it would hand out:

fc-match Helvetica

The answer names the file and the family that will be used, for example:

LiberationSans-Regular.ttf: "Liberation Sans" "Regular"

It also works for the generic names, so you can see what monospace or sans-serif mean on this machine:

fc-match monospace

To see the whole fallback order, sort the matches:

fc-match -s monospace | head

I run this inside the container or on the server that does the rendering, since my own desktop has a completely different set of fonts.

Note that fc-match always answers with something, even for a name that doesn’t exist. Don’t read a reply as proof the font is installed. Compare the family in the output with what you asked for. After adding fonts, fc-cache -f refreshes the cache, and a running service may need a restart before it notices. Some programs ship their own font handling and ignore fontconfig altogether.

Further reading: fontconfig user documentation

More Troubleshooting tips Get-NetTCPConnection -State Listen modinfo -p usb_storage ps -o pid,lstart,etime,cmd -p 1234 sudo lsof -nP -p 1234 wp plugin list --status=active --field=name > active-plugins.txt All Troubleshooting tips (21) All topics

Link