fontconfig.h 25.3 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
31
#include <stdarg.h>

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

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

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

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

53
#define FC_MAJOR	2
Akira TAGOH's avatar
Akira TAGOH committed
54
#define FC_MINOR	11
Akira TAGOH's avatar
Akira TAGOH committed
55
#define FC_REVISION	95
Keith Packard's avatar
Keith Packard committed
56
57
58

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

59
60
61
62
63
64
65
66
67
68
/*
 * 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
69
#define FC_CACHE_VERSION_NUMBER	7
70
71
72
#define _FC_STRINGIFY_(s)    	#s
#define _FC_STRINGIFY(s)    	_FC_STRINGIFY_(s)
#define FC_CACHE_VERSION    	_FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
73

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

126
127
128
#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
129
130
131
132
133
134

/* Adjust outline rasterizer */
#define FC_CHAR_WIDTH	    "charwidth"	/* Int */
#define FC_CHAR_HEIGHT	    "charheight"/* Int */
#define FC_MATRIX	    "matrix"    /* FcMatrix */

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

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

/* sub-pixel order */
Keith Packard's avatar
Keith Packard committed
175
#define FC_RGBA_UNKNOWN	    0
Keith Packard's avatar
Keith Packard committed
176
177
178
179
#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
180
#define FC_RGBA_NONE	    5
Keith Packard's avatar
Keith Packard committed
181

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

/* 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
194
typedef enum _FcType {
195
    FcTypeUnknown = -1,
Behdad Esfahbod's avatar
Behdad Esfahbod committed
196
197
198
199
    FcTypeVoid,
    FcTypeInteger,
    FcTypeDouble,
    FcTypeString,
Keith Packard's avatar
Keith Packard committed
200
201
    FcTypeBool,
    FcTypeMatrix,
202
    FcTypeCharSet,
203
    FcTypeFTFace,
204
205
    FcTypeLangSet,
    FcTypeRange
Keith Packard's avatar
Keith Packard committed
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
} 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
223
    char	*object;
Keith Packard's avatar
Keith Packard committed
224
225
226
227
    FcType	type;
} FcObjectType;

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

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

238
239
typedef struct _FcPattern   FcPattern;

240
241
typedef struct _FcLangSet   FcLangSet;

242
243
typedef struct _FcRange	    FcRange;

Keith Packard's avatar
Keith Packard committed
244
245
246
typedef struct _FcValue {
    FcType	type;
    union {
247
	const FcChar8	*s;
Keith Packard's avatar
Keith Packard committed
248
249
250
	int		i;
	FcBool		b;
	double		d;
251
252
	const FcMatrix	*m;
	const FcCharSet	*c;
253
	void		*f;
254
	const FcLangSet	*l;
255
	const FcRange	*r;
Keith Packard's avatar
Keith Packard committed
256
257
258
259
260
261
262
263
264
265
266
267
    } u;
} FcValue;

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

typedef struct _FcObjectSet {
    int		nobject;
    int		sobject;
268
    const char	**objects;
Keith Packard's avatar
Keith Packard committed
269
270
271
} FcObjectSet;
    
typedef enum _FcMatchKind {
272
    FcMatchPattern, FcMatchFont, FcMatchScan
Keith Packard's avatar
Keith Packard committed
273
274
} FcMatchKind;

275
typedef enum _FcLangResult {
276
277
278
279
    FcLangEqual = 0,
    FcLangDifferentCountry = 1,
    FcLangDifferentTerritory = 1,
    FcLangDifferentLang = 2
280
281
} FcLangResult;

Keith Packard's avatar
Keith Packard committed
282
283
284
285
286
typedef enum _FcSetName {
    FcSetSystem = 0,
    FcSetApplication = 1
} FcSetName;

287
288
typedef struct _FcAtomic FcAtomic;

Keith Packard's avatar
Keith Packard committed
289
290
291
292
293
294
295
296
#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

297
298
typedef enum { FcEndianBig, FcEndianLittle } FcEndian;

Keith Packard's avatar
Keith Packard committed
299
300
typedef struct _FcConfig    FcConfig;

301
typedef struct _FcGlobalCache	FcFileCache;
Keith Packard's avatar
Keith Packard committed
302
303
304

typedef struct _FcBlanks    FcBlanks;

305
306
307
308
typedef struct _FcStrList   FcStrList;

typedef struct _FcStrSet    FcStrSet;

309
typedef struct _FcCache	    FcCache;
Keith Packard's avatar
Keith Packard committed
310

311
_FCFUNCPROTOBEGIN
312

Keith Packard's avatar
Keith Packard committed
313
/* fcblanks.c */
314
FcPublic FcBlanks *
Keith Packard's avatar
Keith Packard committed
315
316
FcBlanksCreate (void);

317
FcPublic void
Keith Packard's avatar
Keith Packard committed
318
319
FcBlanksDestroy (FcBlanks *b);

320
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
321
322
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);

323
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
324
325
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);

326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
/* 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);

343
FcPublic FcBool
344
345
346
347
348
FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);

FcPublic FcBool
FcDirCacheValid (const FcChar8 *cache_file);

349
350
351
FcPublic FcBool
FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);

352
353
354
FcPublic void
FcCacheCreateTagFile (const FcConfig *config);

Keith Packard's avatar
Keith Packard committed
355
/* fccfg.c */
356
FcPublic FcChar8 *
357
358
FcConfigHome (void);

359
FcPublic FcBool
360
361
FcConfigEnableHome (FcBool enable);

362
FcPublic FcChar8 *
363
FcConfigFilename (const FcChar8 *url);
Keith Packard's avatar
Keith Packard committed
364
    
365
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
366
367
FcConfigCreate (void);

368
369
370
FcPublic FcConfig *
FcConfigReference (FcConfig *config);

371
FcPublic void
Keith Packard's avatar
Keith Packard committed
372
373
FcConfigDestroy (FcConfig *config);

374
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
375
376
FcConfigSetCurrent (FcConfig *config);

377
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
378
379
FcConfigGetCurrent (void);

380
FcPublic FcBool
381
382
FcConfigUptoDate (FcConfig *config);
    
383
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
384
385
FcConfigBuildFonts (FcConfig *config);

386
FcPublic FcStrList *
387
388
FcConfigGetFontDirs (FcConfig   *config);

389
FcPublic FcStrList *
390
FcConfigGetConfigDirs (FcConfig   *config);
Keith Packard's avatar
Keith Packard committed
391

392
FcPublic FcStrList *
Keith Packard's avatar
Keith Packard committed
393
394
FcConfigGetConfigFiles (FcConfig    *config);

395
FcPublic FcChar8 *
Keith Packard's avatar
Keith Packard committed
396
397
FcConfigGetCache (FcConfig  *config);

398
FcPublic FcBlanks *
Keith Packard's avatar
Keith Packard committed
399
400
FcConfigGetBlanks (FcConfig *config);

401
FcPublic FcStrList *
402
FcConfigGetCacheDirs (const FcConfig	*config);
403
404

FcPublic int
405
FcConfigGetRescanInterval (FcConfig *config);
406

407
FcPublic FcBool
408
FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
409

410
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
411
412
413
FcConfigGetFonts (FcConfig	*config,
		  FcSetName	set);

414
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
415
FcConfigAppFontAddFile (FcConfig    *config,
416
			const FcChar8  *file);
Keith Packard's avatar
Keith Packard committed
417

418
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
419
FcConfigAppFontAddDir (FcConfig	    *config,
420
		       const FcChar8   *dir);
Keith Packard's avatar
Keith Packard committed
421

422
FcPublic void
Keith Packard's avatar
Keith Packard committed
423
424
FcConfigAppFontClear (FcConfig	    *config);

425
FcPublic FcBool
426
427
428
429
430
FcConfigSubstituteWithPat (FcConfig	*config,
			   FcPattern	*p,
			   FcPattern	*p_pat,
			   FcMatchKind	kind);

431
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
432
433
434
435
FcConfigSubstitute (FcConfig	*config,
		    FcPattern	*p,
		    FcMatchKind	kind);

436
437
438
439
440
441
442
FcPublic const FcChar8 *
FcConfigGetSysRoot (const FcConfig *config);

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

Keith Packard's avatar
Keith Packard committed
443
/* fccharset.c */
444
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
445
446
FcCharSetCreate (void);

447
448
449
/* deprecated alias for FcCharSetCreate */
FcPublic FcCharSet *
FcCharSetNew (void);
450

451
FcPublic void
Keith Packard's avatar
Keith Packard committed
452
453
FcCharSetDestroy (FcCharSet *fcs);

454
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
455
456
FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);

457
458
459
FcPublic FcBool
FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);

460
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
461
462
FcCharSetCopy (FcCharSet *src);

463
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
464
465
FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);

466
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
467
468
FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);

469
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
470
471
FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);

472
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
473
474
FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);

Karl Tomlinson's avatar
Karl Tomlinson committed
475
476
FcPublic FcBool
FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
Behdad Esfahbod's avatar
Behdad Esfahbod committed
477

478
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
479
480
FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);

481
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
482
483
FcCharSetCount (const FcCharSet *a);

484
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
485
486
FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);

487
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
488
489
FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);

490
FcPublic FcBool
491
492
FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);

493
494
495
#define FC_CHARSET_MAP_SIZE (256/32)
#define FC_CHARSET_DONE	((FcChar32) -1)

496
FcPublic FcChar32
497
498
499
500
FcCharSetFirstPage (const FcCharSet *a, 
		    FcChar32	    map[FC_CHARSET_MAP_SIZE],
		    FcChar32	    *next);

501
FcPublic FcChar32
502
503
504
505
FcCharSetNextPage (const FcCharSet  *a, 
		   FcChar32	    map[FC_CHARSET_MAP_SIZE],
		   FcChar32	    *next);

506
507
508
509
510
511
/*
 * old coverage API, rather hard to use correctly
 */

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

Keith Packard's avatar
Keith Packard committed
513
/* fcdbg.c */
514
FcPublic void
515
FcValuePrint (const FcValue v);
Keith Packard's avatar
Keith Packard committed
516

517
FcPublic void
518
FcPatternPrint (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
519

520
FcPublic void
521
FcFontSetPrint (const FcFontSet *s);
Keith Packard's avatar
Keith Packard committed
522

Keith Packard's avatar
Keith Packard committed
523
/* fcdefault.c */
524
525
526
FcPublic FcStrSet *
FcGetDefaultLangs (void);

527
FcPublic void
Keith Packard's avatar
Keith Packard committed
528
529
530
FcDefaultSubstitute (FcPattern *pattern);

/* fcdir.c */
531
532
533
534
FcPublic FcBool
FcFileIsDir (const FcChar8 *file);

FcPublic FcBool
535
FcFileScan (FcFontSet	    *set,
536
	    FcStrSet	    *dirs,
537
538
539
540
	    FcFileCache	    *cache,
	    FcBlanks	    *blanks,
	    const FcChar8   *file,
	    FcBool	    force);
Keith Packard's avatar
Keith Packard committed
541

542
FcPublic FcBool
543
FcDirScan (FcFontSet	    *set,
544
	   FcStrSet	    *dirs,
545
546
547
548
549
	   FcFileCache	    *cache,
	   FcBlanks	    *blanks,
	   const FcChar8    *dir,
	   FcBool	    force);

550
FcPublic FcBool
Patrick Lam's avatar
:  
Patrick Lam committed
551
FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
552

553
554
FcPublic FcCache *
FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
555
556
557

FcPublic FcCache *
FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
558
559
560
561
562
563
564
565
566
567
    
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
568
/* fcfreetype.c */
569
FcPublic FcPattern *
570
FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
Keith Packard's avatar
Keith Packard committed
571
572
573

/* fcfs.c */

574
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
575
576
FcFontSetCreate (void);

577
FcPublic void
Keith Packard's avatar
Keith Packard committed
578
579
FcFontSetDestroy (FcFontSet *s);

580
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
581
582
583
FcFontSetAdd (FcFontSet *s, FcPattern *font);

/* fcinit.c */
584
FcPublic FcConfig *
585
586
FcInitLoadConfig (void);

587
FcPublic FcConfig *
588
589
FcInitLoadConfigAndFonts (void);

590
FcPublic FcBool
591
FcInit (void);
Keith Packard's avatar
Keith Packard committed
592

593
FcPublic void
594
595
FcFini (void);

596
FcPublic int
597
598
FcGetVersion (void);

599
FcPublic FcBool
600
FcInitReinitialize (void);
Keith Packard's avatar
Keith Packard committed
601

602
FcPublic FcBool
603
FcInitBringUptoDate (void);
Keith Packard's avatar
Keith Packard committed
604

605
/* fclang.c */
606
FcPublic FcStrSet *
607
608
FcGetLangs (void);

609
610
611
FcPublic FcChar8 *
FcLangNormalize (const FcChar8 *lang);

612
613
614
FcPublic const FcCharSet *
FcLangGetCharSet (const FcChar8 *lang);

615
FcPublic FcLangSet*
616
617
FcLangSetCreate (void);

618
FcPublic void
619
620
FcLangSetDestroy (FcLangSet *ls);

621
FcPublic FcLangSet*
622
623
FcLangSetCopy (const FcLangSet *ls);

624
FcPublic FcBool
625
626
FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);

Akira TAGOH's avatar
Akira TAGOH committed
627
628
629
FcPublic FcBool
FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);

630
FcPublic FcLangResult
631
632
FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);

633
FcPublic FcLangResult
634
635
FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);

636
FcPublic FcBool
637
638
FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);

639
FcPublic FcBool
640
641
FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);

642
FcPublic FcChar32
643
644
FcLangSetHash (const FcLangSet *ls);

645
646
647
FcPublic FcStrSet *
FcLangSetGetLangs (const FcLangSet *ls);

648
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
649
650
FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);

651
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
652
653
FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);

Keith Packard's avatar
Keith Packard committed
654
/* fclist.c */
655
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
656
657
FcObjectSetCreate (void);

658
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
659
660
FcObjectSetAdd (FcObjectSet *os, const char *object);

661
FcPublic void
Keith Packard's avatar
Keith Packard committed
662
663
FcObjectSetDestroy (FcObjectSet *os);

664
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
665
666
FcObjectSetVaBuild (const char *first, va_list va);

667
FcPublic FcObjectSet *
668
FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
Keith Packard's avatar
Keith Packard committed
669

670
FcPublic FcFontSet *
671
672
673
674
675
676
FcFontSetList (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcObjectSet  *os);

677
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
678
679
680
681
FcFontList (FcConfig	*config,
	    FcPattern	*p,
	    FcObjectSet *os);

682
683
/* fcatomic.c */

684
FcPublic FcAtomic *
685
686
FcAtomicCreate (const FcChar8   *file);

687
FcPublic FcBool
688
689
FcAtomicLock (FcAtomic *atomic);

690
FcPublic FcChar8 *
691
692
FcAtomicNewFile (FcAtomic *atomic);

693
FcPublic FcChar8 *
694
695
FcAtomicOrigFile (FcAtomic *atomic);

696
FcPublic FcBool
697
698
FcAtomicReplaceOrig (FcAtomic *atomic);

699
FcPublic void
700
701
FcAtomicDeleteNew (FcAtomic *atomic);

702
FcPublic void
703
704
FcAtomicUnlock (FcAtomic *atomic);

705
FcPublic void
706
707
FcAtomicDestroy (FcAtomic *atomic);

Keith Packard's avatar
Keith Packard committed
708
/* fcmatch.c */
709
FcPublic FcPattern *
710
711
712
713
714
715
FcFontSetMatch (FcConfig    *config,
		FcFontSet   **sets,
		int	    nsets,
		FcPattern   *p,
		FcResult    *result);

716
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
717
718
719
720
FcFontMatch (FcConfig	*config,
	     FcPattern	*p, 
	     FcResult	*result);

721
FcPublic FcPattern *
722
723
724
725
FcFontRenderPrepare (FcConfig	    *config,
		     FcPattern	    *pat,
		     FcPattern	    *font);

726
FcPublic FcFontSet *
727
728
729
730
731
732
733
734
FcFontSetSort (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcBool	    trim,
	       FcCharSet    **csp,
	       FcResult	    *result);

735
FcPublic FcFontSet *
736
737
738
739
740
741
FcFontSort (FcConfig	 *config,
	    FcPattern    *p,
	    FcBool	 trim,
	    FcCharSet    **csp,
	    FcResult	 *result);

742
FcPublic void
743
744
FcFontSetSortDestroy (FcFontSet *fs);

Keith Packard's avatar
Keith Packard committed
745
/* fcmatrix.c */
746
FcPublic FcMatrix *
Keith Packard's avatar
Keith Packard committed
747
748
FcMatrixCopy (const FcMatrix *mat);

749
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
750
751
FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);

752
FcPublic void
Keith Packard's avatar
Keith Packard committed
753
754
FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);

755
FcPublic void
Keith Packard's avatar
Keith Packard committed
756
757
FcMatrixRotate (FcMatrix *m, double c, double s);

758
FcPublic void
Keith Packard's avatar
Keith Packard committed
759
760
FcMatrixScale (FcMatrix *m, double sx, double sy);

761
FcPublic void
Keith Packard's avatar
Keith Packard committed
762
763
764
765
FcMatrixShear (FcMatrix *m, double sh, double sv);

/* fcname.c */

766
/* Deprecated.  Does nothing.  Returns FcFalse. */
767
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
768
769
FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);

770
/* Deprecated.  Does nothing.  Returns FcFalse. */
771
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
772
FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
773

774
FcPublic const FcObjectType *
Keith Packard's avatar
Keith Packard committed
775
776
FcNameGetObjectType (const char *object);

777
/* Deprecated.  Does nothing.  Returns FcFalse. */
778
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
779
780
FcNameRegisterConstants (const FcConstant *consts, int nconsts);

781
/* Deprecated.  Does nothing.  Returns FcFalse. */
782
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
783
FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
784

785
FcPublic const FcConstant *
786
FcNameGetConstant (const FcChar8 *string);
Keith Packard's avatar
Keith Packard committed
787

788
FcPublic FcBool
789
FcNameConstant (const FcChar8 *string, int *result);
Keith Packard's avatar
Keith Packard committed
790

791
FcPublic FcPattern *
792
FcNameParse (const FcChar8 *name);
Keith Packard's avatar
Keith Packard committed
793

794
FcPublic FcChar8 *
Keith Packard's avatar
Keith Packard committed
795
796
797
FcNameUnparse (FcPattern *pat);

/* fcpat.c */
798
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
799
800
FcPatternCreate (void);

801
FcPublic FcPattern *
802
FcPatternDuplicate (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
803

804
FcPublic void
805
806
FcPatternReference (FcPattern *p);

807
808
809
FcPublic FcPattern *
FcPatternFilter (FcPattern *p, const FcObjectSet *os);

810
FcPublic void
Keith Packard's avatar
Keith Packard committed
811
812
FcValueDestroy (FcValue v);

813
FcPublic FcBool
814
815
FcValueEqual (FcValue va, FcValue vb);

816
FcPublic FcValue
Keith Packard's avatar
Keith Packard committed
817
818
FcValueSave (FcValue v);

819
FcPublic void
Keith Packard's avatar
Keith Packard committed
820
821
FcPatternDestroy (FcPattern *p);

822
FcPublic FcBool
823
824
FcPatternEqual (const FcPattern *pa, const FcPattern *pb);

825
FcPublic FcBool
826
FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
827

828
FcPublic FcChar32
829
830
FcPatternHash (const FcPattern *p);

831
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
832
833
FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
    
834
FcPublic FcBool
835
836
FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
    
837
FcPublic FcResult
838
FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
Keith Packard's avatar
Keith Packard committed
839
    
840
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
841
842
FcPatternDel (FcPattern *p, const char *object);

843
FcPublic FcBool
844
845
FcPatternRemove (FcPattern *p, const char *object, int id);

846
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
847
848
FcPatternAddInteger (FcPattern *p, const char *object, int i);

849
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
850
851
FcPatternAddDouble (FcPattern *p, const char *object, double d);

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

855
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
856
857
FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);

858
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
859
860
FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);

861
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
862
863
FcPatternAddBool (FcPattern *p, const char *object, FcBool b);

864
FcPublic FcBool
865
866
FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);

867
868
869
FcPublic FcBool
FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);

870
FcPublic FcResult
871
FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
Keith Packard's avatar
Keith Packard committed
872

873
FcPublic FcResult
874
FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
Keith Packard's avatar
Keith Packard committed
875

876
FcPublic FcResult
877
FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
Keith Packard's avatar
Keith Packard committed
878

879
FcPublic FcResult
880
FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
Keith Packard's avatar
Keith Packard committed
881

882
FcPublic FcResult
883
FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
Keith Packard's avatar
Keith Packard committed
884

885
FcPublic FcResult
886
FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
Keith Packard's avatar
Keith Packard committed
887

888
FcPublic FcResult
889
FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
890

891
892
893
FcPublic FcResult
FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);