fontconfig.h 24.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	1
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    "4"
70

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

121
122
123
#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
124
125
126
127
128
129

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

130
131
132
133
#define FC_WEIGHT_THIN		    0
#define FC_WEIGHT_EXTRALIGHT	    40
#define FC_WEIGHT_ULTRALIGHT	    FC_WEIGHT_EXTRALIGHT
#define FC_WEIGHT_LIGHT		    50
134
#define FC_WEIGHT_BOOK		    75
135
136
137
138
139
140
141
#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
142
#define FC_WEIGHT_ULTRABOLD	    FC_WEIGHT_EXTRABOLD
143
#define FC_WEIGHT_BLACK		    210
144
#define FC_WEIGHT_HEAVY		    FC_WEIGHT_BLACK
Keith Packard's avatar
Keith Packard committed
145
146
#define FC_WEIGHT_EXTRABLACK	    215
#define FC_WEIGHT_ULTRABLACK	    FC_WEIGHT_EXTRABLACK
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

#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
163
#define FC_DUAL			    90
164
165
#define FC_MONO			    100
#define FC_CHARCELL		    110
Keith Packard's avatar
Keith Packard committed
166
167

/* sub-pixel order */
Keith Packard's avatar
Keith Packard committed
168
#define FC_RGBA_UNKNOWN	    0
Keith Packard's avatar
Keith Packard committed
169
170
171
172
#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
173
#define FC_RGBA_NONE	    5
Keith Packard's avatar
Keith Packard committed
174

175
176
177
178
179
/* hinting style */
#define FC_HINT_NONE        0
#define FC_HINT_SLIGHT      1
#define FC_HINT_MEDIUM      2
#define FC_HINT_FULL        3
180
181
182
183
184
185
186

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

typedef struct _FcConstant {
220
    const FcChar8  *name;
Keith Packard's avatar
Keith Packard committed
221
222
223
224
225
    const char	*object;
    int		value;
} FcConstant;

typedef enum _FcResult {
226
    FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
227
    FcResultOutOfMemory
Keith Packard's avatar
Keith Packard committed
228
229
} FcResult;

230
231
typedef struct _FcPattern   FcPattern;

232
233
typedef struct _FcLangSet   FcLangSet;

Keith Packard's avatar
Keith Packard committed
234
235
236
typedef struct _FcValue {
    FcType	type;
    union {
237
	const FcChar8	*s;
Keith Packard's avatar
Keith Packard committed
238
239
240
	int		i;
	FcBool		b;
	double		d;
241
242
	const FcMatrix	*m;
	const FcCharSet	*c;
243
	void		*f;
244
	const FcLangSet	*l;
Keith Packard's avatar
Keith Packard committed
245
246
247
248
249
250
251
252
253
254
255
256
    } u;
} FcValue;

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

typedef struct _FcObjectSet {
    int		nobject;
    int		sobject;
257
    const char	**objects;
Keith Packard's avatar
Keith Packard committed
258
259
260
} FcObjectSet;
    
typedef enum _FcMatchKind {
261
    FcMatchPattern, FcMatchFont, FcMatchScan
Keith Packard's avatar
Keith Packard committed
262
263
} FcMatchKind;

264
typedef enum _FcLangResult {
265
266
267
268
    FcLangEqual = 0,
    FcLangDifferentCountry = 1,
    FcLangDifferentTerritory = 1,
    FcLangDifferentLang = 2
269
270
} FcLangResult;

Keith Packard's avatar
Keith Packard committed
271
272
273
274
275
typedef enum _FcSetName {
    FcSetSystem = 0,
    FcSetApplication = 1
} FcSetName;

276
277
typedef struct _FcAtomic FcAtomic;

Keith Packard's avatar
Keith Packard committed
278
279
280
281
282
283
284
285
#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

286
287
typedef enum { FcEndianBig, FcEndianLittle } FcEndian;

Keith Packard's avatar
Keith Packard committed
288
289
typedef struct _FcConfig    FcConfig;

290
typedef struct _FcGlobalCache	FcFileCache;
Keith Packard's avatar
Keith Packard committed
291
292
293

typedef struct _FcBlanks    FcBlanks;

294
295
296
297
typedef struct _FcStrList   FcStrList;

typedef struct _FcStrSet    FcStrSet;

298
typedef struct _FcCache	    FcCache;
Keith Packard's avatar
Keith Packard committed
299

300
_FCFUNCPROTOBEGIN
301

Keith Packard's avatar
Keith Packard committed
302
/* fcblanks.c */
303
FcPublic FcBlanks *
Keith Packard's avatar
Keith Packard committed
304
305
FcBlanksCreate (void);

306
FcPublic void
Keith Packard's avatar
Keith Packard committed
307
308
FcBlanksDestroy (FcBlanks *b);

309
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
310
311
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);

312
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
313
314
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);

315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
/* 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);

332
FcPublic FcBool
333
334
335
336
337
FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);

FcPublic FcBool
FcDirCacheValid (const FcChar8 *cache_file);

338
339
340
FcPublic FcBool
FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);

341
342
343
FcPublic void
FcCacheCreateTagFile (const FcConfig *config);

Keith Packard's avatar
Keith Packard committed
344
/* fccfg.c */
345
FcPublic FcChar8 *
346
347
FcConfigHome (void);

348
FcPublic FcBool
349
350
FcConfigEnableHome (FcBool enable);

351
FcPublic FcChar8 *
352
FcConfigFilename (const FcChar8 *url);
Keith Packard's avatar
Keith Packard committed
353
    
354
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
355
356
FcConfigCreate (void);

357
358
359
FcPublic FcConfig *
FcConfigReference (FcConfig *config);

360
FcPublic void
Keith Packard's avatar
Keith Packard committed
361
362
FcConfigDestroy (FcConfig *config);

363
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
364
365
FcConfigSetCurrent (FcConfig *config);

366
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
367
368
FcConfigGetCurrent (void);

369
FcPublic FcBool
370
371
FcConfigUptoDate (FcConfig *config);
    
372
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
373
374
FcConfigBuildFonts (FcConfig *config);

375
FcPublic FcStrList *
376
377
FcConfigGetFontDirs (FcConfig   *config);

378
FcPublic FcStrList *
379
FcConfigGetConfigDirs (FcConfig   *config);
Keith Packard's avatar
Keith Packard committed
380

381
FcPublic FcStrList *
Keith Packard's avatar
Keith Packard committed
382
383
FcConfigGetConfigFiles (FcConfig    *config);

384
FcPublic FcChar8 *
Keith Packard's avatar
Keith Packard committed
385
386
FcConfigGetCache (FcConfig  *config);

387
FcPublic FcBlanks *
Keith Packard's avatar
Keith Packard committed
388
389
FcConfigGetBlanks (FcConfig *config);

390
FcPublic FcStrList *
391
FcConfigGetCacheDirs (const FcConfig	*config);
392
393

FcPublic int
394
FcConfigGetRescanInterval (FcConfig *config);
395

396
FcPublic FcBool
397
FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
398

399
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
400
401
402
FcConfigGetFonts (FcConfig	*config,
		  FcSetName	set);

403
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
404
FcConfigAppFontAddFile (FcConfig    *config,
405
			const FcChar8  *file);
Keith Packard's avatar
Keith Packard committed
406

407
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
408
FcConfigAppFontAddDir (FcConfig	    *config,
409
		       const FcChar8   *dir);
Keith Packard's avatar
Keith Packard committed
410

411
FcPublic void
Keith Packard's avatar
Keith Packard committed
412
413
FcConfigAppFontClear (FcConfig	    *config);

414
FcPublic FcBool
415
416
417
418
419
FcConfigSubstituteWithPat (FcConfig	*config,
			   FcPattern	*p,
			   FcPattern	*p_pat,
			   FcMatchKind	kind);

420
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
421
422
423
424
FcConfigSubstitute (FcConfig	*config,
		    FcPattern	*p,
		    FcMatchKind	kind);

425
426
427
428
429
430
431
FcPublic const FcChar8 *
FcConfigGetSysRoot (const FcConfig *config);

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

Keith Packard's avatar
Keith Packard committed
432
/* fccharset.c */
433
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
434
435
FcCharSetCreate (void);

436
437
438
/* deprecated alias for FcCharSetCreate */
FcPublic FcCharSet *
FcCharSetNew (void);
439

440
FcPublic void
Keith Packard's avatar
Keith Packard committed
441
442
FcCharSetDestroy (FcCharSet *fcs);

443
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
444
445
FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);

446
447
448
FcPublic FcBool
FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);

449
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
450
451
FcCharSetCopy (FcCharSet *src);

452
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
453
454
FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);

455
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
456
457
FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);

458
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
459
460
FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);

461
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
462
463
FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);

Karl Tomlinson's avatar
Karl Tomlinson committed
464
465
FcPublic FcBool
FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
Behdad Esfahbod's avatar
Behdad Esfahbod committed
466

467
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
468
469
FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);

470
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
471
472
FcCharSetCount (const FcCharSet *a);

473
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
474
475
FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);

476
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
477
478
FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);

479
FcPublic FcBool
480
481
FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);

482
483
484
#define FC_CHARSET_MAP_SIZE (256/32)
#define FC_CHARSET_DONE	((FcChar32) -1)

485
FcPublic FcChar32
486
487
488
489
FcCharSetFirstPage (const FcCharSet *a, 
		    FcChar32	    map[FC_CHARSET_MAP_SIZE],
		    FcChar32	    *next);

490
FcPublic FcChar32
491
492
493
494
FcCharSetNextPage (const FcCharSet  *a, 
		   FcChar32	    map[FC_CHARSET_MAP_SIZE],
		   FcChar32	    *next);

495
496
497
498
499
500
/*
 * old coverage API, rather hard to use correctly
 */

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

Keith Packard's avatar
Keith Packard committed
502
/* fcdbg.c */
503
FcPublic void
504
FcValuePrint (const FcValue v);
Keith Packard's avatar
Keith Packard committed
505

506
FcPublic void
507
FcPatternPrint (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
508

509
FcPublic void
510
FcFontSetPrint (const FcFontSet *s);
Keith Packard's avatar
Keith Packard committed
511

Keith Packard's avatar
Keith Packard committed
512
/* fcdefault.c */
513
514
515
FcPublic FcStrSet *
FcGetDefaultLangs (void);

516
FcPublic void
Keith Packard's avatar
Keith Packard committed
517
518
519
FcDefaultSubstitute (FcPattern *pattern);

/* fcdir.c */
520
521
522
523
FcPublic FcBool
FcFileIsDir (const FcChar8 *file);

FcPublic FcBool
524
FcFileScan (FcFontSet	    *set,
525
	    FcStrSet	    *dirs,
526
527
528
529
	    FcFileCache	    *cache,
	    FcBlanks	    *blanks,
	    const FcChar8   *file,
	    FcBool	    force);
Keith Packard's avatar
Keith Packard committed
530

531
FcPublic FcBool
532
FcDirScan (FcFontSet	    *set,
533
	   FcStrSet	    *dirs,
534
535
536
537
538
	   FcFileCache	    *cache,
	   FcBlanks	    *blanks,
	   const FcChar8    *dir,
	   FcBool	    force);

539
FcPublic FcBool
Patrick Lam's avatar
:  
Patrick Lam committed
540
FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
541

542
543
FcPublic FcCache *
FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
544
545
546

FcPublic FcCache *
FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
547
548
549
550
551
552
553
554
555
556
    
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
557
/* fcfreetype.c */
558
FcPublic FcPattern *
559
FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
Keith Packard's avatar
Keith Packard committed
560
561
562

/* fcfs.c */

563
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
564
565
FcFontSetCreate (void);

566
FcPublic void
Keith Packard's avatar
Keith Packard committed
567
568
FcFontSetDestroy (FcFontSet *s);

569
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
570
571
572
FcFontSetAdd (FcFontSet *s, FcPattern *font);

/* fcinit.c */
573
FcPublic FcConfig *
574
575
FcInitLoadConfig (void);

576
FcPublic FcConfig *
577
578
FcInitLoadConfigAndFonts (void);

579
FcPublic FcBool
580
FcInit (void);
Keith Packard's avatar
Keith Packard committed
581

582
FcPublic void
583
584
FcFini (void);

585
FcPublic int
586
587
FcGetVersion (void);

588
FcPublic FcBool
589
FcInitReinitialize (void);
Keith Packard's avatar
Keith Packard committed
590

591
FcPublic FcBool
592
FcInitBringUptoDate (void);
Keith Packard's avatar
Keith Packard committed
593

594
/* fclang.c */
595
FcPublic FcStrSet *
596
597
FcGetLangs (void);

598
599
600
FcPublic FcChar8 *
FcLangNormalize (const FcChar8 *lang);

601
602
603
FcPublic const FcCharSet *
FcLangGetCharSet (const FcChar8 *lang);

604
FcPublic FcLangSet*
605
606
FcLangSetCreate (void);

607
FcPublic void
608
609
FcLangSetDestroy (FcLangSet *ls);

610
FcPublic FcLangSet*
611
612
FcLangSetCopy (const FcLangSet *ls);

613
FcPublic FcBool
614
615
FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);

Akira TAGOH's avatar
Akira TAGOH committed
616
617
618
FcPublic FcBool
FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);

619
FcPublic FcLangResult
620
621
FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);

622
FcPublic FcLangResult
623
624
FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);

625
FcPublic FcBool
626
627
FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);

628
FcPublic FcBool
629
630
FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);

631
FcPublic FcChar32
632
633
FcLangSetHash (const FcLangSet *ls);

634
635
636
FcPublic FcStrSet *
FcLangSetGetLangs (const FcLangSet *ls);

637
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
638
639
FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);

640
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
641
642
FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);

Keith Packard's avatar
Keith Packard committed
643
/* fclist.c */
644
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
645
646
FcObjectSetCreate (void);

647
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
648
649
FcObjectSetAdd (FcObjectSet *os, const char *object);

650
FcPublic void
Keith Packard's avatar
Keith Packard committed
651
652
FcObjectSetDestroy (FcObjectSet *os);

653
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
654
655
FcObjectSetVaBuild (const char *first, va_list va);

656
FcPublic FcObjectSet *
657
FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
Keith Packard's avatar
Keith Packard committed
658

659
FcPublic FcFontSet *
660
661
662
663
664
665
FcFontSetList (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcObjectSet  *os);

666
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
667
668
669
670
FcFontList (FcConfig	*config,
	    FcPattern	*p,
	    FcObjectSet *os);

671
672
/* fcatomic.c */

673
FcPublic FcAtomic *
674
675
FcAtomicCreate (const FcChar8   *file);

676
FcPublic FcBool
677
678
FcAtomicLock (FcAtomic *atomic);

679
FcPublic FcChar8 *
680
681
FcAtomicNewFile (FcAtomic *atomic);

682
FcPublic FcChar8 *
683
684
FcAtomicOrigFile (FcAtomic *atomic);

685
FcPublic FcBool
686
687
FcAtomicReplaceOrig (FcAtomic *atomic);

688
FcPublic void
689
690
FcAtomicDeleteNew (FcAtomic *atomic);

691
FcPublic void
692
693
FcAtomicUnlock (FcAtomic *atomic);

694
FcPublic void
695
696
FcAtomicDestroy (FcAtomic *atomic);

Keith Packard's avatar
Keith Packard committed
697
/* fcmatch.c */
698
FcPublic FcPattern *
699
700
701
702
703
704
FcFontSetMatch (FcConfig    *config,
		FcFontSet   **sets,
		int	    nsets,
		FcPattern   *p,
		FcResult    *result);

705
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
706
707
708
709
FcFontMatch (FcConfig	*config,
	     FcPattern	*p, 
	     FcResult	*result);

710
FcPublic FcPattern *
711
712
713
714
FcFontRenderPrepare (FcConfig	    *config,
		     FcPattern	    *pat,
		     FcPattern	    *font);

715
FcPublic FcFontSet *
716
717
718
719
720
721
722
723
FcFontSetSort (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcBool	    trim,
	       FcCharSet    **csp,
	       FcResult	    *result);

724
FcPublic FcFontSet *
725
726
727
728
729
730
FcFontSort (FcConfig	 *config,
	    FcPattern    *p,
	    FcBool	 trim,
	    FcCharSet    **csp,
	    FcResult	 *result);

731
FcPublic void
732
733
FcFontSetSortDestroy (FcFontSet *fs);

Keith Packard's avatar
Keith Packard committed
734
/* fcmatrix.c */
735
FcPublic FcMatrix *
Keith Packard's avatar
Keith Packard committed
736
737
FcMatrixCopy (const FcMatrix *mat);

738
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
739
740
FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);

741
FcPublic void
Keith Packard's avatar
Keith Packard committed
742
743
FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);

744
FcPublic void
Keith Packard's avatar
Keith Packard committed
745
746
FcMatrixRotate (FcMatrix *m, double c, double s);

747
FcPublic void
Keith Packard's avatar
Keith Packard committed
748
749
FcMatrixScale (FcMatrix *m, double sx, double sy);

750
FcPublic void
Keith Packard's avatar
Keith Packard committed
751
752
753
754
FcMatrixShear (FcMatrix *m, double sh, double sv);

/* fcname.c */

755
/* Deprecated.  Does nothing.  Returns FcFalse. */
756
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
757
758
FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);

759
/* Deprecated.  Does nothing.  Returns FcFalse. */
760
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
761
FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
762

763
FcPublic const FcObjectType *
Keith Packard's avatar
Keith Packard committed
764
765
FcNameGetObjectType (const char *object);

766
/* Deprecated.  Does nothing.  Returns FcFalse. */
767
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
768
769
FcNameRegisterConstants (const FcConstant *consts, int nconsts);

770
/* Deprecated.  Does nothing.  Returns FcFalse. */
771
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
772
FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
773

774
FcPublic const FcConstant *
775
FcNameGetConstant (const FcChar8 *string);
Keith Packard's avatar
Keith Packard committed
776

777
FcPublic FcBool
778
FcNameConstant (const FcChar8 *string, int *result);
Keith Packard's avatar
Keith Packard committed
779

780
FcPublic FcPattern *
781
FcNameParse (const FcChar8 *name);
Keith Packard's avatar
Keith Packard committed
782

783
FcPublic FcChar8 *
Keith Packard's avatar
Keith Packard committed
784
785
786
FcNameUnparse (FcPattern *pat);

/* fcpat.c */
787
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
788
789
FcPatternCreate (void);

790
FcPublic FcPattern *
791
FcPatternDuplicate (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
792

793
FcPublic void
794
795
FcPatternReference (FcPattern *p);

796
797
798
FcPublic FcPattern *
FcPatternFilter (FcPattern *p, const FcObjectSet *os);

799
FcPublic void
Keith Packard's avatar
Keith Packard committed
800
801
FcValueDestroy (FcValue v);

802
FcPublic FcBool
803
804
FcValueEqual (FcValue va, FcValue vb);

805
FcPublic FcValue
Keith Packard's avatar
Keith Packard committed
806
807
FcValueSave (FcValue v);

808
FcPublic void
Keith Packard's avatar
Keith Packard committed
809
810
FcPatternDestroy (FcPattern *p);

811
FcPublic FcBool
812
813
FcPatternEqual (const FcPattern *pa, const FcPattern *pb);

814
FcPublic FcBool
815
FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
816

817
FcPublic FcChar32
818
819
FcPatternHash (const FcPattern *p);

820
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
821
822
FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
    
823
FcPublic FcBool
824
825
FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
    
826
FcPublic FcResult
827
FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
Keith Packard's avatar
Keith Packard committed
828
    
829
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
830
831
FcPatternDel (FcPattern *p, const char *object);

832
FcPublic FcBool
833
834
FcPatternRemove (FcPattern *p, const char *object, int id);

835
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
836
837
FcPatternAddInteger (FcPattern *p, const char *object, int i);

838
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
839
840
FcPatternAddDouble (FcPattern *p, const char *object, double d);

841
FcPublic FcBool
842
FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
Keith Packard's avatar
Keith Packard committed
843

844
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
845
846
FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);

847
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
848
849
FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);

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

853
FcPublic FcBool
854
855
FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);

856
FcPublic FcResult
857
FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
Keith Packard's avatar
Keith Packard committed
858

859
FcPublic FcResult
860
FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
Keith Packard's avatar
Keith Packard committed
861

862
FcPublic FcResult
863
FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
Keith Packard's avatar
Keith Packard committed
864

865
FcPublic FcResult
866
FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
Keith Packard's avatar
Keith Packard committed
867

868
FcPublic FcResult
869
FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
Keith Packard's avatar
Keith Packard committed
870

871
FcPublic FcResult
872
FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
Keith Packard's avatar
Keith Packard committed
873

874
FcPublic FcResult
875
FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
876

877
FcPublic FcPattern *
878
FcPatternVaBuild (FcPattern *p, va_list va);
Keith Packard's avatar
Keith Packard committed
879
    
880
FcPublic FcPattern *
881
FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
Keith Packard's avatar
Keith Packard committed
882

883
884
885
FcPublic FcChar8 *
FcPatternFormat (FcPattern *pat, const FcChar8 *format);

Keith Packard's avatar
Keith Packard committed
886
887
/* fcstr.c */

888
FcPublic FcChar8 *
889
FcStrCopy (const FcChar8 *s);
Keith Packard's avatar
Keith Packard committed
890

891
FcPublic FcChar8 *
892
893
FcStrCopyFilename (const FcChar8 *s);
    
894
895
896
897
898
899
FcPublic FcChar8 *
FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
    
FcPublic void
FcStrFree (FcChar8 *s);

900
901
902