[Fontconfig] Get font family name using font file name

Behdad Esfahbod behdad at behdad.org
Fri Jun 11 14:52:57 PDT 2010


On 06/09/2010 10:42 PM, deokjin kim wrote:
> Dear all,
> 
> I want to get font family name using font file name.
> 
> In order to do it I used FcFileScan API and it works properly.
> 
> But FcFileScan API takes too much time. (more than 1 second)

That's weird.  What kind of font / machine?  Do other fonts take as long?


> I want to reduce this time.
> 
> Would you please advice another method or APIs?

If the font is in a directory cached by fontconfig, you can use FcFontList()
with a pattern having FC_FILE set to the file name.

behdad


> BR,
> 
> Deokjin kim


More information about the Fontconfig mailing list