]>
Commit | Line | Data |
---|---|---|
24330d27 | 1 | /* |
4c2967f6 | 2 | * $RCSId: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.30 2002/09/26 00:17:27 keithp Exp $ |
24330d27 | 3 | * |
46b51147 | 4 | * Copyright © 2001 Keith Packard |
24330d27 KP |
5 | * |
6 | * Permission to use, copy, modify, distribute, and sell this software and its | |
7 | * documentation for any purpose is hereby granted without fee, provided that | |
8 | * the above copyright notice appear in all copies and that both that | |
9 | * copyright notice and this permission notice appear in supporting | |
10 | * documentation, and that the name of Keith Packard not be used in | |
11 | * advertising or publicity pertaining to distribution of the software without | |
12 | * specific, written prior permission. Keith Packard makes no | |
13 | * representations about the suitability of this software for any purpose. It | |
14 | * is provided "as is" without express or implied warranty. | |
15 | * | |
16 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | |
17 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO | |
18 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR | |
19 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, | |
20 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER | |
21 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | |
22 | * PERFORMANCE OF THIS SOFTWARE. | |
23 | */ | |
24 | ||
25 | #ifndef _FONTCONFIG_H_ | |
26 | #define _FONTCONFIG_H_ | |
27 | ||
28 | #include <stdarg.h> | |
29 | ||
250c1cd4 PL |
30 | #if defined(__GNUC__) && (__GNUC__ >= 4) |
31 | #define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0))) | |
32 | #else | |
33 | #define FC_ATTRIBUTE_SENTINEL(x) | |
34 | #endif | |
35 | ||
24330d27 KP |
36 | typedef unsigned char FcChar8; |
37 | typedef unsigned short FcChar16; | |
38 | typedef unsigned int FcChar32; | |
39 | typedef int FcBool; | |
40 | ||
41 | /* | |
ff3f1f98 KP |
42 | * Current Fontconfig version number. This same number |
43 | * must appear in the fontconfig configure.in file. Yes, | |
44 | * it'a a pain to synchronize version numbers like this. | |
24330d27 | 45 | */ |
20fa60c9 | 46 | |
ff3f1f98 | 47 | #define FC_MAJOR 2 |
4afc00ca | 48 | #define FC_MINOR 3 |
0945cbe7 | 49 | #define FC_REVISION 96 |
24330d27 KP |
50 | |
51 | #define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION)) | |
52 | ||
f21f40f3 KP |
53 | /* |
54 | * Current font cache file format version | |
55 | * This is appended to the cache files so that multiple | |
56 | * versions of the library will peacefully coexist | |
57 | * | |
58 | * Change this value whenever the disk format for the cache file | |
59 | * changes in any non-compatible way. Try to avoid such changes as | |
60 | * it means multiple copies of the font information. | |
61 | */ | |
62 | ||
4262e0b3 | 63 | #define FC_CACHE_VERSION "2" |
f21f40f3 | 64 | |
24330d27 KP |
65 | #define FcTrue 1 |
66 | #define FcFalse 0 | |
67 | ||
68 | #define FC_FAMILY "family" /* String */ | |
69 | #define FC_STYLE "style" /* String */ | |
70 | #define FC_SLANT "slant" /* Int */ | |
71 | #define FC_WEIGHT "weight" /* Int */ | |
72 | #define FC_SIZE "size" /* Double */ | |
2a41214a | 73 | #define FC_ASPECT "aspect" /* Double */ |
24330d27 KP |
74 | #define FC_PIXEL_SIZE "pixelsize" /* Double */ |
75 | #define FC_SPACING "spacing" /* Int */ | |
76 | #define FC_FOUNDRY "foundry" /* String */ | |
77 | #define FC_ANTIALIAS "antialias" /* Bool (depends) */ | |
78 | #define FC_HINTING "hinting" /* Bool (true) */ | |
f077d662 | 79 | #define FC_HINT_STYLE "hintstyle" /* Int */ |
24330d27 KP |
80 | #define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */ |
81 | #define FC_AUTOHINT "autohint" /* Bool (false) */ | |
82 | #define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */ | |
81fa16c3 | 83 | #define FC_WIDTH "width" /* Int */ |
24330d27 KP |
84 | #define FC_FILE "file" /* String */ |
85 | #define FC_INDEX "index" /* Int */ | |
be094850 | 86 | #define FC_FT_FACE "ftface" /* FT_Face */ |
24330d27 KP |
87 | #define FC_RASTERIZER "rasterizer" /* String */ |
88 | #define FC_OUTLINE "outline" /* Bool */ | |
89 | #define FC_SCALABLE "scalable" /* Bool */ | |
90 | #define FC_SCALE "scale" /* double */ | |
91 | #define FC_DPI "dpi" /* double */ | |
92 | #define FC_RGBA "rgba" /* Int */ | |
93 | #define FC_MINSPACE "minspace" /* Bool use minimum line spacing */ | |
0c009d2b | 94 | #define FC_SOURCE "source" /* String (deprecated) */ |
24330d27 | 95 | #define FC_CHARSET "charset" /* CharSet */ |
a342e87d KP |
96 | #define FC_LANG "lang" /* String RFC 3066 langs */ |
97 | #define FC_FONTVERSION "fontversion" /* Int from 'head' table */ | |
4f27c1c0 KP |
98 | #define FC_FULLNAME "fullname" /* String */ |
99 | #define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */ | |
100 | #define FC_STYLELANG "stylelang" /* String RFC 3066 langs */ | |
101 | #define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */ | |
dbf68dd5 | 102 | #define FC_CAPABILITY "capability" /* String */ |
537e3d23 | 103 | #define FC_FONTFORMAT "fontformat" /* String */ |
46a10637 | 104 | #define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/ |
720298e7 | 105 | #define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */ |
c2c6976d | 106 | #define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */ |
24330d27 | 107 | |
ea44e218 | 108 | #define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION |
f21f40f3 KP |
109 | #define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION |
110 | #define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION | |
24330d27 KP |
111 | |
112 | /* Adjust outline rasterizer */ | |
113 | #define FC_CHAR_WIDTH "charwidth" /* Int */ | |
114 | #define FC_CHAR_HEIGHT "charheight"/* Int */ | |
115 | #define FC_MATRIX "matrix" /* FcMatrix */ | |
116 | ||
81fa16c3 KP |
117 | #define FC_WEIGHT_THIN 0 |
118 | #define FC_WEIGHT_EXTRALIGHT 40 | |
119 | #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT | |
120 | #define FC_WEIGHT_LIGHT 50 | |
ad293de0 | 121 | #define FC_WEIGHT_BOOK 75 |
81fa16c3 KP |
122 | #define FC_WEIGHT_REGULAR 80 |
123 | #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR | |
124 | #define FC_WEIGHT_MEDIUM 100 | |
125 | #define FC_WEIGHT_DEMIBOLD 180 | |
126 | #define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD | |
127 | #define FC_WEIGHT_BOLD 200 | |
128 | #define FC_WEIGHT_EXTRABOLD 205 | |
3f7653c2 | 129 | #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD |
81fa16c3 | 130 | #define FC_WEIGHT_BLACK 210 |
3f7653c2 | 131 | #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK |
81fa16c3 KP |
132 | |
133 | #define FC_SLANT_ROMAN 0 | |
134 | #define FC_SLANT_ITALIC 100 | |
135 | #define FC_SLANT_OBLIQUE 110 | |
136 | ||
137 | #define FC_WIDTH_ULTRACONDENSED 50 | |
138 | #define FC_WIDTH_EXTRACONDENSED 63 | |
139 | #define FC_WIDTH_CONDENSED 75 | |
140 | #define FC_WIDTH_SEMICONDENSED 87 | |
141 | #define FC_WIDTH_NORMAL 100 | |
142 | #define FC_WIDTH_SEMIEXPANDED 113 | |
143 | #define FC_WIDTH_EXPANDED 125 | |
144 | #define FC_WIDTH_EXTRAEXPANDED 150 | |
145 | #define FC_WIDTH_ULTRAEXPANDED 200 | |
146 | ||
147 | #define FC_PROPORTIONAL 0 | |
a05d257f | 148 | #define FC_DUAL 90 |
81fa16c3 KP |
149 | #define FC_MONO 100 |
150 | #define FC_CHARCELL 110 | |
24330d27 KP |
151 | |
152 | /* sub-pixel order */ | |
1852d490 | 153 | #define FC_RGBA_UNKNOWN 0 |
24330d27 KP |
154 | #define FC_RGBA_RGB 1 |
155 | #define FC_RGBA_BGR 2 | |
156 | #define FC_RGBA_VRGB 3 | |
157 | #define FC_RGBA_VBGR 4 | |
1852d490 | 158 | #define FC_RGBA_NONE 5 |
24330d27 | 159 | |
f077d662 OT |
160 | /* hinting style */ |
161 | #define FC_HINT_NONE 0 | |
162 | #define FC_HINT_SLIGHT 1 | |
163 | #define FC_HINT_MEDIUM 2 | |
164 | #define FC_HINT_FULL 3 | |
165 | ||
24330d27 KP |
166 | typedef enum _FcType { |
167 | FcTypeVoid, | |
168 | FcTypeInteger, | |
169 | FcTypeDouble, | |
170 | FcTypeString, | |
171 | FcTypeBool, | |
172 | FcTypeMatrix, | |
be094850 | 173 | FcTypeCharSet, |
d8d73958 KP |
174 | FcTypeFTFace, |
175 | FcTypeLangSet | |
24330d27 KP |
176 | } FcType; |
177 | ||
178 | typedef struct _FcMatrix { | |
179 | double xx, xy, yx, yy; | |
180 | } FcMatrix; | |
181 | ||
182 | #define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \ | |
183 | (m)->xy = (m)->yx = 0) | |
184 | ||
185 | /* | |
186 | * A data structure to represent the available glyphs in a font. | |
187 | * This is represented as a sparse boolean btree. | |
188 | */ | |
189 | ||
190 | typedef struct _FcCharSet FcCharSet; | |
191 | ||
192 | typedef struct _FcObjectType { | |
193 | const char *object; | |
194 | FcType type; | |
195 | } FcObjectType; | |
196 | ||
197 | typedef struct _FcConstant { | |
ccb3e93b | 198 | const FcChar8 *name; |
24330d27 KP |
199 | const char *object; |
200 | int value; | |
201 | } FcConstant; | |
202 | ||
203 | typedef enum _FcResult { | |
ec0c740e | 204 | FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId, |
3d1ea0e5 | 205 | FcResultOutOfMemory |
24330d27 KP |
206 | } FcResult; |
207 | ||
938bc633 KP |
208 | typedef struct _FcPattern FcPattern; |
209 | ||
d8d73958 KP |
210 | typedef struct _FcLangSet FcLangSet; |
211 | ||
24330d27 KP |
212 | typedef struct _FcValue { |
213 | FcType type; | |
214 | union { | |
f57783d2 | 215 | const FcChar8 *s; |
24330d27 KP |
216 | int i; |
217 | FcBool b; | |
218 | double d; | |
f57783d2 KP |
219 | const FcMatrix *m; |
220 | const FcCharSet *c; | |
be094850 | 221 | void *f; |
938bc633 | 222 | const FcPattern *p; |
f57783d2 | 223 | const FcLangSet *l; |
24330d27 KP |
224 | } u; |
225 | } FcValue; | |
226 | ||
24330d27 KP |
227 | typedef struct _FcFontSet { |
228 | int nfont; | |
229 | int sfont; | |
230 | FcPattern **fonts; | |
231 | } FcFontSet; | |
232 | ||
233 | typedef struct _FcObjectSet { | |
234 | int nobject; | |
235 | int sobject; | |
4262e0b3 | 236 | const char **objects; |
24330d27 KP |
237 | } FcObjectSet; |
238 | ||
239 | typedef enum _FcMatchKind { | |
c2c6976d | 240 | FcMatchPattern, FcMatchFont, FcMatchScan |
24330d27 KP |
241 | } FcMatchKind; |
242 | ||
d8d73958 KP |
243 | typedef enum _FcLangResult { |
244 | FcLangEqual, FcLangDifferentCountry, FcLangDifferentLang | |
245 | } FcLangResult; | |
246 | ||
24330d27 KP |
247 | typedef enum _FcSetName { |
248 | FcSetSystem = 0, | |
249 | FcSetApplication = 1 | |
250 | } FcSetName; | |
251 | ||
134f6011 KP |
252 | typedef struct _FcAtomic FcAtomic; |
253 | ||
24330d27 KP |
254 | #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ |
255 | #define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ | |
256 | #define _FCFUNCPROTOEND } | |
257 | #else | |
258 | #define _FCFUNCPROTOBEGIN | |
259 | #define _FCFUNCPROTOEND | |
260 | #endif | |
261 | ||
69937bd9 KP |
262 | typedef enum { FcEndianBig, FcEndianLittle } FcEndian; |
263 | ||
24330d27 KP |
264 | typedef struct _FcConfig FcConfig; |
265 | ||
327a7fd4 | 266 | typedef struct _FcGlobalCache FcFileCache; |
24330d27 KP |
267 | |
268 | typedef struct _FcBlanks FcBlanks; | |
269 | ||
179c3995 KP |
270 | typedef struct _FcStrList FcStrList; |
271 | ||
272 | typedef struct _FcStrSet FcStrSet; | |
273 | ||
24330d27 KP |
274 | _FCFUNCPROTOBEGIN |
275 | ||
c2e9d024 | 276 | FcBool |
f57783d2 | 277 | FcDirCacheValid (const FcChar8 *cache_file); |
55c8fa4f | 278 | |
24330d27 KP |
279 | /* fcblanks.c */ |
280 | FcBlanks * | |
281 | FcBlanksCreate (void); | |
282 | ||
283 | void | |
284 | FcBlanksDestroy (FcBlanks *b); | |
285 | ||
286 | FcBool | |
287 | FcBlanksAdd (FcBlanks *b, FcChar32 ucs4); | |
288 | ||
289 | FcBool | |
290 | FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4); | |
291 | ||
292 | /* fccfg.c */ | |
ff3f1f98 KP |
293 | FcChar8 * |
294 | FcConfigHome (void); | |
295 | ||
296 | FcBool | |
297 | FcConfigEnableHome (FcBool enable); | |
298 | ||
ccb3e93b KP |
299 | FcChar8 * |
300 | FcConfigFilename (const FcChar8 *url); | |
24330d27 KP |
301 | |
302 | FcConfig * | |
303 | FcConfigCreate (void); | |
304 | ||
305 | void | |
306 | FcConfigDestroy (FcConfig *config); | |
307 | ||
308 | FcBool | |
309 | FcConfigSetCurrent (FcConfig *config); | |
310 | ||
311 | FcConfig * | |
312 | FcConfigGetCurrent (void); | |
313 | ||
179c3995 KP |
314 | FcBool |
315 | FcConfigUptoDate (FcConfig *config); | |
316 | ||
24330d27 KP |
317 | FcBool |
318 | FcConfigBuildFonts (FcConfig *config); | |
319 | ||
179c3995 KP |
320 | FcStrList * |
321 | FcConfigGetFontDirs (FcConfig *config); | |
322 | ||
323 | FcStrList * | |
324 | FcConfigGetConfigDirs (FcConfig *config); | |
24330d27 | 325 | |
179c3995 | 326 | FcStrList * |
24330d27 KP |
327 | FcConfigGetConfigFiles (FcConfig *config); |
328 | ||
ccb3e93b | 329 | FcChar8 * |
24330d27 KP |
330 | FcConfigGetCache (FcConfig *config); |
331 | ||
332 | FcBlanks * | |
333 | FcConfigGetBlanks (FcConfig *config); | |
334 | ||
179c3995 KP |
335 | int |
336 | FcConfigGetRescanInverval (FcConfig *config); | |
337 | ||
338 | FcBool | |
339 | FcConfigSetRescanInverval (FcConfig *config, int rescanInterval); | |
340 | ||
24330d27 KP |
341 | FcFontSet * |
342 | FcConfigGetFonts (FcConfig *config, | |
343 | FcSetName set); | |
344 | ||
345 | FcBool | |
346 | FcConfigAppFontAddFile (FcConfig *config, | |
ccb3e93b | 347 | const FcChar8 *file); |
24330d27 KP |
348 | |
349 | FcBool | |
350 | FcConfigAppFontAddDir (FcConfig *config, | |
ccb3e93b | 351 | const FcChar8 *dir); |
24330d27 KP |
352 | |
353 | void | |
354 | FcConfigAppFontClear (FcConfig *config); | |
355 | ||
fa244f3d KP |
356 | FcBool |
357 | FcConfigSubstituteWithPat (FcConfig *config, | |
358 | FcPattern *p, | |
359 | FcPattern *p_pat, | |
360 | FcMatchKind kind); | |
361 | ||
24330d27 KP |
362 | FcBool |
363 | FcConfigSubstitute (FcConfig *config, | |
364 | FcPattern *p, | |
365 | FcMatchKind kind); | |
366 | ||
367 | /* fccharset.c */ | |
368 | FcCharSet * | |
369 | FcCharSetCreate (void); | |
370 | ||
371 | void | |
372 | FcCharSetDestroy (FcCharSet *fcs); | |
373 | ||
374 | FcBool | |
375 | FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4); | |
376 | ||
377 | FcCharSet * | |
378 | FcCharSetCopy (FcCharSet *src); | |
379 | ||
380 | FcBool | |
381 | FcCharSetEqual (const FcCharSet *a, const FcCharSet *b); | |
382 | ||
383 | FcCharSet * | |
384 | FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b); | |
385 | ||
386 | FcCharSet * | |
387 | FcCharSetUnion (const FcCharSet *a, const FcCharSet *b); | |
388 | ||
389 | FcCharSet * | |
390 | FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b); | |
391 | ||
392 | FcBool | |
393 | FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4); | |
394 | ||
395 | FcChar32 | |
396 | FcCharSetCount (const FcCharSet *a); | |
397 | ||
398 | FcChar32 | |
399 | FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b); | |
400 | ||
401 | FcChar32 | |
402 | FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b); | |
403 | ||
1412a699 KP |
404 | FcBool |
405 | FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b); | |
406 | ||
36732012 KP |
407 | #define FC_CHARSET_MAP_SIZE (256/32) |
408 | #define FC_CHARSET_DONE ((FcChar32) -1) | |
409 | ||
410 | FcChar32 | |
411 | FcCharSetFirstPage (const FcCharSet *a, | |
412 | FcChar32 map[FC_CHARSET_MAP_SIZE], | |
413 | FcChar32 *next); | |
414 | ||
aae6f7d4 | 415 | FcChar32 |
36732012 KP |
416 | FcCharSetNextPage (const FcCharSet *a, |
417 | FcChar32 map[FC_CHARSET_MAP_SIZE], | |
418 | FcChar32 *next); | |
419 | ||
aae6f7d4 | 420 | |
24330d27 | 421 | /* fcdbg.c */ |
9c8e07f1 | 422 | void |
938bc633 | 423 | FcValuePrint (const FcValue v); |
9c8e07f1 | 424 | |
24330d27 | 425 | void |
938bc633 | 426 | FcPatternPrint (const FcPattern *p); |
24330d27 | 427 | |
9c8e07f1 | 428 | void |
938bc633 | 429 | FcFontSetPrint (const FcFontSet *s); |
9c8e07f1 | 430 | |
24330d27 KP |
431 | /* fcdefault.c */ |
432 | void | |
433 | FcDefaultSubstitute (FcPattern *pattern); | |
434 | ||
435 | /* fcdir.c */ | |
436 | FcBool | |
ccb3e93b | 437 | FcFileScan (FcFontSet *set, |
179c3995 | 438 | FcStrSet *dirs, |
ccb3e93b KP |
439 | FcFileCache *cache, |
440 | FcBlanks *blanks, | |
441 | const FcChar8 *file, | |
442 | FcBool force); | |
24330d27 KP |
443 | |
444 | FcBool | |
ccb3e93b | 445 | FcDirScan (FcFontSet *set, |
179c3995 | 446 | FcStrSet *dirs, |
ccb3e93b KP |
447 | FcFileCache *cache, |
448 | FcBlanks *blanks, | |
449 | const FcChar8 *dir, | |
450 | FcBool force); | |
451 | ||
452 | FcBool | |
2304e38f | 453 | FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir); |
179c3995 | 454 | |
24330d27 KP |
455 | /* fcfreetype.c */ |
456 | FcPattern * | |
ccb3e93b | 457 | FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count); |
24330d27 KP |
458 | |
459 | /* fcfs.c */ | |
460 | ||
461 | FcFontSet * | |
462 | FcFontSetCreate (void); | |
463 | ||
464 | void | |
465 | FcFontSetDestroy (FcFontSet *s); | |
466 | ||
467 | FcBool | |
468 | FcFontSetAdd (FcFontSet *s, FcPattern *font); | |
469 | ||
470 | /* fcinit.c */ | |
179c3995 KP |
471 | FcConfig * |
472 | FcInitLoadConfig (void); | |
473 | ||
474 | FcConfig * | |
475 | FcInitLoadConfigAndFonts (void); | |
476 | ||
24330d27 | 477 | FcBool |
179c3995 | 478 | FcInit (void); |
24330d27 | 479 | |
34cd0514 CW |
480 | void |
481 | FcFini (void); | |
482 | ||
48db40f6 KP |
483 | int |
484 | FcGetVersion (void); | |
485 | ||
24330d27 | 486 | FcBool |
179c3995 | 487 | FcInitReinitialize (void); |
24330d27 KP |
488 | |
489 | FcBool | |
179c3995 | 490 | FcInitBringUptoDate (void); |
24330d27 | 491 | |
d8d73958 KP |
492 | /* fclang.c */ |
493 | FcLangSet * | |
494 | FcLangSetCreate (void); | |
495 | ||
496 | void | |
497 | FcLangSetDestroy (FcLangSet *ls); | |
498 | ||
499 | FcLangSet * | |
500 | FcLangSetCopy (const FcLangSet *ls); | |
501 | ||
502 | FcBool | |
503 | FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang); | |
504 | ||
505 | FcLangResult | |
506 | FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang); | |
507 | ||
508 | FcLangResult | |
509 | FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb); | |
510 | ||
4c2967f6 KP |
511 | FcBool |
512 | FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb); | |
513 | ||
d8d73958 KP |
514 | FcBool |
515 | FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb); | |
516 | ||
517 | FcChar32 | |
518 | FcLangSetHash (const FcLangSet *ls); | |
519 | ||
24330d27 KP |
520 | /* fclist.c */ |
521 | FcObjectSet * | |
522 | FcObjectSetCreate (void); | |
523 | ||
524 | FcBool | |
525 | FcObjectSetAdd (FcObjectSet *os, const char *object); | |
526 | ||
527 | void | |
528 | FcObjectSetDestroy (FcObjectSet *os); | |
529 | ||
530 | FcObjectSet * | |
531 | FcObjectSetVaBuild (const char *first, va_list va); | |
532 | ||
533 | FcObjectSet * | |
250c1cd4 | 534 | FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0); |
24330d27 | 535 | |
80c053b7 KP |
536 | FcFontSet * |
537 | FcFontSetList (FcConfig *config, | |
538 | FcFontSet **sets, | |
539 | int nsets, | |
540 | FcPattern *p, | |
541 | FcObjectSet *os); | |
542 | ||
24330d27 KP |
543 | FcFontSet * |
544 | FcFontList (FcConfig *config, | |
545 | FcPattern *p, | |
546 | FcObjectSet *os); | |
547 | ||
134f6011 KP |
548 | /* fcatomic.c */ |
549 | ||
550 | FcAtomic * | |
551 | FcAtomicCreate (const FcChar8 *file); | |
552 | ||
553 | FcBool | |
554 | FcAtomicLock (FcAtomic *atomic); | |
555 | ||
556 | FcChar8 * | |
557 | FcAtomicNewFile (FcAtomic *atomic); | |
558 | ||
559 | FcChar8 * | |
560 | FcAtomicOrigFile (FcAtomic *atomic); | |
561 | ||
562 | FcBool | |
563 | FcAtomicReplaceOrig (FcAtomic *atomic); | |
564 | ||
565 | void | |
566 | FcAtomicDeleteNew (FcAtomic *atomic); | |
567 | ||
568 | void | |
569 | FcAtomicUnlock (FcAtomic *atomic); | |
570 | ||
571 | void | |
572 | FcAtomicDestroy (FcAtomic *atomic); | |
573 | ||
24330d27 | 574 | /* fcmatch.c */ |
80c053b7 KP |
575 | FcPattern * |
576 | FcFontSetMatch (FcConfig *config, | |
577 | FcFontSet **sets, | |
578 | int nsets, | |
579 | FcPattern *p, | |
580 | FcResult *result); | |
581 | ||
24330d27 KP |
582 | FcPattern * |
583 | FcFontMatch (FcConfig *config, | |
584 | FcPattern *p, | |
585 | FcResult *result); | |
586 | ||
216fac98 KP |
587 | FcPattern * |
588 | FcFontRenderPrepare (FcConfig *config, | |
589 | FcPattern *pat, | |
590 | FcPattern *font); | |
591 | ||
592 | FcFontSet * | |
593 | FcFontSetSort (FcConfig *config, | |
594 | FcFontSet **sets, | |
595 | int nsets, | |
596 | FcPattern *p, | |
597 | FcBool trim, | |
598 | FcCharSet **csp, | |
599 | FcResult *result); | |
600 | ||
20ac65ab KP |
601 | FcFontSet * |
602 | FcFontSort (FcConfig *config, | |
603 | FcPattern *p, | |
604 | FcBool trim, | |
605 | FcCharSet **csp, | |
606 | FcResult *result); | |
607 | ||
1412a699 KP |
608 | void |
609 | FcFontSetSortDestroy (FcFontSet *fs); | |
610 | ||
24330d27 KP |
611 | /* fcmatrix.c */ |
612 | FcMatrix * | |
613 | FcMatrixCopy (const FcMatrix *mat); | |
614 | ||
615 | FcBool | |
616 | FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2); | |
617 | ||
618 | void | |
619 | FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b); | |
620 | ||
621 | void | |
622 | FcMatrixRotate (FcMatrix *m, double c, double s); | |
623 | ||
624 | void | |
625 | FcMatrixScale (FcMatrix *m, double sx, double sy); | |
626 | ||
627 | void | |
628 | FcMatrixShear (FcMatrix *m, double sh, double sv); | |
629 | ||
630 | /* fcname.c */ | |
631 | ||
632 | FcBool | |
633 | FcNameRegisterObjectTypes (const FcObjectType *types, int ntype); | |
634 | ||
635 | FcBool | |
636 | FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype); | |
637 | ||
638 | const FcObjectType * | |
639 | FcNameGetObjectType (const char *object); | |
640 | ||
641 | FcBool | |
642 | FcNameRegisterConstants (const FcConstant *consts, int nconsts); | |
643 | ||
644 | FcBool | |
645 | FcNameUnregisterConstants (const FcConstant *consts, int nconsts); | |
646 | ||
647 | const FcConstant * | |
ccb3e93b | 648 | FcNameGetConstant (FcChar8 *string); |
24330d27 KP |
649 | |
650 | FcBool | |
ccb3e93b | 651 | FcNameConstant (FcChar8 *string, int *result); |
24330d27 KP |
652 | |
653 | FcPattern * | |
ccb3e93b | 654 | FcNameParse (const FcChar8 *name); |
24330d27 KP |
655 | |
656 | FcChar8 * | |
657 | FcNameUnparse (FcPattern *pat); | |
658 | ||
659 | /* fcpat.c */ | |
660 | FcPattern * | |
661 | FcPatternCreate (void); | |
662 | ||
663 | FcPattern * | |
bff80114 | 664 | FcPatternDuplicate (const FcPattern *p); |
24330d27 | 665 | |
6f6563ed KP |
666 | void |
667 | FcPatternReference (FcPattern *p); | |
668 | ||
24330d27 KP |
669 | void |
670 | FcValueDestroy (FcValue v); | |
671 | ||
0ab36ca8 KP |
672 | FcBool |
673 | FcValueEqual (FcValue va, FcValue vb); | |
674 | ||
24330d27 KP |
675 | FcValue |
676 | FcValueSave (FcValue v); | |
677 | ||
678 | void | |
679 | FcPatternDestroy (FcPattern *p); | |
680 | ||
0ab36ca8 | 681 | FcBool |
e9be9cd1 KP |
682 | FcPatternEqual (const FcPattern *pa, const FcPattern *pb); |
683 | ||
684 | FcBool | |
685 | FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os); | |
0ab36ca8 | 686 | |
d0f07b8d KP |
687 | FcChar32 |
688 | FcPatternHash (const FcPattern *p); | |
689 | ||
24330d27 KP |
690 | FcBool |
691 | FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append); | |
692 | ||
82f4243f KP |
693 | FcBool |
694 | FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append); | |
695 | ||
24330d27 | 696 | FcResult |
bff80114 | 697 | FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v); |
24330d27 KP |
698 | |
699 | FcBool | |
700 | FcPatternDel (FcPattern *p, const char *object); | |
701 | ||
4f27c1c0 KP |
702 | FcBool |
703 | FcPatternRemove (FcPattern *p, const char *object, int id); | |
704 | ||
24330d27 KP |
705 | FcBool |
706 | FcPatternAddInteger (FcPattern *p, const char *object, int i); | |
707 | ||
708 | FcBool | |
709 | FcPatternAddDouble (FcPattern *p, const char *object, double d); | |
710 | ||
711 | FcBool | |
ccb3e93b | 712 | FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s); |
24330d27 KP |
713 | |
714 | FcBool | |
715 | FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s); | |
716 | ||
717 | FcBool | |
718 | FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c); | |
719 | ||
720 | FcBool | |
721 | FcPatternAddBool (FcPattern *p, const char *object, FcBool b); | |
722 | ||
d8d73958 KP |
723 | FcBool |
724 | FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls); | |
725 | ||
24330d27 | 726 | FcResult |
bff80114 | 727 | FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i); |
24330d27 KP |
728 | |
729 | FcResult | |
bff80114 | 730 | FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d); |
24330d27 KP |
731 | |
732 | FcResult | |
bff80114 | 733 | FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s); |
24330d27 KP |
734 | |
735 | FcResult | |
bff80114 | 736 | FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s); |
24330d27 KP |
737 | |
738 | FcResult | |
bff80114 | 739 | FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c); |
24330d27 KP |
740 | |
741 | FcResult | |
bff80114 | 742 | FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b); |
24330d27 | 743 | |
d8d73958 | 744 | FcResult |
bff80114 | 745 | FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls); |
d8d73958 | 746 | |
24330d27 KP |
747 | FcPattern * |
748 | FcPatternVaBuild (FcPattern *orig, va_list va); | |
749 | ||
750 | FcPattern * | |
250c1cd4 | 751 | FcPatternBuild (FcPattern *orig, ...) FC_ATTRIBUTE_SENTINEL(0); |
24330d27 KP |
752 | |
753 | /* fcstr.c */ | |
754 | ||
ccb3e93b KP |
755 | FcChar8 * |
756 | FcStrCopy (const FcChar8 *s); | |
24330d27 | 757 | |
179c3995 KP |
758 | FcChar8 * |
759 | FcStrCopyFilename (const FcChar8 *s); | |
760 | ||
479f551f KP |
761 | /* These are ASCII only, suitable only for pattern element names */ |
762 | #define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132)) | |
763 | #define FcIsLower(c) ((0141 <= (c) && (c) <= 0172)) | |
764 | #define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c)) | |
765 | ||
766 | FcChar8 * | |
767 | FcStrDowncase (const FcChar8 *s); | |
24330d27 KP |
768 | |
769 | int | |
ccb3e93b | 770 | FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); |
24330d27 | 771 | |
179c3995 KP |
772 | int |
773 | FcStrCmp (const FcChar8 *s1, const FcChar8 *s2); | |
774 | ||
d4d1e8bc JS |
775 | const FcChar8 * |
776 | FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); | |
777 | ||
778 | const FcChar8 * | |
779 | FcStrStr (const FcChar8 *s1, const FcChar8 *s2); | |
780 | ||
24330d27 | 781 | int |
0f9a306e KP |
782 | FcUtf8ToUcs4 (const FcChar8 *src_orig, |
783 | FcChar32 *dst, | |
784 | int len); | |
24330d27 KP |
785 | |
786 | FcBool | |
0f9a306e KP |
787 | FcUtf8Len (const FcChar8 *string, |
788 | int len, | |
789 | int *nchar, | |
790 | int *wchar); | |
24330d27 | 791 | |
69937bd9 KP |
792 | #define FC_UTF8_MAX_LEN 6 |
793 | ||
794 | int | |
795 | FcUcs4ToUtf8 (FcChar32 ucs4, | |
796 | FcChar8 dest[FC_UTF8_MAX_LEN]); | |
797 | ||
798 | int | |
0f9a306e KP |
799 | FcUtf16ToUcs4 (const FcChar8 *src_orig, |
800 | FcEndian endian, | |
801 | FcChar32 *dst, | |
802 | int len); /* in bytes */ | |
69937bd9 KP |
803 | |
804 | FcBool | |
0f9a306e KP |
805 | FcUtf16Len (const FcChar8 *string, |
806 | FcEndian endian, | |
807 | int len, /* in bytes */ | |
808 | int *nchar, | |
809 | int *wchar); | |
69937bd9 | 810 | |
179c3995 KP |
811 | FcChar8 * |
812 | FcStrDirname (const FcChar8 *file); | |
813 | ||
814 | FcChar8 * | |
815 | FcStrBasename (const FcChar8 *file); | |
816 | ||
817 | FcStrSet * | |
818 | FcStrSetCreate (void); | |
819 | ||
820 | FcBool | |
821 | FcStrSetMember (FcStrSet *set, const FcChar8 *s); | |
822 | ||
d8d73958 KP |
823 | FcBool |
824 | FcStrSetEqual (FcStrSet *sa, FcStrSet *sb); | |
825 | ||
179c3995 KP |
826 | FcBool |
827 | FcStrSetAdd (FcStrSet *set, const FcChar8 *s); | |
828 | ||
829 | FcBool | |
830 | FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s); | |
831 | ||
832 | FcBool | |
833 | FcStrSetDel (FcStrSet *set, const FcChar8 *s); | |
834 | ||
835 | void | |
836 | FcStrSetDestroy (FcStrSet *set); | |
837 | ||
838 | FcStrList * | |
839 | FcStrListCreate (FcStrSet *set); | |
840 | ||
841 | FcChar8 * | |
842 | FcStrListNext (FcStrList *list); | |
843 | ||
844 | void | |
845 | FcStrListDone (FcStrList *list); | |
846 | ||
24330d27 KP |
847 | /* fcxml.c */ |
848 | FcBool | |
ccb3e93b | 849 | FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain); |
24330d27 KP |
850 | |
851 | _FCFUNCPROTOEND | |
852 | ||
250c1cd4 PL |
853 | #undef FC_ATTRIBUTE_SENTINEL |
854 | ||
24330d27 | 855 | #endif /* _FONTCONFIG_H_ */ |