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