My image processing package has an 'annotate' utility that supports about a dozen fonts. It runs fine on my development system but, predictably, some fonts will not be installed on target systems. It is designed to run on any LINUX distribution.

I distribute needed fonts with my application, but I wish to spare users the hassle of installing the fonts. I am assuming no LINUX expertise on the part of my users, and I do not want them to have to be 'root' to do anything.

How can I make my application directly access the fonts distributed with it instead of forcing the user to embark on a confusing sysadmin font installation task?

Many thanks.



I'm targeting ALL Linux distributions. UBUNTU is a subset of all. Researching various LINUX distributions, there is a mishmash of approaches to font management. I cannot support each one individually. My app is designed to be installed under the user account, avoiding root access (until moving successful install to /opt) and accessing fonts from its distribution. Similarly, security concerns prevent running an installation script as root. Similarly, targeting ALL Linux distributions precludes becoming a client of any single Linux 'app store' and environment. Yes this is all politically incorrect and my apologies. Thanks.

  • Unless you're targeting Ubuntu specifically, you should ask on Unix & Linux. – muru Dec 30 '14 at 16:45

You don't want the users to have to use root? Installing softare usually requires root.

On Ubuntu (and I'd assume most debian-based distros) you can copy the fonts into a subdirectory of /usr/share/fonts/truetype (I assume they are TTF's) and update the font cache.

If you're creating a deb package, you can simply pack them so that they will be installed into, let's say /usr/share/fonts/truetype/<softwarename>-fonts/. In the postinst script, you can then run
fc-cache -f -v.

If you're simply publishing a installation script, mkdir the subdirectory, then cp the TTF's into it. Afterwards, call fc-cache -f -v to rebuild the font cache.

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.