freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] QUESTION: How to find fonts on Linux


From: Christian Langis
Subject: [ft] QUESTION: How to find fonts on Linux
Date: Wed, 19 Oct 2005 16:34:59 -0400

Hi there

I already wrote an application with FreeType on Windows. I am writing the Linux version right now.

Looking for fonts in Windows is straightforward. Inspecting the registry, you can get all fonts available in the system in the form (fontName, FontFile). With this in hand, you have all the data you need to feed FreeType with font files.

On Linux, I failed with the same approach. First, I tried to get font directories. On the system I am using, the system function XGetFontPath() returns:

 /usr/X11R6/lib/X11/fonts/misc/
 /usr/X11R6/lib/X11/fonts/Type1/
 /usr/X11R6/lib/X11/fonts/75dpi/
 /usr/X11R6/lib/X11/fonts/100dpi/

which contain essentially bitmap pcf.gz fonts which are innapropriate for my application (I need scalable fonts only such as TTF for example, it's a graphical application). There are few Type 1 fonts available, but there are fonts scattered between 2 file types *.pfb for the geometry and *.pfm for the metrics. How does that work with FT_New_Face() where thre is only one file parameter anyways?...

A quick search on this Linux box revealed other locations, omitted by XGetFontPath(), containing the bulk of the fonts of interest:

/pub/Documentation/Administration/Fonts/Fonts/
/usr/share/fonts/...

Considering that Freetype does not provide means to find the font files, the problem is the following: my application should (as much as possible) enforce an even and coherent installation between different Linux platforms. In other words, my application should provide the user with the same fonts wherever he runs it.

Should I assume that the standard font directories (the 4 above) are useless to search?

Should I assume that the other 2 (above) are standard (always exist) and should be searched for fonts?

Should I assume that there are no other places to look for?

Should I resolve to program a recursive search of those directories (may delay the application) or use some freely available library?

I am also thinking of packaging some free fonts with the application as this seems what /usr/share/fonts/ is for: installing application specific fonts.

Comments & advices welcome

Thanks





reply via email to

[Prev in Thread] Current Thread [Next in Thread]