(root)/
fontconfig-2.14.2/
fontconfig/
fontconfig.h
       1  /*
       2   * fontconfig/fontconfig/fontconfig.h
       3   *
       4   * Copyright © 2001 Keith Packard
       5   *
       6   * Permission to use, copy, modify, distribute, and sell this software and its
       7   * documentation for any purpose is hereby granted without fee, provided that
       8   * the above copyright notice appear in all copies and that both that
       9   * copyright notice and this permission notice appear in supporting
      10   * documentation, and that the name of the author(s) not be used in
      11   * advertising or publicity pertaining to distribution of the software without
      12   * specific, written prior permission.  The authors make no
      13   * representations about the suitability of this software for any purpose.  It
      14   * is provided "as is" without express or implied warranty.
      15   *
      16   * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
      17   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
      18   * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
      19   * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
      20   * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
      21   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
      22   * PERFORMANCE OF THIS SOFTWARE.
      23   */
      24  
      25  #ifndef _FONTCONFIG_H_
      26  #define _FONTCONFIG_H_
      27  
      28  #include <sys/types.h>
      29  #include <sys/stat.h>
      30  #include <stdarg.h>
      31  #include <limits.h>
      32  
      33  #if defined(__GNUC__) && (__GNUC__ >= 4)
      34  #define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0)))
      35  #else
      36  #define FC_ATTRIBUTE_SENTINEL(x)
      37  #endif
      38  
      39  #ifndef FcPublic
      40  #define FcPublic
      41  #endif
      42  
      43  typedef unsigned char	FcChar8;
      44  typedef unsigned short	FcChar16;
      45  typedef unsigned int	FcChar32;
      46  typedef int		FcBool;
      47  
      48  /*
      49   * Current Fontconfig version number.  This same number
      50   * must appear in the fontconfig configure.in file. Yes,
      51   * it'a a pain to synchronize version numbers like this.
      52   */
      53  
      54  #define FC_MAJOR	2
      55  #define FC_MINOR	14
      56  #define FC_REVISION	2
      57  
      58  #define FC_VERSION	((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
      59  
      60  /*
      61   * Current font cache file format version
      62   * This is appended to the cache files so that multiple
      63   * versions of the library will peacefully coexist
      64   *
      65   * Change this value whenever the disk format for the cache file
      66   * changes in any non-compatible way.  Try to avoid such changes as
      67   * it means multiple copies of the font information.
      68   */
      69  
      70  #define FC_CACHE_VERSION_NUMBER	8
      71  #define _FC_STRINGIFY_(s)    	#s
      72  #define _FC_STRINGIFY(s)    	_FC_STRINGIFY_(s)
      73  #define FC_CACHE_VERSION    	_FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
      74  
      75  #define FcFalse		0
      76  #define FcTrue		1
      77  #define FcDontCare	2
      78  
      79  #define FC_FAMILY	    "family"		/* String */
      80  #define FC_STYLE	    "style"		/* String */
      81  #define FC_SLANT	    "slant"		/* Int */
      82  #define FC_WEIGHT	    "weight"		/* Int */
      83  #define FC_SIZE		    "size"		/* Range (double) */
      84  #define FC_ASPECT	    "aspect"		/* Double */
      85  #define FC_PIXEL_SIZE	    "pixelsize"		/* Double */
      86  #define FC_SPACING	    "spacing"		/* Int */
      87  #define FC_FOUNDRY	    "foundry"		/* String */
      88  #define FC_ANTIALIAS	    "antialias"		/* Bool (depends) */
      89  #define FC_HINTING	    "hinting"		/* Bool (true) */
      90  #define FC_HINT_STYLE	    "hintstyle"		/* Int */
      91  #define FC_VERTICAL_LAYOUT  "verticallayout"	/* Bool (false) */
      92  #define FC_AUTOHINT	    "autohint"		/* Bool (false) */
      93  /* FC_GLOBAL_ADVANCE is deprecated. this is simply ignored on freetype 2.4.5 or later */
      94  #define FC_GLOBAL_ADVANCE   "globaladvance"	/* Bool (true) */
      95  #define FC_WIDTH	    "width"		/* Int */
      96  #define FC_FILE		    "file"		/* String */
      97  #define FC_INDEX	    "index"		/* Int */
      98  #define FC_FT_FACE	    "ftface"		/* FT_Face */
      99  #define FC_RASTERIZER	    "rasterizer"	/* String (deprecated) */
     100  #define FC_OUTLINE	    "outline"		/* Bool */
     101  #define FC_SCALABLE	    "scalable"		/* Bool */
     102  #define FC_COLOR	    "color"		/* Bool */
     103  #define FC_VARIABLE	    "variable"		/* Bool */
     104  #define FC_SCALE	    "scale"		/* double (deprecated) */
     105  #define FC_SYMBOL	    "symbol"		/* Bool */
     106  #define FC_DPI		    "dpi"		/* double */
     107  #define FC_RGBA		    "rgba"		/* Int */
     108  #define FC_MINSPACE	    "minspace"		/* Bool use minimum line spacing */
     109  #define FC_SOURCE	    "source"		/* String (deprecated) */
     110  #define FC_CHARSET	    "charset"		/* CharSet */
     111  #define FC_LANG		    "lang"		/* LangSet Set of RFC 3066 langs */
     112  #define FC_FONTVERSION	    "fontversion"	/* Int from 'head' table */
     113  #define FC_FULLNAME	    "fullname"		/* String */
     114  #define FC_FAMILYLANG	    "familylang"	/* String RFC 3066 langs */
     115  #define FC_STYLELANG	    "stylelang"		/* String RFC 3066 langs */
     116  #define FC_FULLNAMELANG	    "fullnamelang"	/* String RFC 3066 langs */
     117  #define FC_CAPABILITY       "capability"	/* String */
     118  #define FC_FONTFORMAT	    "fontformat"	/* String */
     119  #define FC_EMBOLDEN	    "embolden"		/* Bool - true if emboldening needed*/
     120  #define FC_EMBEDDED_BITMAP  "embeddedbitmap"	/* Bool - true to enable embedded bitmaps */
     121  #define FC_DECORATIVE	    "decorative"	/* Bool - true if style is a decorative variant */
     122  #define FC_LCD_FILTER	    "lcdfilter"		/* Int */
     123  #define FC_FONT_FEATURES    "fontfeatures"	/* String */
     124  #define FC_FONT_VARIATIONS  "fontvariations"	/* String */
     125  #define FC_NAMELANG	    "namelang"		/* String RFC 3866 langs */
     126  #define FC_PRGNAME	    "prgname"		/* String */
     127  #define FC_HASH		    "hash"		/* String (deprecated) */
     128  #define FC_POSTSCRIPT_NAME  "postscriptname"	/* String */
     129  #define FC_FONT_HAS_HINT    "fonthashint"	/* Bool - true if font has hinting */
     130  #define FC_ORDER	    "order"		/* Integer */
     131  #define FC_DESKTOP_NAME     "desktop"		/* String */
     132  
     133  #define FC_CACHE_SUFFIX		    ".cache-" FC_CACHE_VERSION
     134  #define FC_DIR_CACHE_FILE	    "fonts.cache-" FC_CACHE_VERSION
     135  #define FC_USER_CACHE_FILE	    ".fonts.cache-" FC_CACHE_VERSION
     136  
     137  /* Adjust outline rasterizer */
     138  #define FC_CHARWIDTH	    "charwidth"	/* Int */
     139  #define FC_CHAR_WIDTH	    FC_CHARWIDTH
     140  #define FC_CHAR_HEIGHT	    "charheight"/* Int */
     141  #define FC_MATRIX	    "matrix"    /* FcMatrix */
     142  
     143  #define FC_WEIGHT_THIN		    0
     144  #define FC_WEIGHT_EXTRALIGHT	    40
     145  #define FC_WEIGHT_ULTRALIGHT	    FC_WEIGHT_EXTRALIGHT
     146  #define FC_WEIGHT_LIGHT		    50
     147  #define FC_WEIGHT_DEMILIGHT	    55
     148  #define FC_WEIGHT_SEMILIGHT	    FC_WEIGHT_DEMILIGHT
     149  #define FC_WEIGHT_BOOK		    75
     150  #define FC_WEIGHT_REGULAR	    80
     151  #define FC_WEIGHT_NORMAL	    FC_WEIGHT_REGULAR
     152  #define FC_WEIGHT_MEDIUM	    100
     153  #define FC_WEIGHT_DEMIBOLD	    180
     154  #define FC_WEIGHT_SEMIBOLD	    FC_WEIGHT_DEMIBOLD
     155  #define FC_WEIGHT_BOLD		    200
     156  #define FC_WEIGHT_EXTRABOLD	    205
     157  #define FC_WEIGHT_ULTRABOLD	    FC_WEIGHT_EXTRABOLD
     158  #define FC_WEIGHT_BLACK		    210
     159  #define FC_WEIGHT_HEAVY		    FC_WEIGHT_BLACK
     160  #define FC_WEIGHT_EXTRABLACK	    215
     161  #define FC_WEIGHT_ULTRABLACK	    FC_WEIGHT_EXTRABLACK
     162  
     163  #define FC_SLANT_ROMAN		    0
     164  #define FC_SLANT_ITALIC		    100
     165  #define FC_SLANT_OBLIQUE	    110
     166  
     167  #define FC_WIDTH_ULTRACONDENSED	    50
     168  #define FC_WIDTH_EXTRACONDENSED	    63
     169  #define FC_WIDTH_CONDENSED	    75
     170  #define FC_WIDTH_SEMICONDENSED	    87
     171  #define FC_WIDTH_NORMAL		    100
     172  #define FC_WIDTH_SEMIEXPANDED	    113
     173  #define FC_WIDTH_EXPANDED	    125
     174  #define FC_WIDTH_EXTRAEXPANDED	    150
     175  #define FC_WIDTH_ULTRAEXPANDED	    200
     176  
     177  #define FC_PROPORTIONAL		    0
     178  #define FC_DUAL			    90
     179  #define FC_MONO			    100
     180  #define FC_CHARCELL		    110
     181  
     182  /* sub-pixel order */
     183  #define FC_RGBA_UNKNOWN	    0
     184  #define FC_RGBA_RGB	    1
     185  #define FC_RGBA_BGR	    2
     186  #define FC_RGBA_VRGB	    3
     187  #define FC_RGBA_VBGR	    4
     188  #define FC_RGBA_NONE	    5
     189  
     190  /* hinting style */
     191  #define FC_HINT_NONE        0
     192  #define FC_HINT_SLIGHT      1
     193  #define FC_HINT_MEDIUM      2
     194  #define FC_HINT_FULL        3
     195  
     196  /* LCD filter */
     197  #define FC_LCD_NONE	    0
     198  #define FC_LCD_DEFAULT	    1
     199  #define FC_LCD_LIGHT	    2
     200  #define FC_LCD_LEGACY	    3
     201  
     202  typedef enum _FcType {
     203      FcTypeUnknown = -1,
     204      FcTypeVoid,
     205      FcTypeInteger,
     206      FcTypeDouble,
     207      FcTypeString,
     208      FcTypeBool,
     209      FcTypeMatrix,
     210      FcTypeCharSet,
     211      FcTypeFTFace,
     212      FcTypeLangSet,
     213      FcTypeRange
     214  } FcType;
     215  
     216  typedef struct _FcMatrix {
     217      double xx, xy, yx, yy;
     218  } FcMatrix;
     219  
     220  #define FcMatrixInit(m)	((m)->xx = (m)->yy = 1, \
     221  			 (m)->xy = (m)->yx = 0)
     222  
     223  /*
     224   * A data structure to represent the available glyphs in a font.
     225   * This is represented as a sparse boolean btree.
     226   */
     227  
     228  typedef struct _FcCharSet FcCharSet;
     229  
     230  typedef struct _FcObjectType {
     231      char	*object;
     232      FcType	type;
     233  } FcObjectType;
     234  
     235  typedef struct _FcConstant {
     236      const FcChar8  *name;
     237      const char	*object;
     238      int		value;
     239  } FcConstant;
     240  
     241  typedef enum _FcResult {
     242      FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
     243      FcResultOutOfMemory
     244  } FcResult;
     245  
     246  typedef enum _FcValueBinding {
     247      FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
     248      /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
     249      FcValueBindingEnd = INT_MAX
     250  } FcValueBinding;
     251  
     252  typedef struct _FcPattern   FcPattern;
     253  
     254  typedef struct _FcPatternIter {
     255      void *dummy1;
     256      void *dummy2;
     257  } FcPatternIter;
     258  
     259  typedef struct _FcLangSet   FcLangSet;
     260  
     261  typedef struct _FcRange	    FcRange;
     262  
     263  typedef struct _FcValue {
     264      FcType	type;
     265      union {
     266  	const FcChar8	*s;
     267  	int		i;
     268  	FcBool		b;
     269  	double		d;
     270  	const FcMatrix	*m;
     271  	const FcCharSet	*c;
     272  	void		*f;
     273  	const FcLangSet	*l;
     274  	const FcRange	*r;
     275      } u;
     276  } FcValue;
     277  
     278  typedef struct _FcFontSet {
     279      int		nfont;
     280      int		sfont;
     281      FcPattern	**fonts;
     282  } FcFontSet;
     283  
     284  typedef struct _FcObjectSet {
     285      int		nobject;
     286      int		sobject;
     287      const char	**objects;
     288  } FcObjectSet;
     289  
     290  typedef enum _FcMatchKind {
     291      FcMatchPattern, FcMatchFont, FcMatchScan,
     292      FcMatchKindEnd,
     293      FcMatchKindBegin = FcMatchPattern
     294  } FcMatchKind;
     295  
     296  typedef enum _FcLangResult {
     297      FcLangEqual = 0,
     298      FcLangDifferentCountry = 1,
     299      FcLangDifferentTerritory = 1,
     300      FcLangDifferentLang = 2
     301  } FcLangResult;
     302  
     303  typedef enum _FcSetName {
     304      FcSetSystem = 0,
     305      FcSetApplication = 1
     306  } FcSetName;
     307  
     308  typedef struct _FcConfigFileInfoIter {
     309      void	*dummy1;
     310      void	*dummy2;
     311      void	*dummy3;
     312  } FcConfigFileInfoIter;
     313  
     314  typedef struct _FcAtomic FcAtomic;
     315  
     316  #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
     317  #define _FCFUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
     318  #define _FCFUNCPROTOEND }
     319  #else
     320  #define _FCFUNCPROTOBEGIN
     321  #define _FCFUNCPROTOEND
     322  #endif
     323  
     324  typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
     325  
     326  typedef struct _FcConfig    FcConfig;
     327  
     328  typedef struct _FcGlobalCache	FcFileCache;
     329  
     330  typedef struct _FcBlanks    FcBlanks;
     331  
     332  typedef struct _FcStrList   FcStrList;
     333  
     334  typedef struct _FcStrSet    FcStrSet;
     335  
     336  typedef struct _FcCache	    FcCache;
     337  
     338  _FCFUNCPROTOBEGIN
     339  
     340  /* fcblanks.c */
     341  FcPublic FcBlanks *
     342  FcBlanksCreate (void);
     343  
     344  FcPublic void
     345  FcBlanksDestroy (FcBlanks *b);
     346  
     347  FcPublic FcBool
     348  FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
     349  
     350  FcPublic FcBool
     351  FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
     352  
     353  /* fccache.c */
     354  
     355  FcPublic const FcChar8 *
     356  FcCacheDir(const FcCache *c);
     357  
     358  FcPublic FcFontSet *
     359  FcCacheCopySet(const FcCache *c);
     360  
     361  FcPublic const FcChar8 *
     362  FcCacheSubdir (const FcCache *c, int i);
     363  
     364  FcPublic int
     365  FcCacheNumSubdir (const FcCache *c);
     366  
     367  FcPublic int
     368  FcCacheNumFont (const FcCache *c);
     369  
     370  FcPublic FcBool
     371  FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
     372  
     373  FcPublic FcBool
     374  FcDirCacheValid (const FcChar8 *cache_file);
     375  
     376  FcPublic FcBool
     377  FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);
     378  
     379  FcPublic void
     380  FcCacheCreateTagFile (FcConfig *config);
     381  
     382  FcPublic FcBool
     383  FcDirCacheCreateUUID (FcChar8  *dir,
     384  		      FcBool    force,
     385  		      FcConfig *config);
     386  
     387  FcPublic FcBool
     388  FcDirCacheDeleteUUID (const FcChar8  *dir,
     389  		      FcConfig       *config);
     390  
     391  /* fccfg.c */
     392  FcPublic FcChar8 *
     393  FcConfigHome (void);
     394  
     395  FcPublic FcBool
     396  FcConfigEnableHome (FcBool enable);
     397  
     398  FcPublic FcChar8 *
     399  FcConfigGetFilename (FcConfig      *config,
     400  		     const FcChar8 *url);
     401  
     402  FcPublic FcChar8 *
     403  FcConfigFilename (const FcChar8 *url);
     404  
     405  FcPublic FcConfig *
     406  FcConfigCreate (void);
     407  
     408  FcPublic FcConfig *
     409  FcConfigReference (FcConfig *config);
     410  
     411  FcPublic void
     412  FcConfigDestroy (FcConfig *config);
     413  
     414  FcPublic FcBool
     415  FcConfigSetCurrent (FcConfig *config);
     416  
     417  FcPublic FcConfig *
     418  FcConfigGetCurrent (void);
     419  
     420  FcPublic FcBool
     421  FcConfigUptoDate (FcConfig *config);
     422  
     423  FcPublic FcBool
     424  FcConfigBuildFonts (FcConfig *config);
     425  
     426  FcPublic FcStrList *
     427  FcConfigGetFontDirs (FcConfig   *config);
     428  
     429  FcPublic FcStrList *
     430  FcConfigGetConfigDirs (FcConfig   *config);
     431  
     432  FcPublic FcStrList *
     433  FcConfigGetConfigFiles (FcConfig    *config);
     434  
     435  FcPublic FcChar8 *
     436  FcConfigGetCache (FcConfig  *config);
     437  
     438  FcPublic FcBlanks *
     439  FcConfigGetBlanks (FcConfig *config);
     440  
     441  FcPublic FcStrList *
     442  FcConfigGetCacheDirs (FcConfig	*config);
     443  
     444  FcPublic int
     445  FcConfigGetRescanInterval (FcConfig *config);
     446  
     447  FcPublic FcBool
     448  FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
     449  
     450  FcPublic FcFontSet *
     451  FcConfigGetFonts (FcConfig	*config,
     452  		  FcSetName	set);
     453  
     454  FcPublic FcBool
     455  FcConfigAppFontAddFile (FcConfig    *config,
     456  			const FcChar8  *file);
     457  
     458  FcPublic FcBool
     459  FcConfigAppFontAddDir (FcConfig	    *config,
     460  		       const FcChar8   *dir);
     461  
     462  FcPublic void
     463  FcConfigAppFontClear (FcConfig	    *config);
     464  
     465  FcPublic FcBool
     466  FcConfigSubstituteWithPat (FcConfig	*config,
     467  			   FcPattern	*p,
     468  			   FcPattern	*p_pat,
     469  			   FcMatchKind	kind);
     470  
     471  FcPublic FcBool
     472  FcConfigSubstitute (FcConfig	*config,
     473  		    FcPattern	*p,
     474  		    FcMatchKind	kind);
     475  
     476  FcPublic const FcChar8 *
     477  FcConfigGetSysRoot (const FcConfig *config);
     478  
     479  FcPublic void
     480  FcConfigSetSysRoot (FcConfig      *config,
     481  		    const FcChar8 *sysroot);
     482  
     483  FcPublic void
     484  FcConfigFileInfoIterInit (FcConfig		*config,
     485  			  FcConfigFileInfoIter	*iter);
     486  
     487  FcPublic FcBool
     488  FcConfigFileInfoIterNext (FcConfig		*config,
     489  			  FcConfigFileInfoIter	*iter);
     490  
     491  FcPublic FcBool
     492  FcConfigFileInfoIterGet (FcConfig		*config,
     493  			 FcConfigFileInfoIter	*iter,
     494  			 FcChar8		**name,
     495  			 FcChar8		**description,
     496  			 FcBool			*enabled);
     497  
     498  /* fccharset.c */
     499  FcPublic FcCharSet*
     500  FcCharSetCreate (void);
     501  
     502  /* deprecated alias for FcCharSetCreate */
     503  FcPublic FcCharSet *
     504  FcCharSetNew (void);
     505  
     506  FcPublic void
     507  FcCharSetDestroy (FcCharSet *fcs);
     508  
     509  FcPublic FcBool
     510  FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
     511  
     512  FcPublic FcBool
     513  FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);
     514  
     515  FcPublic FcCharSet*
     516  FcCharSetCopy (FcCharSet *src);
     517  
     518  FcPublic FcBool
     519  FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
     520  
     521  FcPublic FcCharSet*
     522  FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
     523  
     524  FcPublic FcCharSet*
     525  FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
     526  
     527  FcPublic FcCharSet*
     528  FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
     529  
     530  FcPublic FcBool
     531  FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
     532  
     533  FcPublic FcBool
     534  FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
     535  
     536  FcPublic FcChar32
     537  FcCharSetCount (const FcCharSet *a);
     538  
     539  FcPublic FcChar32
     540  FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
     541  
     542  FcPublic FcChar32
     543  FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
     544  
     545  FcPublic FcBool
     546  FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
     547  
     548  #define FC_CHARSET_MAP_SIZE (256/32)
     549  #define FC_CHARSET_DONE	((FcChar32) -1)
     550  
     551  FcPublic FcChar32
     552  FcCharSetFirstPage (const FcCharSet *a,
     553  		    FcChar32	    map[FC_CHARSET_MAP_SIZE],
     554  		    FcChar32	    *next);
     555  
     556  FcPublic FcChar32
     557  FcCharSetNextPage (const FcCharSet  *a,
     558  		   FcChar32	    map[FC_CHARSET_MAP_SIZE],
     559  		   FcChar32	    *next);
     560  
     561  /*
     562   * old coverage API, rather hard to use correctly
     563   */
     564  
     565  FcPublic FcChar32
     566  FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
     567  
     568  /* fcdbg.c */
     569  FcPublic void
     570  FcValuePrint (const FcValue v);
     571  
     572  FcPublic void
     573  FcPatternPrint (const FcPattern *p);
     574  
     575  FcPublic void
     576  FcFontSetPrint (const FcFontSet *s);
     577  
     578  /* fcdefault.c */
     579  FcPublic FcStrSet *
     580  FcGetDefaultLangs (void);
     581  
     582  FcPublic void
     583  FcDefaultSubstitute (FcPattern *pattern);
     584  
     585  /* fcdir.c */
     586  FcPublic FcBool
     587  FcFileIsDir (const FcChar8 *file);
     588  
     589  FcPublic FcBool
     590  FcFileScan (FcFontSet	    *set,
     591  	    FcStrSet	    *dirs,
     592  	    FcFileCache	    *cache,
     593  	    FcBlanks	    *blanks,
     594  	    const FcChar8   *file,
     595  	    FcBool	    force);
     596  
     597  FcPublic FcBool
     598  FcDirScan (FcFontSet	    *set,
     599  	   FcStrSet	    *dirs,
     600  	   FcFileCache	    *cache,
     601  	   FcBlanks	    *blanks,
     602  	   const FcChar8    *dir,
     603  	   FcBool	    force);
     604  
     605  FcPublic FcBool
     606  FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
     607  
     608  FcPublic FcCache *
     609  FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
     610  
     611  FcPublic FcCache *
     612  FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
     613  
     614  FcPublic FcCache *
     615  FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
     616  
     617  FcPublic FcCache *
     618  FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
     619  
     620  FcPublic void
     621  FcDirCacheUnload (FcCache *cache);
     622  
     623  /* fcfreetype.c */
     624  FcPublic FcPattern *
     625  FcFreeTypeQuery (const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count);
     626  
     627  FcPublic unsigned int
     628  FcFreeTypeQueryAll(const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count, FcFontSet *set);
     629  
     630  /* fcfs.c */
     631  
     632  FcPublic FcFontSet *
     633  FcFontSetCreate (void);
     634  
     635  FcPublic void
     636  FcFontSetDestroy (FcFontSet *s);
     637  
     638  FcPublic FcBool
     639  FcFontSetAdd (FcFontSet *s, FcPattern *font);
     640  
     641  /* fcinit.c */
     642  FcPublic FcConfig *
     643  FcInitLoadConfig (void);
     644  
     645  FcPublic FcConfig *
     646  FcInitLoadConfigAndFonts (void);
     647  
     648  FcPublic FcBool
     649  FcInit (void);
     650  
     651  FcPublic void
     652  FcFini (void);
     653  
     654  FcPublic int
     655  FcGetVersion (void);
     656  
     657  FcPublic FcBool
     658  FcInitReinitialize (void);
     659  
     660  FcPublic FcBool
     661  FcInitBringUptoDate (void);
     662  
     663  /* fclang.c */
     664  FcPublic FcStrSet *
     665  FcGetLangs (void);
     666  
     667  FcPublic FcChar8 *
     668  FcLangNormalize (const FcChar8 *lang);
     669  
     670  FcPublic const FcCharSet *
     671  FcLangGetCharSet (const FcChar8 *lang);
     672  
     673  FcPublic FcLangSet*
     674  FcLangSetCreate (void);
     675  
     676  FcPublic void
     677  FcLangSetDestroy (FcLangSet *ls);
     678  
     679  FcPublic FcLangSet*
     680  FcLangSetCopy (const FcLangSet *ls);
     681  
     682  FcPublic FcBool
     683  FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
     684  
     685  FcPublic FcBool
     686  FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);
     687  
     688  FcPublic FcLangResult
     689  FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
     690  
     691  FcPublic FcLangResult
     692  FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
     693  
     694  FcPublic FcBool
     695  FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
     696  
     697  FcPublic FcBool
     698  FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
     699  
     700  FcPublic FcChar32
     701  FcLangSetHash (const FcLangSet *ls);
     702  
     703  FcPublic FcStrSet *
     704  FcLangSetGetLangs (const FcLangSet *ls);
     705  
     706  FcPublic FcLangSet *
     707  FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);
     708  
     709  FcPublic FcLangSet *
     710  FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);
     711  
     712  /* fclist.c */
     713  FcPublic FcObjectSet *
     714  FcObjectSetCreate (void);
     715  
     716  FcPublic FcBool
     717  FcObjectSetAdd (FcObjectSet *os, const char *object);
     718  
     719  FcPublic void
     720  FcObjectSetDestroy (FcObjectSet *os);
     721  
     722  FcPublic FcObjectSet *
     723  FcObjectSetVaBuild (const char *first, va_list va);
     724  
     725  FcPublic FcObjectSet *
     726  FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
     727  
     728  FcPublic FcFontSet *
     729  FcFontSetList (FcConfig	    *config,
     730  	       FcFontSet    **sets,
     731  	       int	    nsets,
     732  	       FcPattern    *p,
     733  	       FcObjectSet  *os);
     734  
     735  FcPublic FcFontSet *
     736  FcFontList (FcConfig	*config,
     737  	    FcPattern	*p,
     738  	    FcObjectSet *os);
     739  
     740  /* fcatomic.c */
     741  
     742  FcPublic FcAtomic *
     743  FcAtomicCreate (const FcChar8   *file);
     744  
     745  FcPublic FcBool
     746  FcAtomicLock (FcAtomic *atomic);
     747  
     748  FcPublic FcChar8 *
     749  FcAtomicNewFile (FcAtomic *atomic);
     750  
     751  FcPublic FcChar8 *
     752  FcAtomicOrigFile (FcAtomic *atomic);
     753  
     754  FcPublic FcBool
     755  FcAtomicReplaceOrig (FcAtomic *atomic);
     756  
     757  FcPublic void
     758  FcAtomicDeleteNew (FcAtomic *atomic);
     759  
     760  FcPublic void
     761  FcAtomicUnlock (FcAtomic *atomic);
     762  
     763  FcPublic void
     764  FcAtomicDestroy (FcAtomic *atomic);
     765  
     766  /* fcmatch.c */
     767  FcPublic FcPattern *
     768  FcFontSetMatch (FcConfig    *config,
     769  		FcFontSet   **sets,
     770  		int	    nsets,
     771  		FcPattern   *p,
     772  		FcResult    *result);
     773  
     774  FcPublic FcPattern *
     775  FcFontMatch (FcConfig	*config,
     776  	     FcPattern	*p,
     777  	     FcResult	*result);
     778  
     779  FcPublic FcPattern *
     780  FcFontRenderPrepare (FcConfig	    *config,
     781  		     FcPattern	    *pat,
     782  		     FcPattern	    *font);
     783  
     784  FcPublic FcFontSet *
     785  FcFontSetSort (FcConfig	    *config,
     786  	       FcFontSet    **sets,
     787  	       int	    nsets,
     788  	       FcPattern    *p,
     789  	       FcBool	    trim,
     790  	       FcCharSet    **csp,
     791  	       FcResult	    *result);
     792  
     793  FcPublic FcFontSet *
     794  FcFontSort (FcConfig	 *config,
     795  	    FcPattern    *p,
     796  	    FcBool	 trim,
     797  	    FcCharSet    **csp,
     798  	    FcResult	 *result);
     799  
     800  FcPublic void
     801  FcFontSetSortDestroy (FcFontSet *fs);
     802  
     803  /* fcmatrix.c */
     804  FcPublic FcMatrix *
     805  FcMatrixCopy (const FcMatrix *mat);
     806  
     807  FcPublic FcBool
     808  FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
     809  
     810  FcPublic void
     811  FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
     812  
     813  FcPublic void
     814  FcMatrixRotate (FcMatrix *m, double c, double s);
     815  
     816  FcPublic void
     817  FcMatrixScale (FcMatrix *m, double sx, double sy);
     818  
     819  FcPublic void
     820  FcMatrixShear (FcMatrix *m, double sh, double sv);
     821  
     822  /* fcname.c */
     823  
     824  /* Deprecated.  Does nothing.  Returns FcFalse. */
     825  FcPublic FcBool
     826  FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
     827  
     828  /* Deprecated.  Does nothing.  Returns FcFalse. */
     829  FcPublic FcBool
     830  FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
     831  
     832  FcPublic const FcObjectType *
     833  FcNameGetObjectType (const char *object);
     834  
     835  /* Deprecated.  Does nothing.  Returns FcFalse. */
     836  FcPublic FcBool
     837  FcNameRegisterConstants (const FcConstant *consts, int nconsts);
     838  
     839  /* Deprecated.  Does nothing.  Returns FcFalse. */
     840  FcPublic FcBool
     841  FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
     842  
     843  FcPublic const FcConstant *
     844  FcNameGetConstant (const FcChar8 *string);
     845  
     846  FcPublic const FcConstant *
     847  FcNameGetConstantFor (const FcChar8 *string, const char *object);
     848  
     849  FcPublic FcBool
     850  FcNameConstant (const FcChar8 *string, int *result);
     851  
     852  FcPublic FcPattern *
     853  FcNameParse (const FcChar8 *name);
     854  
     855  FcPublic FcChar8 *
     856  FcNameUnparse (FcPattern *pat);
     857  
     858  /* fcpat.c */
     859  FcPublic FcPattern *
     860  FcPatternCreate (void);
     861  
     862  FcPublic FcPattern *
     863  FcPatternDuplicate (const FcPattern *p);
     864  
     865  FcPublic void
     866  FcPatternReference (FcPattern *p);
     867  
     868  FcPublic FcPattern *
     869  FcPatternFilter (FcPattern *p, const FcObjectSet *os);
     870  
     871  FcPublic void
     872  FcValueDestroy (FcValue v);
     873  
     874  FcPublic FcBool
     875  FcValueEqual (FcValue va, FcValue vb);
     876  
     877  FcPublic FcValue
     878  FcValueSave (FcValue v);
     879  
     880  FcPublic void
     881  FcPatternDestroy (FcPattern *p);
     882  
     883  int
     884  FcPatternObjectCount (const FcPattern *pat);
     885  
     886  FcPublic FcBool
     887  FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
     888  
     889  FcPublic FcBool
     890  FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
     891  
     892  FcPublic FcChar32
     893  FcPatternHash (const FcPattern *p);
     894  
     895  FcPublic FcBool
     896  FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
     897  
     898  FcPublic FcBool
     899  FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
     900  
     901  FcPublic FcResult
     902  FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
     903  
     904  FcPublic FcResult
     905  FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b);
     906  
     907  FcPublic FcBool
     908  FcPatternDel (FcPattern *p, const char *object);
     909  
     910  FcPublic FcBool
     911  FcPatternRemove (FcPattern *p, const char *object, int id);
     912  
     913  FcPublic FcBool
     914  FcPatternAddInteger (FcPattern *p, const char *object, int i);
     915  
     916  FcPublic FcBool
     917  FcPatternAddDouble (FcPattern *p, const char *object, double d);
     918  
     919  FcPublic FcBool
     920  FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
     921  
     922  FcPublic FcBool
     923  FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
     924  
     925  FcPublic FcBool
     926  FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
     927  
     928  FcPublic FcBool
     929  FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
     930  
     931  FcPublic FcBool
     932  FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
     933  
     934  FcPublic FcBool
     935  FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);
     936  
     937  FcPublic FcResult
     938  FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
     939  
     940  FcPublic FcResult
     941  FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
     942  
     943  FcPublic FcResult
     944  FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
     945  
     946  FcPublic FcResult
     947  FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
     948  
     949  FcPublic FcResult
     950  FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
     951  
     952  FcPublic FcResult
     953  FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
     954  
     955  FcPublic FcResult
     956  FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
     957  
     958  FcPublic FcResult
     959  FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);
     960  
     961  FcPublic FcPattern *
     962  FcPatternVaBuild (FcPattern *p, va_list va);
     963  
     964  FcPublic FcPattern *
     965  FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
     966  
     967  FcPublic FcChar8 *
     968  FcPatternFormat (FcPattern *pat, const FcChar8 *format);
     969  
     970  /* fcrange.c */
     971  FcPublic FcRange *
     972  FcRangeCreateDouble (double begin, double end);
     973  
     974  FcPublic FcRange *
     975  FcRangeCreateInteger (FcChar32 begin, FcChar32 end);
     976  
     977  FcPublic void
     978  FcRangeDestroy (FcRange *range);
     979  
     980  FcPublic FcRange *
     981  FcRangeCopy (const FcRange *r);
     982  
     983  FcPublic FcBool
     984  FcRangeGetDouble(const FcRange *range, double *begin, double *end);
     985  
     986  FcPublic void
     987  FcPatternIterStart (const FcPattern *pat, FcPatternIter *iter);
     988  
     989  FcPublic FcBool
     990  FcPatternIterNext (const FcPattern *pat, FcPatternIter *iter);
     991  
     992  FcPublic FcBool
     993  FcPatternIterEqual (const FcPattern *p1, FcPatternIter *i1,
     994  		    const FcPattern *p2, FcPatternIter *i2);
     995  
     996  FcPublic FcBool
     997  FcPatternFindIter (const FcPattern *pat, FcPatternIter *iter, const char *object);
     998  
     999  FcPublic FcBool
    1000  FcPatternIterIsValid (const FcPattern *pat, FcPatternIter *iter);
    1001  
    1002  FcPublic const char *
    1003  FcPatternIterGetObject (const FcPattern *pat, FcPatternIter *iter);
    1004  
    1005  FcPublic int
    1006  FcPatternIterValueCount (const FcPattern *pat, FcPatternIter *iter);
    1007  
    1008  FcPublic FcResult
    1009  FcPatternIterGetValue (const FcPattern *pat, FcPatternIter *iter, int id, FcValue *v, FcValueBinding *b);
    1010  
    1011  /* fcweight.c */
    1012  
    1013  FcPublic int
    1014  FcWeightFromOpenType (int ot_weight);
    1015  
    1016  FcPublic double
    1017  FcWeightFromOpenTypeDouble (double ot_weight);
    1018  
    1019  FcPublic int
    1020  FcWeightToOpenType (int fc_weight);
    1021  
    1022  FcPublic double
    1023  FcWeightToOpenTypeDouble (double fc_weight);
    1024  
    1025  /* fcstr.c */
    1026  
    1027  FcPublic FcChar8 *
    1028  FcStrCopy (const FcChar8 *s);
    1029  
    1030  FcPublic FcChar8 *
    1031  FcStrCopyFilename (const FcChar8 *s);
    1032  
    1033  FcPublic FcChar8 *
    1034  FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
    1035  
    1036  FcPublic void
    1037  FcStrFree (FcChar8 *s);
    1038  
    1039  /* These are ASCII only, suitable only for pattern element names */
    1040  #define FcIsUpper(c)	((0101 <= (c) && (c) <= 0132))
    1041  #define FcIsLower(c)	((0141 <= (c) && (c) <= 0172))
    1042  #define FcToLower(c)	(FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
    1043  
    1044  FcPublic FcChar8 *
    1045  FcStrDowncase (const FcChar8 *s);
    1046  
    1047  FcPublic int
    1048  FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
    1049  
    1050  FcPublic int
    1051  FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
    1052  
    1053  FcPublic const FcChar8 *
    1054  FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
    1055  
    1056  FcPublic const FcChar8 *
    1057  FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
    1058  
    1059  FcPublic int
    1060  FcUtf8ToUcs4 (const FcChar8 *src_orig,
    1061  	      FcChar32	    *dst,
    1062  	      int	    len);
    1063  
    1064  FcPublic FcBool
    1065  FcUtf8Len (const FcChar8    *string,
    1066  	   int		    len,
    1067  	   int		    *nchar,
    1068  	   int		    *wchar);
    1069  
    1070  #define FC_UTF8_MAX_LEN	6
    1071  
    1072  FcPublic int
    1073  FcUcs4ToUtf8 (FcChar32	ucs4,
    1074  	      FcChar8	dest[FC_UTF8_MAX_LEN]);
    1075  
    1076  FcPublic int
    1077  FcUtf16ToUcs4 (const FcChar8	*src_orig,
    1078  	       FcEndian		endian,
    1079  	       FcChar32		*dst,
    1080  	       int		len);	    /* in bytes */
    1081  
    1082  FcPublic FcBool
    1083  FcUtf16Len (const FcChar8   *string,
    1084  	    FcEndian	    endian,
    1085  	    int		    len,	    /* in bytes */
    1086  	    int		    *nchar,
    1087  	    int		    *wchar);
    1088  
    1089  FcPublic FcChar8 *
    1090  FcStrBuildFilename (const FcChar8 *path,
    1091  		    ...);
    1092  
    1093  FcPublic FcChar8 *
    1094  FcStrDirname (const FcChar8 *file);
    1095  
    1096  FcPublic FcChar8 *
    1097  FcStrBasename (const FcChar8 *file);
    1098  
    1099  FcPublic FcStrSet *
    1100  FcStrSetCreate (void);
    1101  
    1102  FcPublic FcBool
    1103  FcStrSetMember (FcStrSet *set, const FcChar8 *s);
    1104  
    1105  FcPublic FcBool
    1106  FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
    1107  
    1108  FcPublic FcBool
    1109  FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
    1110  
    1111  FcPublic FcBool
    1112  FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
    1113  
    1114  FcPublic FcBool
    1115  FcStrSetDel (FcStrSet *set, const FcChar8 *s);
    1116  
    1117  FcPublic void
    1118  FcStrSetDestroy (FcStrSet *set);
    1119  
    1120  FcPublic FcStrList *
    1121  FcStrListCreate (FcStrSet *set);
    1122  
    1123  FcPublic void
    1124  FcStrListFirst (FcStrList *list);
    1125  
    1126  FcPublic FcChar8 *
    1127  FcStrListNext (FcStrList *list);
    1128  
    1129  FcPublic void
    1130  FcStrListDone (FcStrList *list);
    1131  
    1132  /* fcxml.c */
    1133  FcPublic FcBool
    1134  FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
    1135  
    1136  FcPublic FcBool
    1137  FcConfigParseAndLoadFromMemory (FcConfig       *config,
    1138  				const FcChar8  *buffer,
    1139  				FcBool         complain);
    1140  
    1141  _FCFUNCPROTOEND
    1142  
    1143  #undef FC_ATTRIBUTE_SENTINEL
    1144  
    1145  
    1146  #ifndef _FCINT_H_
    1147  
    1148  /*
    1149   * Deprecated functions are placed here to help users fix their code without
    1150   * digging through documentation
    1151   */
    1152  
    1153  #define FcConfigGetRescanInverval   FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
    1154  #define FcConfigSetRescanInverval   FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
    1155  
    1156  #endif
    1157  
    1158  #endif /* _FONTCONFIG_H_ */