* fontconfig/fontconfig/fontconfig.h
* Copyright © 2001 Keith Packard
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the author(s) not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. The authors make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
#if defined(__GNUC__) && (__GNUC__ >= 4)
#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0)))
#define FC_ATTRIBUTE_SENTINEL(x)
typedef unsigned char FcChar8;
typedef unsigned short FcChar16;
typedef unsigned int FcChar32;
* Current Fontconfig version number. This same number
* must appear in the fontconfig configure.in file. Yes,
* it'a a pain to synchronize version numbers like this.
#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
* Current font cache file format version
* This is appended to the cache files so that multiple
* versions of the library will peacefully coexist
* Change this value whenever the disk format for the cache file
* changes in any non-compatible way. Try to avoid such changes as
* it means multiple copies of the font information.
#define FC_CACHE_VERSION_NUMBER 7
#define _FC_STRINGIFY_(s) #s
#define _FC_STRINGIFY(s) _FC_STRINGIFY_(s)
#define FC_CACHE_VERSION _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
#define FC_FAMILY "family" /* String */
#define FC_STYLE "style" /* String */
#define FC_SLANT "slant" /* Int */
#define FC_WEIGHT "weight" /* Int */
#define FC_SIZE "size" /* Range (double) */
#define FC_ASPECT "aspect" /* Double */
#define FC_PIXEL_SIZE "pixelsize" /* Double */
#define FC_SPACING "spacing" /* Int */
#define FC_FOUNDRY "foundry" /* String */
#define FC_ANTIALIAS "antialias" /* Bool (depends) */
#define FC_HINTING "hinting" /* Bool (true) */
#define FC_HINT_STYLE "hintstyle" /* Int */
#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
#define FC_AUTOHINT "autohint" /* Bool (false) */
/* FC_GLOBAL_ADVANCE is deprecated. this is simply ignored on freetype 2.4.5 or later */
#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
#define FC_WIDTH "width" /* Int */
#define FC_FILE "file" /* String */
#define FC_INDEX "index" /* Int */
#define FC_FT_FACE "ftface" /* FT_Face */
#define FC_RASTERIZER "rasterizer" /* String (deprecated) */
#define FC_OUTLINE "outline" /* Bool */
#define FC_SCALABLE "scalable" /* Bool */
#define FC_COLOR "color" /* Bool */
#define FC_VARIABLE "variable" /* Bool */
#define FC_SCALE "scale" /* double (deprecated) */
#define FC_SYMBOL "symbol" /* Bool */
#define FC_DPI "dpi" /* double */
#define FC_RGBA "rgba" /* Int */
#define FC_MINSPACE "minspace" /* Bool use minimum line spacing */
#define FC_SOURCE "source" /* String (deprecated) */
#define FC_CHARSET "charset" /* CharSet */
#define FC_LANG "lang" /* String RFC 3066 langs */
#define FC_FONTVERSION "fontversion" /* Int from 'head' table */
#define FC_FULLNAME "fullname" /* String */
#define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */
#define FC_STYLELANG "stylelang" /* String RFC 3066 langs */
#define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */
#define FC_CAPABILITY "capability" /* String */
#define FC_FONTFORMAT "fontformat" /* String */
#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/
#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */
#define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */
#define FC_LCD_FILTER "lcdfilter" /* Int */
#define FC_FONT_FEATURES "fontfeatures" /* String */
#define FC_FONT_VARIATIONS "fontvariations" /* String */
#define FC_NAMELANG "namelang" /* String RFC 3866 langs */
#define FC_PRGNAME "prgname" /* String */
#define FC_HASH "hash" /* String (deprecated) */
#define FC_POSTSCRIPT_NAME "postscriptname" /* String */
#define FC_CACHE_SUFFIX ".cache-" FC_CACHE_VERSION
#define FC_DIR_CACHE_FILE "fonts.cache-" FC_CACHE_VERSION
#define FC_USER_CACHE_FILE ".fonts.cache-" FC_CACHE_VERSION
/* Adjust outline rasterizer */
#define FC_CHARWIDTH "charwidth" /* Int */
#define FC_CHAR_WIDTH FC_CHARWIDTH
#define FC_CHAR_HEIGHT "charheight"/* Int */
#define FC_MATRIX "matrix" /* FcMatrix */
#define FC_WEIGHT_EXTRALIGHT 40
#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
#define FC_WEIGHT_LIGHT 50
#define FC_WEIGHT_DEMILIGHT 55
#define FC_WEIGHT_SEMILIGHT FC_WEIGHT_DEMILIGHT
#define FC_WEIGHT_BOOK 75
#define FC_WEIGHT_REGULAR 80
#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
#define FC_WEIGHT_MEDIUM 100
#define FC_WEIGHT_DEMIBOLD 180
#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
#define FC_WEIGHT_BOLD 200
#define FC_WEIGHT_EXTRABOLD 205
#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
#define FC_WEIGHT_BLACK 210
#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
#define FC_WEIGHT_EXTRABLACK 215
#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
#define FC_SLANT_ITALIC 100
#define FC_SLANT_OBLIQUE 110
#define FC_WIDTH_ULTRACONDENSED 50
#define FC_WIDTH_EXTRACONDENSED 63
#define FC_WIDTH_CONDENSED 75
#define FC_WIDTH_SEMICONDENSED 87
#define FC_WIDTH_NORMAL 100
#define FC_WIDTH_SEMIEXPANDED 113
#define FC_WIDTH_EXPANDED 125
#define FC_WIDTH_EXTRAEXPANDED 150
#define FC_WIDTH_ULTRAEXPANDED 200
#define FC_PROPORTIONAL 0
#define FC_RGBA_UNKNOWN 0
typedef struct _FcMatrix {
#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
* A data structure to represent the available glyphs in a font.
* This is represented as a sparse boolean btree.
typedef struct _FcCharSet FcCharSet;
typedef struct _FcObjectType {
typedef struct _FcConstant {
FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
typedef enum _FcValueBinding {
FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
/* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
FcValueBindingEnd = INT_MAX
typedef struct _FcPattern FcPattern;
typedef struct _FcPatternIter {
typedef struct _FcLangSet FcLangSet;
typedef struct _FcRange FcRange;
typedef struct _FcValue {
typedef struct _FcFontSet {
typedef struct _FcObjectSet {
typedef enum _FcMatchKind {
FcMatchPattern, FcMatchFont, FcMatchScan,
FcMatchKindBegin = FcMatchPattern
typedef enum _FcLangResult {
FcLangDifferentCountry = 1,
FcLangDifferentTerritory = 1,
typedef enum _FcSetName {
typedef struct _FcConfigFileInfoIter {
typedef struct _FcAtomic FcAtomic;
#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
#define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
#define _FCFUNCPROTOEND }
#define _FCFUNCPROTOBEGIN
typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
typedef struct _FcConfig FcConfig;
typedef struct _FcGlobalCache FcFileCache;
typedef struct _FcBlanks FcBlanks;
typedef struct _FcStrList FcStrList;
typedef struct _FcStrSet FcStrSet;
typedef struct _FcCache FcCache;
FcBlanksDestroy (FcBlanks *b);
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
FcCacheDir(const FcCache *c);
FcCacheCopySet(const FcCache *c);
FcCacheSubdir (const FcCache *c, int i);
FcCacheNumSubdir (const FcCache *c);
FcCacheNumFont (const FcCache *c);
FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
FcDirCacheValid (const FcChar8 *cache_file);
FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);
FcCacheCreateTagFile (const FcConfig *config);
FcDirCacheCreateUUID (FcChar8 *dir,
FcDirCacheDeleteUUID (const FcChar8 *dir,
FcConfigEnableHome (FcBool enable);
FcConfigFilename (const FcChar8 *url);
FcConfigReference (FcConfig *config);
FcConfigDestroy (FcConfig *config);
FcConfigSetCurrent (FcConfig *config);
FcConfigGetCurrent (void);
FcConfigUptoDate (FcConfig *config);
FcConfigBuildFonts (FcConfig *config);
FcConfigGetFontDirs (FcConfig *config);
FcConfigGetConfigDirs (FcConfig *config);
FcConfigGetConfigFiles (FcConfig *config);
FcConfigGetCache (FcConfig *config);
FcConfigGetBlanks (FcConfig *config);
FcConfigGetCacheDirs (const FcConfig *config);
FcConfigGetRescanInterval (FcConfig *config);
FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
FcConfigGetFonts (FcConfig *config,
FcConfigAppFontAddFile (FcConfig *config,
FcConfigAppFontAddDir (FcConfig *config,
FcConfigAppFontClear (FcConfig *config);
FcConfigSubstituteWithPat (FcConfig *config,
FcConfigSubstitute (FcConfig *config,
FcConfigGetSysRoot (const FcConfig *config);
FcConfigSetSysRoot (FcConfig *config,
FcConfigFileInfoIterInit (FcConfig *config,
FcConfigFileInfoIter *iter);
FcConfigFileInfoIterNext (FcConfig *config,
FcConfigFileInfoIter *iter);
FcConfigFileInfoIterGet (FcConfig *config,
FcConfigFileInfoIter *iter,
/* deprecated alias for FcCharSetCreate */
FcCharSetDestroy (FcCharSet *fcs);