1

With dpkg new fonts get installed and usable in no time. When I add a font manually I have to use fc-cache -f, which takes a lot of time to complete. How do I install fonts manually the dpkg way? How does dpkg make them accessible to all applications without running fc-cache -f?

  • 2
    What about not using -f? There should be no need to regenerate everything. – Daniel B Feb 28 '18 at 20:14
  • 1
    @DanielB Why does everyone recommend fc-cache -f in their tutorial on how to install a font? – dirlago Feb 28 '18 at 20:28
  • dpkg is working with a source that's already been processed. Doing it manually isn't. – fixer1234 Mar 1 '18 at 0:20
  • Not quite true. Apparently it works either way. So they recommend the -f just in case. (To cover all imaginable cases.) – dirlago Mar 1 '18 at 8:41
  • Why? It most certainly doesn’t hurt. Also, everyone does it, so it must be right. It’s essentially a Cargo cult. – Daniel B Mar 1 '18 at 9:57
1

How do you make fonts accessible without running fc-cache -f

Don't run fc-cache -f!

At least on my system (Arch), fonts are picked up once they are placed in a directory known to fontconfig (and the cache has been rebuilt automatically).

fc-cache -f forces a rebuild of the font cache

From the man page for fc-cache:

-f
   Force re-generation of apparently up-to-date cache files, 
   overriding the timestamp checking.

But if the font cache doesn't need updated, why would you force it to be?

You can run fc-cache without arguments instead. The Arch wiki has more suggestions:

To install fonts system-wide (available for all users), move the folder to the /usr/share/fonts/ directory. [...]

Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library do this.)

  $ fc-cache

(emphasis mine)

Example

I didn't have the font Titillium Web installed:

grep -i titi returns nothing

So I downloaded it (permissive license, OFL!) and copied the ttf files to /usr/share/fonts/TTF. I was going to run fc-cache (sans -f) to see if the cache needed updated, but first I reran fc-list | grep -i titi:

oh there they (the fonts) are

The gif pauses for a while before looping as I was a bit surprised that the font cache had been updated

And they had already been cached! They were available to applications, as expected. No need for fc-cache, and definitely no need to force it with -f.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.