Discussion:
Looking for an installed font
Andreas Röver
2013-04-22 17:58:30 UTC
Permalink
Hello,

I've written a game that uses FreeSans as the font for displaying its
text.

I do not want to include that font in the distribution of the game but
rather use a the font file normally installed on the system. For that I
want to check in configure whether the font file is available in the
system and display an error message or warning if it is missing.

How could I do that? Is there anything provided in autoconf for that
problem? I think it might be good enough to see if the file is on the
filesystem but the problem is that the position is not standardized. Is
there any nice way to use 'find' or anything else to look into the
subdirectories of /usr/share/fonts for this?

Or do you have any other ideas how to do this?

Thanks

Andreas
Bob Friesenhahn
2013-04-22 19:45:07 UTC
Permalink
Post by Andreas Röver
Hello,
I've written a game that uses FreeSans as the font for displaying its
text.
I do not want to include that font in the distribution of the game but
rather use a the font file normally installed on the system. For that I
want to check in configure whether the font file is available in the
system and display an error message or warning if it is missing.
How could I do that? Is there anything provided in autoconf for that
problem? I think it might be good enough to see if the file is on the
filesystem but the problem is that the position is not standardized. Is
there any nice way to use 'find' or anything else to look into the
subdirectories of /usr/share/fonts for this?
It seems that the standard way to do this is via libfontconfig which
is available on all free OSs. The actual font installation locations
vary across systems.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Loading...