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-cache -f makes newly copied fonts show up by rebuilding the font cache

Cache
~/tips/tip-fc-cache-new-fonts

fc-cache -f -v ~/.local/share/fonts

Get programs to see a font you just copied into your home folder.

I copy a font file into the right folder on a Linux desktop and the program’s font list still does not show it. Fontconfig keeps an index, and it can be told to look again.

Put the file in your personal font folder, then rebuild:

mkdir -p ~/.local/share/fonts
cp MyFont.ttf ~/.local/share/fonts/
fc-cache -f -v ~/.local/share/fonts

-f scans even folders whose cache looks up to date, and -v shows which directories it visits and how many fonts it found there. Check the result with:

fc-list | grep -i myfont

If the font is listed, restart the program that should use it, since many read the list only once at startup.

Installing for yourself this way needs no sudo. For all users the files go under /usr/local/share/fonts, and then you run sudo fc-cache -f. Containers and servers that render PDFs or screenshots have the same issue, so add the command to the image build after copying fonts. A font that is damaged or in an unsupported format will not appear no matter how often you rebuild.

Further reading: fc-cache(1) man page

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Cache tips fincore /var/lib/example/data.db npm cache verify proxy_cache app; Cache-Control: no-cache Cache-Control: max-age=60, stale-while-revalidate=600 All Cache tips (24) All topics

Link