[Fontconfig] Getting FC_FILE Using Fontconfig

Jeremy Moles jeremy at emperorlinux.com
Wed Mar 2 11:34:46 PST 2011

Hello everyone! I am the author of a piece of software called osgPango,
which glues Pango and OpenSceneGraph together in order to use Pango's
layout engine in OpenGL.

This software is used in both Linux and Windows (about half and half,
really), so some users are using the Freetype+Cairo backend to
rasterize, and others are using the Win32+Cairo backend. However, I'm
not entirely sure this information is relevant, though I include it
anyways. :)

My question is: using the Fontconfig API, is it possible to--in a
generic way--find out what font file (or more likely "files", the
Fontconfig API will probably want to work with sets of
data)--corresponds to a particular Fontconfig string?

For example, we love the expressively Pango provides when it allows us
to use fonts in the form of:

	"Arial Bold 20px"

However, a separate API requires the exact font "file" on disk instead,
and so we'd like to continue using this expressive Pango/Fontconfig
syntax in order to provide the REAL file to the older software.

I'll continue browsing through the source for now, but if anyone has any
advice to get me started, I'd really appreciate it!

More information about the Fontconfig mailing list