[Fontconfig] Difficulty finding a font file through the libraries

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Thu Oct 28 23:31:52 UTC 2021

I wrote:

> I don’t think Ghostscript uses Fontconfig. When I do “apt showpkg
> ghostscript” on my Debian system, there is no sign of libfontconfig1
> in its dependencies, as is present for example for Inkscape.

On the other hand, when I run “gs --help”, in the usage summary it
reports “Ghostscript is also using fontconfig to search for font files”.

> This page <https://ghostscript.com/doc/current/Fonts.htm> describes
> how Ghostscript finds its fonts. I can find no mention of Fontconfig
> there. Instead, you have to manage a “Fontmap” file.
> Looking at my installed Ghostscript package under Debian, I see a
> directory called “/etc/ghostscript/fontmap.d/”. I think this is where
> you place Fontmap-type files.

Ah, turns out the “Fontmap” file is located in
/var/lib/ghostscript/fonts/, and Debian provides a
/usr/sbin/update-gsfontmap script to regenerate that from the contents
of the fontmap.d directory.

> Is there a per-user directory as well? Don’t know ...

Not for (re)generating the Fontmap, but there is for Fontconfig.

Are you running the Fontconfig tools as the same user as Ghostscript?
Just to be sure they are looking at the same config ...

More information about the Fontconfig mailing list