[Fontconfig] How to list fonts? (or, what is an _FcPattern)

Travis Griggs tgriggs at key.net
Wed Nov 2 15:24:04 PST 2005


On Nov 2, 2005, at 15:17, Patrick Lam wrote:

> Travis Griggs wrote:
>> I'm trying to use XftListFonts() to list fonts. The problem is...   
>> after
>> digging through header files, I can't figure out how one goes   
>> from the
>> FcFontSet* returned by this thing to something you can  display in a
>> dialog. Because I can't find the definition of an  _FcPattern. I'm
>> running on debian testing, and I have the fontconfig- dev package
>> loaded, so I don't know what gives.
>
> The FcPattern contents are opaque.  However, what you probably want to
> do is to iterate over the array in the FcFontSet and call e.g.
> FcPatternGetString (p, FC_FAMILY, 0, &s); to get the family name of an
> FcPattern (returned in s).
>
> One way of going from an FcPattern to a string is FcNameUnparse,
> although this is probably not the string you want.
>
> You may want to consult fc-list/fc-list.c

Aha! Thank you. I saw the accessors, but skipped right over them, I  
was so intent on just setting up a mirror structure definition in my  
language binding. Thank you again.

--
Travis Griggs
Objologist
"Only one thing is impossible for God: to find any sense in any  
copyright law on the planet." -- Mark Twain



-----------------------------------------
DISCLAIMER: This email is bound by the terms and conditions described
at
http://www.key.net/disclaimer.htm




More information about the Fontconfig mailing list