fontconfig.h 25.8 KB
Newer Older
Keith Packard's avatar
Keith Packard committed
1
/*
2
 * fontconfig/fontconfig/fontconfig.h
Keith Packard's avatar
Keith Packard committed
3
 *
4
 * Copyright © 2001 Keith Packard
Keith Packard's avatar
Keith Packard committed
5
6
7
8
9
 *
 * 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
10
 * documentation, and that the name of the author(s) not be used in
Keith Packard's avatar
Keith Packard committed
11
 * advertising or publicity pertaining to distribution of the software without
12
 * specific, written prior permission.  The authors make no
Keith Packard's avatar
Keith Packard committed
13
14
15
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.
 *
16
 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
Keith Packard's avatar
Keith Packard committed
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Keith Packard's avatar
Keith Packard committed
19
20
21
22
23
24
25
26
27
 * 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.
 */

#ifndef _FONTCONFIG_H_
#define _FONTCONFIG_H_

28
29
#include <sys/types.h>
#include <sys/stat.h>
Keith Packard's avatar
Keith Packard committed
30
#include <stdarg.h>
31
#include <limits.h>
Keith Packard's avatar
Keith Packard committed
32

33
34
35
36
37
38
#if defined(__GNUC__) && (__GNUC__ >= 4)
#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0)))
#else
#define FC_ATTRIBUTE_SENTINEL(x)
#endif

39
40
41
42
#ifndef FcPublic
#define FcPublic
#endif

Keith Packard's avatar
Keith Packard committed
43
44
45
46
47
48
typedef unsigned char	FcChar8;
typedef unsigned short	FcChar16;
typedef unsigned int	FcChar32;
typedef int		FcBool;

/*
49
50
51
 * 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.
Keith Packard's avatar
Keith Packard committed
52
 */
Keith Packard's avatar
Keith Packard committed
53

54
#define FC_MAJOR	2
Akira TAGOH's avatar
Akira TAGOH committed
55
#define FC_MINOR	12
Akira TAGOH's avatar
Akira TAGOH committed
56
#define FC_REVISION	6
Keith Packard's avatar
Keith Packard committed
57
58
59

#define FC_VERSION	((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))

60
61
62
63
64
65
66
67
68
69
/*
 * 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.
 */

Akira TAGOH's avatar
Akira TAGOH committed
70
#define FC_CACHE_VERSION_NUMBER	7
71
72
73
#define _FC_STRINGIFY_(s)    	#s
#define _FC_STRINGIFY(s)    	_FC_STRINGIFY_(s)
#define FC_CACHE_VERSION    	_FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
74

Keith Packard's avatar
Keith Packard committed
75
76
77
78
79
80
81
#define FcTrue		1
#define FcFalse		0

#define FC_FAMILY	    "family"		/* String */
#define FC_STYLE	    "style"		/* String */
#define FC_SLANT	    "slant"		/* Int */
#define FC_WEIGHT	    "weight"		/* Int */
82
#define FC_SIZE		    "size"		/* Range (double) */
83
#define FC_ASPECT	    "aspect"		/* Double */
Keith Packard's avatar
Keith Packard committed
84
85
86
87
88
#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) */
89
#define FC_HINT_STYLE	    "hintstyle"		/* Int */
Keith Packard's avatar
Keith Packard committed
90
91
#define FC_VERTICAL_LAYOUT  "verticallayout"	/* Bool (false) */
#define FC_AUTOHINT	    "autohint"		/* Bool (false) */
92
/* FC_GLOBAL_ADVANCE is deprecated. this is simply ignored on freetype 2.4.5 or later */
Keith Packard's avatar
Keith Packard committed
93
#define FC_GLOBAL_ADVANCE   "globaladvance"	/* Bool (true) */
94
#define FC_WIDTH	    "width"		/* Int */
Keith Packard's avatar
Keith Packard committed
95
96
#define FC_FILE		    "file"		/* String */
#define FC_INDEX	    "index"		/* Int */
97
#define FC_FT_FACE	    "ftface"		/* FT_Face */
98
#define FC_RASTERIZER	    "rasterizer"	/* String (deprecated) */
Keith Packard's avatar
Keith Packard committed
99
100
#define FC_OUTLINE	    "outline"		/* Bool */
#define FC_SCALABLE	    "scalable"		/* Bool */
Behdad Esfahbod's avatar
Behdad Esfahbod committed
101
#define FC_COLOR	    "color"		/* Bool */
Akira TAGOH's avatar
Akira TAGOH committed
102
#define FC_SCALE	    "scale"		/* double (deprecated) */
103
#define FC_SYMBOL	    "symbol"		/* Bool */
Keith Packard's avatar
Keith Packard committed
104
105
106
#define FC_DPI		    "dpi"		/* double */
#define FC_RGBA		    "rgba"		/* Int */
#define FC_MINSPACE	    "minspace"		/* Bool use minimum line spacing */
107
#define FC_SOURCE	    "source"		/* String (deprecated) */
Keith Packard's avatar
Keith Packard committed
108
#define FC_CHARSET	    "charset"		/* CharSet */
Keith Packard's avatar
Keith Packard committed
109
110
#define FC_LANG		    "lang"		/* String RFC 3066 langs */
#define FC_FONTVERSION	    "fontversion"	/* Int from 'head' table */
111
112
113
114
#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 */
Keith Packard's avatar
Keith Packard committed
115
#define FC_CAPABILITY       "capability"	/* String */
116
#define FC_FONTFORMAT	    "fontformat"	/* String */
117
#define FC_EMBOLDEN	    "embolden"		/* Bool - true if emboldening needed*/
118
#define FC_EMBEDDED_BITMAP  "embeddedbitmap"	/* Bool - true to enable embedded bitmaps */
119
#define FC_DECORATIVE	    "decorative"	/* Bool - true if style is a decorative variant */
120
#define FC_LCD_FILTER	    "lcdfilter"		/* Int */
121
#define FC_FONT_FEATURES    "fontfeatures"	/* String */
122
#define FC_NAMELANG	    "namelang"		/* String RFC 3866 langs */
Behdad Esfahbod's avatar
Behdad Esfahbod committed
123
#define FC_PRGNAME	    "prgname"		/* String */
124
#define FC_HASH		    "hash"		/* String (deprecated) */
125
#define FC_POSTSCRIPT_NAME  "postscriptname"	/* String */
Keith Packard's avatar
Keith Packard committed
126

127
128
129
#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
Keith Packard's avatar
Keith Packard committed
130
131

/* Adjust outline rasterizer */
132
133
#define FC_CHARWIDTH	    "charwidth"	/* Int */
#define FC_CHAR_WIDTH	    FC_CHARWIDTH
Keith Packard's avatar
Keith Packard committed
134
135
136
#define FC_CHAR_HEIGHT	    "charheight"/* Int */
#define FC_MATRIX	    "matrix"    /* FcMatrix */

137
138
139
140
#define FC_WEIGHT_THIN		    0
#define FC_WEIGHT_EXTRALIGHT	    40
#define FC_WEIGHT_ULTRALIGHT	    FC_WEIGHT_EXTRALIGHT
#define FC_WEIGHT_LIGHT		    50
141
#define FC_WEIGHT_DEMILIGHT	    55
Behdad Esfahbod's avatar
Behdad Esfahbod committed
142
#define FC_WEIGHT_SEMILIGHT	    FC_WEIGHT_DEMILIGHT
143
#define FC_WEIGHT_BOOK		    75
144
145
146
147
148
149
150
#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
151
#define FC_WEIGHT_ULTRABOLD	    FC_WEIGHT_EXTRABOLD
152
#define FC_WEIGHT_BLACK		    210
153
#define FC_WEIGHT_HEAVY		    FC_WEIGHT_BLACK
Keith Packard's avatar
Keith Packard committed
154
155
#define FC_WEIGHT_EXTRABLACK	    215
#define FC_WEIGHT_ULTRABLACK	    FC_WEIGHT_EXTRABLACK
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

#define FC_SLANT_ROMAN		    0
#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
172
#define FC_DUAL			    90
173
174
#define FC_MONO			    100
#define FC_CHARCELL		    110
Keith Packard's avatar
Keith Packard committed
175
176

/* sub-pixel order */
Keith Packard's avatar
Keith Packard committed
177
#define FC_RGBA_UNKNOWN	    0
Keith Packard's avatar
Keith Packard committed
178
179
180
181
#define FC_RGBA_RGB	    1
#define FC_RGBA_BGR	    2
#define FC_RGBA_VRGB	    3
#define FC_RGBA_VBGR	    4
Keith Packard's avatar
Keith Packard committed
182
#define FC_RGBA_NONE	    5
Keith Packard's avatar
Keith Packard committed
183

184
185
186
187
188
/* hinting style */
#define FC_HINT_NONE        0
#define FC_HINT_SLIGHT      1
#define FC_HINT_MEDIUM      2
#define FC_HINT_FULL        3
189
190
191
192
193
194
195

/* LCD filter */
#define FC_LCD_NONE	    0
#define FC_LCD_DEFAULT	    1
#define FC_LCD_LIGHT	    2
#define FC_LCD_LEGACY	    3

Keith Packard's avatar
Keith Packard committed
196
typedef enum _FcType {
197
    FcTypeUnknown = -1,
Behdad Esfahbod's avatar
Behdad Esfahbod committed
198
199
200
201
    FcTypeVoid,
    FcTypeInteger,
    FcTypeDouble,
    FcTypeString,
Keith Packard's avatar
Keith Packard committed
202
203
    FcTypeBool,
    FcTypeMatrix,
204
    FcTypeCharSet,
205
    FcTypeFTFace,
206
207
    FcTypeLangSet,
    FcTypeRange
Keith Packard's avatar
Keith Packard committed
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
} FcType;

typedef struct _FcMatrix {
    double xx, xy, yx, yy;
} FcMatrix;

#define FcMatrixInit(m)	((m)->xx = (m)->yy = 1, \
			 (m)->xy = (m)->yx = 0)

/*
 * 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 {
Akira TAGOH's avatar
Akira TAGOH committed
225
    char	*object;
Keith Packard's avatar
Keith Packard committed
226
227
228
229
    FcType	type;
} FcObjectType;

typedef struct _FcConstant {
230
    const FcChar8  *name;
Keith Packard's avatar
Keith Packard committed
231
232
233
234
235
    const char	*object;
    int		value;
} FcConstant;

typedef enum _FcResult {
236
    FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
237
    FcResultOutOfMemory
Keith Packard's avatar
Keith Packard committed
238
239
} FcResult;

240
241
242
243
244
245
typedef enum _FcValueBinding {
    FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
    /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
    FcValueBindingEnd = INT_MAX
} FcValueBinding;

246
247
typedef struct _FcPattern   FcPattern;

248
249
typedef struct _FcLangSet   FcLangSet;

250
251
typedef struct _FcRange	    FcRange;

Keith Packard's avatar
Keith Packard committed
252
253
254
typedef struct _FcValue {
    FcType	type;
    union {
255
	const FcChar8	*s;
Keith Packard's avatar
Keith Packard committed
256
257
258
	int		i;
	FcBool		b;
	double		d;
259
260
	const FcMatrix	*m;
	const FcCharSet	*c;
261
	void		*f;
262
	const FcLangSet	*l;
263
	const FcRange	*r;
Keith Packard's avatar
Keith Packard committed
264
265
266
267
268
269
270
271
272
273
274
275
    } u;
} FcValue;

typedef struct _FcFontSet {
    int		nfont;
    int		sfont;
    FcPattern	**fonts;
} FcFontSet;

typedef struct _FcObjectSet {
    int		nobject;
    int		sobject;
276
    const char	**objects;
Keith Packard's avatar
Keith Packard committed
277
278
279
} FcObjectSet;
    
typedef enum _FcMatchKind {
280
    FcMatchPattern, FcMatchFont, FcMatchScan
Keith Packard's avatar
Keith Packard committed
281
282
} FcMatchKind;

283
typedef enum _FcLangResult {
284
285
286
287
    FcLangEqual = 0,
    FcLangDifferentCountry = 1,
    FcLangDifferentTerritory = 1,
    FcLangDifferentLang = 2
288
289
} FcLangResult;

Keith Packard's avatar
Keith Packard committed
290
291
292
293
294
typedef enum _FcSetName {
    FcSetSystem = 0,
    FcSetApplication = 1
} FcSetName;

295
296
typedef struct _FcAtomic FcAtomic;

Keith Packard's avatar
Keith Packard committed
297
298
299
300
301
302
303
304
#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
#define _FCFUNCPROTOBEGIN extern "C" {	/* do not leave open across includes */
#define _FCFUNCPROTOEND }
#else
#define _FCFUNCPROTOBEGIN
#define _FCFUNCPROTOEND
#endif

305
306
typedef enum { FcEndianBig, FcEndianLittle } FcEndian;

Keith Packard's avatar
Keith Packard committed
307
308
typedef struct _FcConfig    FcConfig;

309
typedef struct _FcGlobalCache	FcFileCache;
Keith Packard's avatar
Keith Packard committed
310
311
312

typedef struct _FcBlanks    FcBlanks;

313
314
315
316
typedef struct _FcStrList   FcStrList;

typedef struct _FcStrSet    FcStrSet;

317
typedef struct _FcCache	    FcCache;
Keith Packard's avatar
Keith Packard committed
318

319
_FCFUNCPROTOBEGIN
320

Keith Packard's avatar
Keith Packard committed
321
/* fcblanks.c */
322
FcPublic FcBlanks *
Keith Packard's avatar
Keith Packard committed
323
324
FcBlanksCreate (void);

325
FcPublic void
Keith Packard's avatar
Keith Packard committed
326
327
FcBlanksDestroy (FcBlanks *b);

328
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
329
330
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);

331
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
332
333
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);

334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
/* fccache.c */

FcPublic const FcChar8 *
FcCacheDir(const FcCache *c);

FcPublic FcFontSet *
FcCacheCopySet(const FcCache *c);

FcPublic const FcChar8 *
FcCacheSubdir (const FcCache *c, int i);

FcPublic int
FcCacheNumSubdir (const FcCache *c);

FcPublic int
FcCacheNumFont (const FcCache *c);

351
FcPublic FcBool
352
353
354
355
356
FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);

FcPublic FcBool
FcDirCacheValid (const FcChar8 *cache_file);

357
358
359
FcPublic FcBool
FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);

360
361
362
FcPublic void
FcCacheCreateTagFile (const FcConfig *config);

Keith Packard's avatar
Keith Packard committed
363
/* fccfg.c */
364
FcPublic FcChar8 *
365
366
FcConfigHome (void);

367
FcPublic FcBool
368
369
FcConfigEnableHome (FcBool enable);

370
FcPublic FcChar8 *
371
FcConfigFilename (const FcChar8 *url);
Keith Packard's avatar
Keith Packard committed
372
    
373
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
374
375
FcConfigCreate (void);

376
377
378
FcPublic FcConfig *
FcConfigReference (FcConfig *config);

379
FcPublic void
Keith Packard's avatar
Keith Packard committed
380
381
FcConfigDestroy (FcConfig *config);

382
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
383
384
FcConfigSetCurrent (FcConfig *config);

385
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
386
387
FcConfigGetCurrent (void);

388
FcPublic FcBool
389
390
FcConfigUptoDate (FcConfig *config);
    
391
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
392
393
FcConfigBuildFonts (FcConfig *config);

394
FcPublic FcStrList *
395
396
FcConfigGetFontDirs (FcConfig   *config);

397
FcPublic FcStrList *
398
FcConfigGetConfigDirs (FcConfig   *config);
Keith Packard's avatar
Keith Packard committed
399

400
FcPublic FcStrList *
Keith Packard's avatar
Keith Packard committed
401
402
FcConfigGetConfigFiles (FcConfig    *config);

403
FcPublic FcChar8 *
Keith Packard's avatar
Keith Packard committed
404
405
FcConfigGetCache (FcConfig  *config);

406
FcPublic FcBlanks *
Keith Packard's avatar
Keith Packard committed
407
408
FcConfigGetBlanks (FcConfig *config);

409
FcPublic FcStrList *
410
FcConfigGetCacheDirs (const FcConfig	*config);
411
412

FcPublic int
413
FcConfigGetRescanInterval (FcConfig *config);
414

415
FcPublic FcBool
416
FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
417

418
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
419
420
421
FcConfigGetFonts (FcConfig	*config,
		  FcSetName	set);

422
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
423
FcConfigAppFontAddFile (FcConfig    *config,
424
			const FcChar8  *file);
Keith Packard's avatar
Keith Packard committed
425

426
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
427
FcConfigAppFontAddDir (FcConfig	    *config,
428
		       const FcChar8   *dir);
Keith Packard's avatar
Keith Packard committed
429

430
FcPublic void
Keith Packard's avatar
Keith Packard committed
431
432
FcConfigAppFontClear (FcConfig	    *config);

433
FcPublic FcBool
434
435
436
437
438
FcConfigSubstituteWithPat (FcConfig	*config,
			   FcPattern	*p,
			   FcPattern	*p_pat,
			   FcMatchKind	kind);

439
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
440
441
442
443
FcConfigSubstitute (FcConfig	*config,
		    FcPattern	*p,
		    FcMatchKind	kind);

444
445
446
447
448
449
450
FcPublic const FcChar8 *
FcConfigGetSysRoot (const FcConfig *config);

FcPublic void
FcConfigSetSysRoot (FcConfig      *config,
		    const FcChar8 *sysroot);

Keith Packard's avatar
Keith Packard committed
451
/* fccharset.c */
452
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
453
454
FcCharSetCreate (void);

455
456
457
/* deprecated alias for FcCharSetCreate */
FcPublic FcCharSet *
FcCharSetNew (void);
458

459
FcPublic void
Keith Packard's avatar
Keith Packard committed
460
461
FcCharSetDestroy (FcCharSet *fcs);

462
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
463
464
FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);

465
466
467
FcPublic FcBool
FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);

468
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
469
470
FcCharSetCopy (FcCharSet *src);

471
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
472
473
FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);

474
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
475
476
FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);

477
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
478
479
FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);

480
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
481
482
FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);

Karl Tomlinson's avatar
Karl Tomlinson committed
483
484
FcPublic FcBool
FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
Behdad Esfahbod's avatar
Behdad Esfahbod committed
485

486
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
487
488
FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);

489
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
490
491
FcCharSetCount (const FcCharSet *a);

492
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
493
494
FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);

495
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
496
497
FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);

498
FcPublic FcBool
499
500
FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);

501
502
503
#define FC_CHARSET_MAP_SIZE (256/32)
#define FC_CHARSET_DONE	((FcChar32) -1)

504
FcPublic FcChar32
505
506
507
508
FcCharSetFirstPage (const FcCharSet *a, 
		    FcChar32	    map[FC_CHARSET_MAP_SIZE],
		    FcChar32	    *next);

509
FcPublic FcChar32
510
511
512
513
FcCharSetNextPage (const FcCharSet  *a, 
		   FcChar32	    map[FC_CHARSET_MAP_SIZE],
		   FcChar32	    *next);

514
515
516
517
518
519
/*
 * old coverage API, rather hard to use correctly
 */

FcPublic FcChar32
FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
520

Keith Packard's avatar
Keith Packard committed
521
/* fcdbg.c */
522
FcPublic void
523
FcValuePrint (const FcValue v);
Keith Packard's avatar
Keith Packard committed
524

525
FcPublic void
526
FcPatternPrint (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
527

528
FcPublic void
529
FcFontSetPrint (const FcFontSet *s);
Keith Packard's avatar
Keith Packard committed
530

Keith Packard's avatar
Keith Packard committed
531
/* fcdefault.c */
532
533
534
FcPublic FcStrSet *
FcGetDefaultLangs (void);

535
FcPublic void
Keith Packard's avatar
Keith Packard committed
536
537
538
FcDefaultSubstitute (FcPattern *pattern);

/* fcdir.c */
539
540
541
542
FcPublic FcBool
FcFileIsDir (const FcChar8 *file);

FcPublic FcBool
543
FcFileScan (FcFontSet	    *set,
544
	    FcStrSet	    *dirs,
545
546
547
548
	    FcFileCache	    *cache,
	    FcBlanks	    *blanks,
	    const FcChar8   *file,
	    FcBool	    force);
Keith Packard's avatar
Keith Packard committed
549

550
FcPublic FcBool
551
FcDirScan (FcFontSet	    *set,
552
	   FcStrSet	    *dirs,
553
554
555
556
557
	   FcFileCache	    *cache,
	   FcBlanks	    *blanks,
	   const FcChar8    *dir,
	   FcBool	    force);

558
FcPublic FcBool
Patrick Lam's avatar
:  
Patrick Lam committed
559
FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
560

561
562
FcPublic FcCache *
FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
563
564
565

FcPublic FcCache *
FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
566
567
568
569
570
571
572
573
574
575
    
FcPublic FcCache *
FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);

FcPublic FcCache *
FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);

FcPublic void
FcDirCacheUnload (FcCache *cache);

Keith Packard's avatar
Keith Packard committed
576
/* fcfreetype.c */
577
FcPublic FcPattern *
578
FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
Keith Packard's avatar
Keith Packard committed
579
580
581

/* fcfs.c */

582
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
583
584
FcFontSetCreate (void);

585
FcPublic void
Keith Packard's avatar
Keith Packard committed
586
587
FcFontSetDestroy (FcFontSet *s);

588
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
589
590
591
FcFontSetAdd (FcFontSet *s, FcPattern *font);

/* fcinit.c */
592
FcPublic FcConfig *
593
594
FcInitLoadConfig (void);

595
FcPublic FcConfig *
596
597
FcInitLoadConfigAndFonts (void);

598
FcPublic FcBool
599
FcInit (void);
Keith Packard's avatar
Keith Packard committed
600

601
FcPublic void
602
603
FcFini (void);

604
FcPublic int
605
606
FcGetVersion (void);

607
FcPublic FcBool
608
FcInitReinitialize (void);
Keith Packard's avatar
Keith Packard committed
609

610
FcPublic FcBool
611
FcInitBringUptoDate (void);
Keith Packard's avatar
Keith Packard committed
612

613
/* fclang.c */
614
FcPublic FcStrSet *
615
616
FcGetLangs (void);

617
618
619
FcPublic FcChar8 *
FcLangNormalize (const FcChar8 *lang);

620
621
622
FcPublic const FcCharSet *
FcLangGetCharSet (const FcChar8 *lang);

623
FcPublic FcLangSet*
624
625
FcLangSetCreate (void);

626
FcPublic void
627
628
FcLangSetDestroy (FcLangSet *ls);

629
FcPublic FcLangSet*
630
631
FcLangSetCopy (const FcLangSet *ls);

632
FcPublic FcBool
633
634
FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);

Akira TAGOH's avatar
Akira TAGOH committed
635
636
637
FcPublic FcBool
FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);

638
FcPublic FcLangResult
639
640
FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);

641
FcPublic FcLangResult
642
643
FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);

644
FcPublic FcBool
645
646
FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);

647
FcPublic FcBool
648
649
FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);

650
FcPublic FcChar32
651
652
FcLangSetHash (const FcLangSet *ls);

653
654
655
FcPublic FcStrSet *
FcLangSetGetLangs (const FcLangSet *ls);

656
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
657
658
FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);

659
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
660
661
FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);

Keith Packard's avatar
Keith Packard committed
662
/* fclist.c */
663
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
664
665
FcObjectSetCreate (void);

666
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
667
668
FcObjectSetAdd (FcObjectSet *os, const char *object);

669
FcPublic void
Keith Packard's avatar
Keith Packard committed
670
671
FcObjectSetDestroy (FcObjectSet *os);

672
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
673
674
FcObjectSetVaBuild (const char *first, va_list va);

675
FcPublic FcObjectSet *
676
FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
Keith Packard's avatar
Keith Packard committed
677

678
FcPublic FcFontSet *
679
680
681
682
683
684
FcFontSetList (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcObjectSet  *os);

685
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
686
687
688
689
FcFontList (FcConfig	*config,
	    FcPattern	*p,
	    FcObjectSet *os);

690
691
/* fcatomic.c */

692
FcPublic FcAtomic *
693
694
FcAtomicCreate (const FcChar8   *file);

695
FcPublic FcBool
696
697
FcAtomicLock (FcAtomic *atomic);

698
FcPublic FcChar8 *
699
700
FcAtomicNewFile (FcAtomic *atomic);

701
FcPublic FcChar8 *
702
703
FcAtomicOrigFile (FcAtomic *atomic);

704
FcPublic FcBool
705
706
FcAtomicReplaceOrig (FcAtomic *atomic);

707
FcPublic void
708
709
FcAtomicDeleteNew (FcAtomic *atomic);

710
FcPublic void
711
712
FcAtomicUnlock (FcAtomic *atomic);

713
FcPublic void
714
715
FcAtomicDestroy (FcAtomic *atomic);

Keith Packard's avatar
Keith Packard committed
716
/* fcmatch.c */
717
FcPublic FcPattern *
718
719
720
721
722
723
FcFontSetMatch (FcConfig    *config,
		FcFontSet   **sets,
		int	    nsets,
		FcPattern   *p,
		FcResult    *result);

724
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
725
726
727
728
FcFontMatch (FcConfig	*config,
	     FcPattern	*p, 
	     FcResult	*result);

729
FcPublic FcPattern *
730
731
732
733
FcFontRenderPrepare (FcConfig	    *config,
		     FcPattern	    *pat,
		     FcPattern	    *font);

734
FcPublic FcFontSet *
735
736
737
738
739
740
741
742
FcFontSetSort (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcBool	    trim,
	       FcCharSet    **csp,
	       FcResult	    *result);

743
FcPublic FcFontSet *
744
745
746
747
748
749
FcFontSort (FcConfig	 *config,
	    FcPattern    *p,
	    FcBool	 trim,
	    FcCharSet    **csp,
	    FcResult	 *result);

750
FcPublic void
751
752
FcFontSetSortDestroy (FcFontSet *fs);

Keith Packard's avatar
Keith Packard committed
753
/* fcmatrix.c */
754
FcPublic FcMatrix *
Keith Packard's avatar
Keith Packard committed
755
756
FcMatrixCopy (const FcMatrix *mat);

757
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
758
759
FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);

760
FcPublic void
Keith Packard's avatar
Keith Packard committed
761
762
FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);

763
FcPublic void
Keith Packard's avatar
Keith Packard committed
764
765
FcMatrixRotate (FcMatrix *m, double c, double s);

766
FcPublic void
Keith Packard's avatar
Keith Packard committed
767
768
FcMatrixScale (FcMatrix *m, double sx, double sy);

769
FcPublic void
Keith Packard's avatar
Keith Packard committed
770
771
772
773
FcMatrixShear (FcMatrix *m, double sh, double sv);

/* fcname.c */

774
/* Deprecated.  Does nothing.  Returns FcFalse. */
775
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
776
777
FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);

778
/* Deprecated.  Does nothing.  Returns FcFalse. */
779
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
780
FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
781

782
FcPublic const FcObjectType *
Keith Packard's avatar
Keith Packard committed
783
784
FcNameGetObjectType (const char *object);

785
/* Deprecated.  Does nothing.  Returns FcFalse. */
786
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
787
788
FcNameRegisterConstants (const FcConstant *consts, int nconsts);

789
/* Deprecated.  Does nothing.  Returns FcFalse. */
790
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
791
FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
792

793
FcPublic const FcConstant *
794
FcNameGetConstant (const FcChar8 *string);
Keith Packard's avatar
Keith Packard committed
795

796
FcPublic FcBool
797
FcNameConstant (const FcChar8 *string, int *result);
Keith Packard's avatar
Keith Packard committed
798

799
FcPublic FcPattern *
800
FcNameParse (const FcChar8 *name);
Keith Packard's avatar
Keith Packard committed
801

802
FcPublic FcChar8 *
Keith Packard's avatar
Keith Packard committed
803
804
805
FcNameUnparse (FcPattern *pat);

/* fcpat.c */
806
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
807
808
FcPatternCreate (void);

809
FcPublic FcPattern *
810
FcPatternDuplicate (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
811

812
FcPublic void
813
814
FcPatternReference (FcPattern *p);

815
816
817
FcPublic FcPattern *
FcPatternFilter (FcPattern *p, const FcObjectSet *os);

818
FcPublic void
Keith Packard's avatar
Keith Packard committed
819
820
FcValueDestroy (FcValue v);

821
FcPublic FcBool
822
823
FcValueEqual (FcValue va, FcValue vb);

824
FcPublic FcValue
Keith Packard's avatar
Keith Packard committed
825
826
FcValueSave (FcValue v);

827
FcPublic void
Keith Packard's avatar
Keith Packard committed
828
829
FcPatternDestroy (FcPattern *p);

830
FcPublic FcBool
831
832
FcPatternEqual (const FcPattern *pa, const FcPattern *pb);

833
FcPublic FcBool
834
FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
835

836
FcPublic FcChar32
837
838
FcPatternHash (const FcPattern *p);

839
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
840
841
FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
    
842
FcPublic FcBool
843
844
FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
    
845
FcPublic FcResult
846
FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
847
848
849
850

FcPublic FcResult
FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b);

851
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
852
853
FcPatternDel (FcPattern *p, const char *object);

854
FcPublic FcBool
855
856
FcPatternRemove (FcPattern *p, const char *object, int id);

857
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
858
859
FcPatternAddInteger (FcPattern *p, const char *object, int i);

860
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
861
862
FcPatternAddDouble (FcPattern *p, const char *object, double d);

863
FcPublic FcBool
864
FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
Keith Packard's avatar
Keith Packard committed
865

866
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
867
868
FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);

869
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
870
871
FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);

872
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
873
874
FcPatternAddBool (FcPattern *p, const char *object, FcBool b);

875
FcPublic FcBool
876
877
FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);

878
879
880
FcPublic FcBool
FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);

881
FcPublic FcResult
882
FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
Keith Packard's avatar
Keith Packard committed
883

884
FcPublic FcResult
885
FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
Keith Packard's avatar
Keith Packard committed
886

887
FcPublic FcResult
888
FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
Keith Packard's avatar
Keith Packard committed
889

890
FcPublic FcResult
891
FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
Keith Packard's avatar
Keith Packard committed
892

893
FcPublic FcResult
894
FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
Keith Packard's avatar
Keith Packard committed
895

896
FcPublic FcResult
897
FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
Keith Packard's avatar<