2

I've got a QGIS setup running, except for the custom fonts. They work just fine on my desktop machine (OS X), but they don't work on the server (Debian Linux).

I've got the .ttf files installed in the system, so that should work. I also found something online about a fonts.txt file, so I created that:

Merriweather    /usr/share/fonts/truetype/Merriweather-Regular.ttf
Kingthings Calligraphica    /usr/share/fonts/truetype/Kingthings_Calligraphica_2-webfont.ttf

but it doesn't seem to do anything. Unfortunately, documentation on this seems to be lacking. Has anyone got this working and can tell me how to correctly setup my fonts?

1 Answer 1

4

Adding fonts to Debian should generally be done at the 'local' or user level, instead of the system. You should copy them into /usr/local/share/fonts (for all users) or ~/.fonts (for a specific user).

Reference the official font docs on how to load fonts and ensure they are actually being loaded by fontconfig. If rebuilding the font cache, i.e. fc-cache -fv, does not work, you may have run across an incompatible font.

Note: Due to the intricacies of each platform's font rendering toolkit, you may see differences even when the same font file is used. For example, if you layout your project layers using Merriweather (nice font, btw) on QGIS Desktop on Mac, but serve it from Debian, you should ideally proof the same project on QGIS Desktop for Debian first.

I usually do this using Debian or Ubuntu virtual machine in Parallels. If I find there are a lot of small adjustments needed (to make it look like on the Mac), I might craft a script to process the .qgs project upon upload to the server.

Efforts are underway to ensure better parity across platforms, but there undoubtedly will always remain slight variances.

1
  • 1
    Thanks, this and a bit of fiddling around solves the issue. One more hint for others is that fc-match and fc-list help to figure out the exact names to use (it was "Kingthings Calligraphica 2", for example, note the number. Meanwhile, the fonts.txt file doesn't seem to have any effect or use.
    – Tom
    Commented Mar 5, 2014 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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