An FcConfig object holds the internal representation of a configuration. There is a default configuration which applications may use by passing 0 to any function using the data within an FcConfig.
FcConfig *FcConfigCreate (void)
Creates an empty configuration.
void FcConfigDestroy (FcConfig *config)
Destroys a configuration and any data associated with it. Note that calling this function with the return from FcConfigGetCurrent will place the library in an indeterminate state.
FcBool FcConfigSetCurrent (FcConfig *config)
Sets the current default configuration to 'config'. Implicitly calls FcConfigBuildFonts if necessary, returning FcFalse if that call fails.
FcConfig *FcConfigGetCurrent (void)
Returns the current default configuration.
FcBool FcConfigUptoDate (FcConfig *config)
Checks all of the files related to 'config' and returns whether the in-memory version is in sync with the disk version.
FcBool FcConfigBuildFonts (FcConfig *config)
Builds the set of available fonts for the given configuration. Note that any changes to the configuration after this call have indeterminate effects. Returns FcFalse if this operation runs out of memory.
FcStrList *FcConfigGetConfigDirs (FcConfig *config)
Returns the list of font directories specified in the configuration files for 'config'. Does not include any subdirectories.
FcStrList *FcConfigGetFontDirs (FcConfig *config)
Returns the list of font directories in 'config'. This includes the configured font directories along with any directories below those in the filesystem.
FcStrList *FcConfigGetConfigFiles (FcConfig *config)
Returns the list of known configuration files used to generate 'config'. Note that this will not include any configuration done with FcConfigParse.
char *FcConfigGetCache (FcConfig *config)
Returns the name of the file used to store per-user font information.
FcFontSet *FcConfigGetFonts (FcConfig *config, FcSetName set)
Returns one of the two sets of fonts from the configuration as specified by 'set'.
FcBlanks *FcConfigGetBlanks (FcConfig *config)
Returns the FcBlanks object associated with the given configuration, if no blanks were present in the configuration, this function will return 0.
int FcConfigGetRescanInverval (FcConfig *config)
Returns the interval between automatic checks of the configuration (in seconds) specified in 'config'. The configuration is checked during a call to FcFontList when this interval has passed since the last check.
FcBool FcConfigSetRescanInverval (FcConfig *config, int rescanInterval)
Sets the rescan interval; returns FcFalse if an error occurred.
FcBool FcConfigAppFontAddFile (FcConfig *config, const char *file)
Adds an application-specific font to the configuration.
FcBool FcConfigAppFontAddDir (FcConfig *config, const char *dir)
Scans the specified directory for fonts, adding each one found to the application-specific set of fonts.
void FcConfigAppFontClear (FcConfig *config)
Clears the set of application-specific fonts.
FcBool FcConfigSubstituteWithPat (FcConfig *config, FcPattern *p, FcPattern *p_pat FcMatchKind kind)
Performs the sequence of pattern modification operations, if 'kind' is FcMatchPattern, then those tagged as pattern operations are applied, else if 'kind' is FcMatchFont, those tagged as font operations are applied and p_pat is used for <test> elements with target=pattern.
FcBool FcConfigSubstitute (FcConfig *config, FcPattern *p, FcMatchKind kind)
Calls FcConfigSubstituteWithPat setting p_pat to NULL.
FcPattern *FcFontMatch (FcConfig *config, FcPattern *p, FcResult *result)
Returns the font in 'config' most close matching 'p'. This function should be called only after FcConfigSubstitute and FcDefaultSubstitute have been called for 'p'; otherwise the results will not be correct.
FcFontSet *FcFontSort (FcConfig *config, FcPattern *p, FcBool trim, FcCharSet **csp, FcResult *result) Returns the list of fonts sorted by
closeness to 'p'. If 'trim' is FcTrue, elements in the list which don't include Unicode coverage not provided by earlier elements in the list are elided. The union of Unicode coverage of all of the fonts is returned in 'csp', if 'csp' is not NULL. This function should be called only after FcConfigSubstitute and FcDefaultSubstitute have been called for 'p'; otherwise the results will not be correct.
The returned FcFontSet references FcPattern structures which may be shared by the return value from multiple FcFontSort calls, applications must not modify these patterns. Instead, they should be passed, along with 'p' to FcFontRenderPrepare which combines them into a complete pattern.
The FcFontSet returned by FcFontSort is destroyed by caling FcFontSetDestroy.
FcPattern *FcFontRenderPrepare (FcConfig *config, FcPattern *pat, FcPattern *font)
Creates a new pattern consisting of elements of 'font' not appearing in 'pat', elements of 'pat' not appearing in 'font' and the best matching value from 'pat' for elements appearing in both. The result is passed to FcConfigSubstitute with 'kind' FcMatchFont and then returned.
FcFontSet *FcFontList (FcConfig *config, FcPattern *p, FcObjectSet *os)
Selects fonts matching 'p', creates patterns from those fonts containing only the objects in 'os' and returns the set of unique such patterns.
char *FcConfigFilename (const char *name)
Given the specified external entity name, return the associated filename. This provides applications a way to convert various configuration file references into filename form.
A null or empty 'name' indicates that the default configuration file should be used; which file this references can be overridden with the FC_CONFIG_FILE environment variable. Next, if the name starts with '~', it refers to a file in the current users home directory. Otherwise if the name doesn't start with '/', it refers to a file in the default configuration directory; the built-in default directory can be overridden with the FC_CONFIG_DIR environment variable.