[Fontconfig] Querying a font

Keith Packard keithp at keithp.com
Mon Sep 22 02:34:05 EST 2003


Around 12 o'clock on Sep 21, David Shochat wrote:

> Things I want to know:
>
> 1. Is it a Unicode font?
> 2. What code points does it support?

Fontconfig has Unicode coverage information for each font; if the Unicode 
coverage is non-empty, then the font has some kind of mapping which can be 
used to map Unicode values to glyphs.  Note that fontconfig supports a
couple of non-Unicode mappings (Apple Roman and Symbol) so that older 
fonts without Unicode mapping tables can still be used by applications 
that use only Unicode values.

	FcCharSet	*cs;

	if (FcPatternGetCharSet (pattern, FC_CHARSET, &cs) != FcResultMatch)
		cs = 0;
	if (!cs)
		return;

This code fragment will extract the unicode coverage information for the 
specified font pattern; you can then use the various FcCharSet functions 
to examine that value.

-keith






More information about the Fontconfig mailing list