[Fontconfig] Getting FC_FILE Using Fontconfig

Behdad Esfahbod behdad at behdad.org
Wed Mar 2 13:29:46 PST 2011

Hi Jeremy,

On 03/02/11 14:34, Jeremy Moles wrote:
> 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?

That's what FcFontMatch() does.

> 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.

Unfortunately Pango currently does not provide the function
pango_fc_font_description_to_pattern().  It will in some future version.
You can build a PangoFontDescription, but you need to convert that to a
Fontconfig pattern yourself (or copy the code from pango).

Hope that helps,


> I'll continue browsing through the source for now, but if anyone has any
> advice to get me started, I'd really appreciate it!
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fontconfig

More information about the Fontconfig mailing list