fontconfig.h 23.5 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	10
Akira TAGOH's avatar
Akira TAGOH committed
55
#define FC_REVISION	2
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.
 */

69
#define FC_CACHE_VERSION    "3"
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 */
Keith Packard's avatar
Keith Packard committed
94
95
96
97
98
99
100
#define FC_RASTERIZER	    "rasterizer"	/* String */
#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_NAMELANG	    "namelang"		/* String RFC 3866 langs */
Keith Packard's avatar
Keith Packard committed
116

117
118
119
#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
120
121
122
123
124
125

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

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

#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
159
#define FC_DUAL			    90
160
161
#define FC_MONO			    100
#define FC_CHARCELL		    110
Keith Packard's avatar
Keith Packard committed
162
163

/* sub-pixel order */
Keith Packard's avatar
Keith Packard committed
164
#define FC_RGBA_UNKNOWN	    0
Keith Packard's avatar
Keith Packard committed
165
166
167
168
#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
169
#define FC_RGBA_NONE	    5
Keith Packard's avatar
Keith Packard committed
170

171
172
173
174
175
/* hinting style */
#define FC_HINT_NONE        0
#define FC_HINT_SLIGHT      1
#define FC_HINT_MEDIUM      2
#define FC_HINT_FULL        3
176
177
178
179
180
181
182

/* 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
183
184
185
186
187
188
189
typedef enum _FcType {
    FcTypeVoid, 
    FcTypeInteger, 
    FcTypeDouble, 
    FcTypeString, 
    FcTypeBool,
    FcTypeMatrix,
190
    FcTypeCharSet,
191
192
    FcTypeFTFace,
    FcTypeLangSet
Keith Packard's avatar
Keith Packard committed
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
} 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 {
215
    const FcChar8  *name;
Keith Packard's avatar
Keith Packard committed
216
217
218
219
220
    const char	*object;
    int		value;
} FcConstant;

typedef enum _FcResult {
221
    FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
222
    FcResultOutOfMemory
Keith Packard's avatar
Keith Packard committed
223
224
} FcResult;

225
226
typedef struct _FcPattern   FcPattern;

227
228
typedef struct _FcLangSet   FcLangSet;

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

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

typedef struct _FcObjectSet {
    int		nobject;
    int		sobject;
252
    const char	**objects;
Keith Packard's avatar
Keith Packard committed
253
254
255
} FcObjectSet;
    
typedef enum _FcMatchKind {
256
    FcMatchPattern, FcMatchFont, FcMatchScan
Keith Packard's avatar
Keith Packard committed
257
258
} FcMatchKind;

259
typedef enum _FcLangResult {
260
261
262
263
    FcLangEqual = 0,
    FcLangDifferentCountry = 1,
    FcLangDifferentTerritory = 1,
    FcLangDifferentLang = 2
264
265
} FcLangResult;

Keith Packard's avatar
Keith Packard committed
266
267
268
269
270
typedef enum _FcSetName {
    FcSetSystem = 0,
    FcSetApplication = 1
} FcSetName;

271
272
typedef struct _FcAtomic FcAtomic;

Keith Packard's avatar
Keith Packard committed
273
274
275
276
277
278
279
280
#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

281
282
typedef enum { FcEndianBig, FcEndianLittle } FcEndian;

Keith Packard's avatar
Keith Packard committed
283
284
typedef struct _FcConfig    FcConfig;

285
typedef struct _FcGlobalCache	FcFileCache;
Keith Packard's avatar
Keith Packard committed
286
287
288

typedef struct _FcBlanks    FcBlanks;

289
290
291
292
typedef struct _FcStrList   FcStrList;

typedef struct _FcStrSet    FcStrSet;

293
typedef struct _FcCache	    FcCache;
Keith Packard's avatar
Keith Packard committed
294

295
_FCFUNCPROTOBEGIN
296

Keith Packard's avatar
Keith Packard committed
297
/* fcblanks.c */
298
FcPublic FcBlanks *
Keith Packard's avatar
Keith Packard committed
299
300
FcBlanksCreate (void);

301
FcPublic void
Keith Packard's avatar
Keith Packard committed
302
303
FcBlanksDestroy (FcBlanks *b);

304
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
305
306
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);

307
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
308
309
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);

310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
/* 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);

327
FcPublic FcBool
328
329
330
331
332
FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);

FcPublic FcBool
FcDirCacheValid (const FcChar8 *cache_file);

333
334
335
FcPublic FcBool
FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);

336
337
338
FcPublic void
FcCacheCreateTagFile (const FcConfig *config);

Keith Packard's avatar
Keith Packard committed
339
/* fccfg.c */
340
FcPublic FcChar8 *
341
342
FcConfigHome (void);

343
FcPublic FcBool
344
345
FcConfigEnableHome (FcBool enable);

346
FcPublic FcChar8 *
347
FcConfigFilename (const FcChar8 *url);
Keith Packard's avatar
Keith Packard committed
348
    
349
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
350
351
FcConfigCreate (void);

352
353
354
FcPublic FcConfig *
FcConfigReference (FcConfig *config);

355
FcPublic void
Keith Packard's avatar
Keith Packard committed
356
357
FcConfigDestroy (FcConfig *config);

358
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
359
360
FcConfigSetCurrent (FcConfig *config);

361
FcPublic FcConfig *
Keith Packard's avatar
Keith Packard committed
362
363
FcConfigGetCurrent (void);

364
FcPublic FcBool
365
366
FcConfigUptoDate (FcConfig *config);
    
367
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
368
369
FcConfigBuildFonts (FcConfig *config);

370
FcPublic FcStrList *
371
372
FcConfigGetFontDirs (FcConfig   *config);

373
FcPublic FcStrList *
374
FcConfigGetConfigDirs (FcConfig   *config);
Keith Packard's avatar
Keith Packard committed
375

376
FcPublic FcStrList *
Keith Packard's avatar
Keith Packard committed
377
378
FcConfigGetConfigFiles (FcConfig    *config);

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

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

385
FcPublic FcStrList *
386
FcConfigGetCacheDirs (const FcConfig	*config);
387
388

FcPublic int
389
FcConfigGetRescanInterval (FcConfig *config);
390

391
FcPublic FcBool
392
FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
393

394
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
395
396
397
FcConfigGetFonts (FcConfig	*config,
		  FcSetName	set);

398
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
399
FcConfigAppFontAddFile (FcConfig    *config,
400
			const FcChar8  *file);
Keith Packard's avatar
Keith Packard committed
401

402
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
403
FcConfigAppFontAddDir (FcConfig	    *config,
404
		       const FcChar8   *dir);
Keith Packard's avatar
Keith Packard committed
405

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

409
FcPublic FcBool
410
411
412
413
414
FcConfigSubstituteWithPat (FcConfig	*config,
			   FcPattern	*p,
			   FcPattern	*p_pat,
			   FcMatchKind	kind);

415
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
416
417
418
419
420
FcConfigSubstitute (FcConfig	*config,
		    FcPattern	*p,
		    FcMatchKind	kind);

/* fccharset.c */
421
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
422
423
FcCharSetCreate (void);

424
425
426
427
428
/* deprecated alias for FcCharSetCreate */
FcPublic FcCharSet *
FcCharSetNew (void);
    
FcPublic void
Keith Packard's avatar
Keith Packard committed
429
430
FcCharSetDestroy (FcCharSet *fcs);

431
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
432
433
FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);

434
435
436
FcPublic FcBool
FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);

437
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
438
439
FcCharSetCopy (FcCharSet *src);

440
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
441
442
FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);

443
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
444
445
FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);

446
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
447
448
FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);

449
FcPublic FcCharSet*
Keith Packard's avatar
Keith Packard committed
450
451
FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);

Karl Tomlinson's avatar
Karl Tomlinson committed
452
453
FcPublic FcBool
FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
Behdad Esfahbod's avatar
Behdad Esfahbod committed
454

455
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
456
457
FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);

458
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
459
460
FcCharSetCount (const FcCharSet *a);

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

464
FcPublic FcChar32
Keith Packard's avatar
Keith Packard committed
465
466
FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);

467
FcPublic FcBool
468
469
FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);

470
471
472
#define FC_CHARSET_MAP_SIZE (256/32)
#define FC_CHARSET_DONE	((FcChar32) -1)

473
FcPublic FcChar32
474
475
476
477
FcCharSetFirstPage (const FcCharSet *a, 
		    FcChar32	    map[FC_CHARSET_MAP_SIZE],
		    FcChar32	    *next);

478
FcPublic FcChar32
479
480
481
482
FcCharSetNextPage (const FcCharSet  *a, 
		   FcChar32	    map[FC_CHARSET_MAP_SIZE],
		   FcChar32	    *next);

483
484
485
486
487
488
/*
 * old coverage API, rather hard to use correctly
 */

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

Keith Packard's avatar
Keith Packard committed
490
/* fcdbg.c */
491
FcPublic void
492
FcValuePrint (const FcValue v);
Keith Packard's avatar
Keith Packard committed
493

494
FcPublic void
495
FcPatternPrint (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
496

497
FcPublic void
498
FcFontSetPrint (const FcFontSet *s);
Keith Packard's avatar
Keith Packard committed
499

Keith Packard's avatar
Keith Packard committed
500
/* fcdefault.c */
501
502
503
FcPublic FcStrSet *
FcGetDefaultLangs (void);

504
FcPublic void
Keith Packard's avatar
Keith Packard committed
505
506
507
FcDefaultSubstitute (FcPattern *pattern);

/* fcdir.c */
508
509
510
511
FcPublic FcBool
FcFileIsDir (const FcChar8 *file);

FcPublic FcBool
512
FcFileScan (FcFontSet	    *set,
513
	    FcStrSet	    *dirs,
514
515
516
517
	    FcFileCache	    *cache,
	    FcBlanks	    *blanks,
	    const FcChar8   *file,
	    FcBool	    force);
Keith Packard's avatar
Keith Packard committed
518

519
FcPublic FcBool
520
FcDirScan (FcFontSet	    *set,
521
	   FcStrSet	    *dirs,
522
523
524
525
526
	   FcFileCache	    *cache,
	   FcBlanks	    *blanks,
	   const FcChar8    *dir,
	   FcBool	    force);

527
FcPublic FcBool
Patrick Lam's avatar
:    
Patrick Lam committed
528
FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
529

530
531
532
533
534
535
536
537
538
539
540
541
FcPublic FcCache *
FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
    
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
542
/* fcfreetype.c */
543
FcPublic FcPattern *
544
FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
Keith Packard's avatar
Keith Packard committed
545
546
547

/* fcfs.c */

548
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
549
550
FcFontSetCreate (void);

551
FcPublic void
Keith Packard's avatar
Keith Packard committed
552
553
FcFontSetDestroy (FcFontSet *s);

554
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
555
556
557
FcFontSetAdd (FcFontSet *s, FcPattern *font);

/* fcinit.c */
558
FcPublic FcConfig *
559
560
FcInitLoadConfig (void);

561
FcPublic FcConfig *
562
563
FcInitLoadConfigAndFonts (void);

564
FcPublic FcBool
565
FcInit (void);
Keith Packard's avatar
Keith Packard committed
566

567
FcPublic void
568
569
FcFini (void);

570
FcPublic int
571
572
FcGetVersion (void);

573
FcPublic FcBool
574
FcInitReinitialize (void);
Keith Packard's avatar
Keith Packard committed
575

576
FcPublic FcBool
577
FcInitBringUptoDate (void);
Keith Packard's avatar
Keith Packard committed
578

579
/* fclang.c */
580
FcPublic FcStrSet *
581
582
583
584
585
FcGetLangs (void);

FcPublic const FcCharSet *
FcLangGetCharSet (const FcChar8 *lang);

586
FcPublic FcLangSet*
587
588
FcLangSetCreate (void);

589
FcPublic void
590
591
FcLangSetDestroy (FcLangSet *ls);

592
FcPublic FcLangSet*
593
594
FcLangSetCopy (const FcLangSet *ls);

595
FcPublic FcBool
596
597
FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);

Akira TAGOH's avatar
Akira TAGOH committed
598
599
600
FcPublic FcBool
FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);

601
FcPublic FcLangResult
602
603
FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);

604
FcPublic FcLangResult
605
606
FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);

607
FcPublic FcBool
608
609
FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);

610
FcPublic FcBool
611
612
FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);

613
FcPublic FcChar32
614
615
FcLangSetHash (const FcLangSet *ls);

616
617
618
FcPublic FcStrSet *
FcLangSetGetLangs (const FcLangSet *ls);

619
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
620
621
FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);

622
FcPublic FcLangSet *
Akira TAGOH's avatar
Akira TAGOH committed
623
624
FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);

Keith Packard's avatar
Keith Packard committed
625
/* fclist.c */
626
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
627
628
FcObjectSetCreate (void);

629
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
630
631
FcObjectSetAdd (FcObjectSet *os, const char *object);

632
FcPublic void
Keith Packard's avatar
Keith Packard committed
633
634
FcObjectSetDestroy (FcObjectSet *os);

635
FcPublic FcObjectSet *
Keith Packard's avatar
Keith Packard committed
636
637
FcObjectSetVaBuild (const char *first, va_list va);

638
FcPublic FcObjectSet *
639
FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
Keith Packard's avatar
Keith Packard committed
640

641
FcPublic FcFontSet *
642
643
644
645
646
647
FcFontSetList (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcObjectSet  *os);

648
FcPublic FcFontSet *
Keith Packard's avatar
Keith Packard committed
649
650
651
652
FcFontList (FcConfig	*config,
	    FcPattern	*p,
	    FcObjectSet *os);

653
654
/* fcatomic.c */

655
FcPublic FcAtomic *
656
657
FcAtomicCreate (const FcChar8   *file);

658
FcPublic FcBool
659
660
FcAtomicLock (FcAtomic *atomic);

661
FcPublic FcChar8 *
662
663
FcAtomicNewFile (FcAtomic *atomic);

664
FcPublic FcChar8 *
665
666
FcAtomicOrigFile (FcAtomic *atomic);

667
FcPublic FcBool
668
669
FcAtomicReplaceOrig (FcAtomic *atomic);

670
FcPublic void
671
672
FcAtomicDeleteNew (FcAtomic *atomic);

673
FcPublic void
674
675
FcAtomicUnlock (FcAtomic *atomic);

676
FcPublic void
677
678
FcAtomicDestroy (FcAtomic *atomic);

Keith Packard's avatar
Keith Packard committed
679
/* fcmatch.c */
680
FcPublic FcPattern *
681
682
683
684
685
686
FcFontSetMatch (FcConfig    *config,
		FcFontSet   **sets,
		int	    nsets,
		FcPattern   *p,
		FcResult    *result);

687
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
688
689
690
691
FcFontMatch (FcConfig	*config,
	     FcPattern	*p, 
	     FcResult	*result);

692
FcPublic FcPattern *
693
694
695
696
FcFontRenderPrepare (FcConfig	    *config,
		     FcPattern	    *pat,
		     FcPattern	    *font);

697
FcPublic FcFontSet *
698
699
700
701
702
703
704
705
FcFontSetSort (FcConfig	    *config,
	       FcFontSet    **sets,
	       int	    nsets,
	       FcPattern    *p,
	       FcBool	    trim,
	       FcCharSet    **csp,
	       FcResult	    *result);

706
FcPublic FcFontSet *
707
708
709
710
711
712
FcFontSort (FcConfig	 *config,
	    FcPattern    *p,
	    FcBool	 trim,
	    FcCharSet    **csp,
	    FcResult	 *result);

713
FcPublic void
714
715
FcFontSetSortDestroy (FcFontSet *fs);

Keith Packard's avatar
Keith Packard committed
716
/* fcmatrix.c */
717
FcPublic FcMatrix *
Keith Packard's avatar
Keith Packard committed
718
719
FcMatrixCopy (const FcMatrix *mat);

720
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
721
722
FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);

723
FcPublic void
Keith Packard's avatar
Keith Packard committed
724
725
FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);

726
FcPublic void
Keith Packard's avatar
Keith Packard committed
727
728
FcMatrixRotate (FcMatrix *m, double c, double s);

729
FcPublic void
Keith Packard's avatar
Keith Packard committed
730
731
FcMatrixScale (FcMatrix *m, double sx, double sy);

732
FcPublic void
Keith Packard's avatar
Keith Packard committed
733
734
735
736
FcMatrixShear (FcMatrix *m, double sh, double sv);

/* fcname.c */

737
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
738
739
FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);

740
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
741
742
FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
    
743
FcPublic const FcObjectType *
Keith Packard's avatar
Keith Packard committed
744
745
FcNameGetObjectType (const char *object);

746
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
747
748
FcNameRegisterConstants (const FcConstant *consts, int nconsts);

749
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
750
751
FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
    
752
FcPublic const FcConstant *
753
FcNameGetConstant (const FcChar8 *string);
Keith Packard's avatar
Keith Packard committed
754

755
FcPublic FcBool
756
FcNameConstant (const FcChar8 *string, int *result);
Keith Packard's avatar
Keith Packard committed
757

758
FcPublic FcPattern *
759
FcNameParse (const FcChar8 *name);
Keith Packard's avatar
Keith Packard committed
760

761
FcPublic FcChar8 *
Keith Packard's avatar
Keith Packard committed
762
763
764
FcNameUnparse (FcPattern *pat);

/* fcpat.c */
765
FcPublic FcPattern *
Keith Packard's avatar
Keith Packard committed
766
767
FcPatternCreate (void);

768
FcPublic FcPattern *
769
FcPatternDuplicate (const FcPattern *p);
Keith Packard's avatar
Keith Packard committed
770

771
FcPublic void
772
773
FcPatternReference (FcPattern *p);

774
775
776
FcPublic FcPattern *
FcPatternFilter (FcPattern *p, const FcObjectSet *os);

777
FcPublic void
Keith Packard's avatar
Keith Packard committed
778
779
FcValueDestroy (FcValue v);

780
FcPublic FcBool
781
782
FcValueEqual (FcValue va, FcValue vb);

783
FcPublic FcValue
Keith Packard's avatar
Keith Packard committed
784
785
FcValueSave (FcValue v);

786
FcPublic void
Keith Packard's avatar
Keith Packard committed
787
788
FcPatternDestroy (FcPattern *p);

789
FcPublic FcBool
790
791
FcPatternEqual (const FcPattern *pa, const FcPattern *pb);

792
FcPublic FcBool
793
FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
794

795
FcPublic FcChar32
796
797
FcPatternHash (const FcPattern *p);

798
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
799
800
FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
    
801
FcPublic FcBool
802
803
FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
    
804
FcPublic FcResult
805
FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
Keith Packard's avatar
Keith Packard committed
806
    
807
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
808
809
FcPatternDel (FcPattern *p, const char *object);

810
FcPublic FcBool
811
812
FcPatternRemove (FcPattern *p, const char *object, int id);

813
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
814
815
FcPatternAddInteger (FcPattern *p, const char *object, int i);

816
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
817
818
FcPatternAddDouble (FcPattern *p, const char *object, double d);

819
FcPublic FcBool
820
FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
Keith Packard's avatar
Keith Packard committed
821

822
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
823
824
FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);

825
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
826
827
FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);

828
FcPublic FcBool
Keith Packard's avatar
Keith Packard committed
829
830
FcPatternAddBool (FcPattern *p, const char *object, FcBool b);

831
FcPublic FcBool
832
833
FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);

834
FcPublic FcResult
835
FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
Keith Packard's avatar
Keith Packard committed
836

837
FcPublic FcResult
838
FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
Keith Packard's avatar
Keith Packard committed
839

840
FcPublic FcResult
841
FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
Keith Packard's avatar
Keith Packard committed
842

843
FcPublic FcResult
844
FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
Keith Packard's avatar
Keith Packard committed
845

846
FcPublic FcResult
847
FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
Keith Packard's avatar
Keith Packard committed
848

849
FcPublic FcResult
850
FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
Keith Packard's avatar
Keith Packard committed
851

852
FcPublic FcResult
853
FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
854

855
FcPublic FcPattern *
856
FcPatternVaBuild (FcPattern *p, va_list va);
Keith Packard's avatar
Keith Packard committed
857
    
858
FcPublic FcPattern *
859
FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
Keith Packard's avatar
Keith Packard committed
860

861
862
863
FcPublic FcChar8 *
FcPatternFormat (FcPattern *pat, const FcChar8 *format);

Keith Packard's avatar
Keith Packard committed
864
865
/* fcstr.c */

866
FcPublic FcChar8 *
867
FcStrCopy (const FcChar8 *s);
Keith Packard's avatar
Keith Packard committed
868

869
FcPublic FcChar8 *
870
871
FcStrCopyFilename (const FcChar8 *s);
    
872
873
874
875
876
877
FcPublic FcChar8 *
FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
    
FcPublic void
FcStrFree (FcChar8 *s);

878
879
880
881
882
/* These are ASCII only, suitable only for pattern element names */
#define FcIsUpper(c)	((0101 <= (c) && (c) <= 0132))
#define FcIsLower(c)	((0141 <= (c) && (c) <= 0172))
#define FcToLower(c)	(FcIsUpper(c) ? (c) - 0101 + 0141 : (c))

883
FcPublic FcChar8 *
884
FcStrDowncase (const FcChar8 *s);
Keith Packard's avatar
Keith Packard committed
885

886
FcPublic int
887
FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
Keith Packard's avatar
Keith Packard committed
888

889
FcPublic int
890
891
FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);

892
FcPublic const FcChar8 *
893
894
FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);

895
FcPublic const FcChar8 *
896
897
FcStrStr (const FcChar8 *s1, const FcChar8 *s2);

898
FcPublic int
899
900
901
FcUtf8ToUcs4 (const FcChar8 *src_orig,
	      FcChar32	    *dst,
	      int	    len);
Keith Packard's avatar
Keith Packard committed
902

903
FcPublic FcBool
904
905
906
907
FcUtf8Len (const FcChar8    *string,
	   int		    len,
	   int		    *nchar,
	   int		    *wchar);
Keith Packard's avatar
Keith Packard committed
908

909
910
#define FC_UTF8_MAX_LEN	6

911
FcPublic int
912
913
914
FcUcs4ToUtf8 (FcChar32	ucs4,
	      FcChar8	dest[FC_UTF8_MAX_LEN]);

915
FcPublic int
916
917
918
919
FcUtf16ToUcs4 (const FcChar8	*src_orig,
	       FcEndian		endian,
	       FcChar32		*dst,
	       int		len);	    /* in bytes */
920

921
FcPublic FcBool
922
923
924
925
926
FcUtf16Len (const FcChar8   *string,
	    FcEndian	    endian,
	    int		    len,	    /* in bytes */
	    int		    *nchar,
	    int		    *wchar);
927

928
FcPublic FcChar8 *
929
930
FcStrDirname (const FcChar8 *file);

931
FcPublic FcChar8 *
932
933
FcStrBasename (const FcChar8 *file);

934
FcPublic FcStrSet *
935
936
FcStrSetCreate (void);

937
FcPublic FcBool
938
FcStrSetMember (FcStrSet *set, const FcChar8 *s);
939

940
FcPublic FcBool
941
FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
942

943
FcPublic FcBool
944
FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
945

946
FcPublic FcBool
947
FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
948

949
FcPublic FcBool
950
FcStrSetDel (FcStrSet *set, const FcChar8 *s);
951

952
FcPublic void
953
FcStrSetDestroy (FcStrSet *set);