]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * $RCSId: xc/lib/fontconfig/src/fcint.h,v 1.27 2002/08/31 22:17:32 keithp Exp $ | |
3 | * | |
4 | * Copyright © 2000 Keith Packard | |
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 _FCINT_H_ | |
26 | #define _FCINT_H_ | |
27 | ||
28 | #include <stdlib.h> | |
29 | #include <stdio.h> | |
30 | #include <stdint.h> | |
31 | #include <string.h> | |
32 | #include <ctype.h> | |
33 | #include <errno.h> | |
34 | #include <unistd.h> | |
35 | #include <sys/types.h> | |
36 | #include <sys/stat.h> | |
37 | #include <time.h> | |
38 | #include <fontconfig/fontconfig.h> | |
39 | #include <fontconfig/fcprivate.h> | |
40 | #include <fontconfig/fcfreetype.h> | |
41 | #ifdef HAVE_CONFIG_H | |
42 | #include <config.h> | |
43 | #endif | |
44 | ||
45 | #ifndef FC_CONFIG_PATH | |
46 | #define FC_CONFIG_PATH "fonts.conf" | |
47 | #endif | |
48 | ||
49 | #define FC_FONT_FILE_INVALID ((FcChar8 *) ".") | |
50 | #define FC_FONT_FILE_DIR ((FcChar8 *) ".dir") | |
51 | ||
52 | #ifdef _WIN32 | |
53 | #define FC_SEARCH_PATH_SEPARATOR ';' | |
54 | #else | |
55 | #define FC_SEARCH_PATH_SEPARATOR ':' | |
56 | #endif | |
57 | ||
58 | #define FC_DBG_MATCH 1 | |
59 | #define FC_DBG_MATCHV 2 | |
60 | #define FC_DBG_EDIT 4 | |
61 | #define FC_DBG_FONTSET 8 | |
62 | #define FC_DBG_CACHE 16 | |
63 | #define FC_DBG_CACHEV 32 | |
64 | #define FC_DBG_PARSE 64 | |
65 | #define FC_DBG_SCAN 128 | |
66 | #define FC_DBG_SCANV 256 | |
67 | #define FC_DBG_MEMORY 512 | |
68 | #define FC_DBG_CONFIG 1024 | |
69 | ||
70 | #define FC_MEM_CHARSET 0 | |
71 | #define FC_MEM_CHARLEAF 1 | |
72 | #define FC_MEM_FONTSET 2 | |
73 | #define FC_MEM_FONTPTR 3 | |
74 | #define FC_MEM_OBJECTSET 4 | |
75 | #define FC_MEM_OBJECTPTR 5 | |
76 | #define FC_MEM_MATRIX 6 | |
77 | #define FC_MEM_PATTERN 7 | |
78 | #define FC_MEM_PATELT 8 | |
79 | #define FC_MEM_VALLIST 9 | |
80 | #define FC_MEM_SUBSTATE 10 | |
81 | #define FC_MEM_STRING 11 | |
82 | #define FC_MEM_LISTBUCK 12 | |
83 | #define FC_MEM_STRSET 13 | |
84 | #define FC_MEM_STRLIST 14 | |
85 | #define FC_MEM_CONFIG 15 | |
86 | #define FC_MEM_LANGSET 16 | |
87 | #define FC_MEM_ATOMIC 17 | |
88 | #define FC_MEM_BLANKS 18 | |
89 | #define FC_MEM_CACHE 19 | |
90 | #define FC_MEM_STRBUF 20 | |
91 | #define FC_MEM_SUBST 21 | |
92 | #define FC_MEM_OBJECTTYPE 22 | |
93 | #define FC_MEM_CONSTANT 23 | |
94 | #define FC_MEM_TEST 24 | |
95 | #define FC_MEM_EXPR 25 | |
96 | #define FC_MEM_VSTACK 26 | |
97 | #define FC_MEM_ATTR 27 | |
98 | #define FC_MEM_PSTACK 28 | |
99 | #define FC_MEM_STATICSTR 29 | |
100 | ||
101 | #define FC_MEM_NUM 30 | |
102 | ||
103 | #define FC_BANK_LANGS 0xfcfcfcfc | |
104 | ||
105 | typedef enum _FcValueBinding { | |
106 | FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame | |
107 | } FcValueBinding; | |
108 | ||
109 | typedef struct _FcValueListPtr { | |
110 | int bank; | |
111 | union { | |
112 | int stat; | |
113 | struct _FcValueList *dyn; | |
114 | } u; | |
115 | } FcValueListPtr; | |
116 | ||
117 | typedef struct _FcValueList { | |
118 | FcValueListPtr next; | |
119 | ||
120 | FcValue value; | |
121 | FcValueBinding binding; | |
122 | } FcValueList; | |
123 | ||
124 | typedef int FcObjectPtr; | |
125 | ||
126 | typedef struct _FcPatternEltPtr { | |
127 | int bank; | |
128 | union { | |
129 | int stat; | |
130 | struct _FcPatternElt *dyn; | |
131 | } u; | |
132 | } FcPatternEltPtr; | |
133 | ||
134 | typedef struct _FcPatternElt { | |
135 | FcObjectPtr object; | |
136 | FcValueListPtr values; | |
137 | } FcPatternElt; | |
138 | ||
139 | struct _FcPattern { | |
140 | int num; | |
141 | int size; | |
142 | FcPatternEltPtr elts; | |
143 | int ref; | |
144 | int bank; | |
145 | }; | |
146 | ||
147 | typedef enum _FcOp { | |
148 | FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet, | |
149 | FcOpNil, | |
150 | FcOpField, FcOpConst, | |
151 | FcOpAssign, FcOpAssignReplace, | |
152 | FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast, | |
153 | FcOpQuest, | |
154 | FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, | |
155 | FcOpContains, FcOpListing, FcOpNotContains, | |
156 | FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual, | |
157 | FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide, | |
158 | FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc, | |
159 | FcOpInvalid | |
160 | } FcOp; | |
161 | ||
162 | typedef struct _FcExpr { | |
163 | FcOp op; | |
164 | union { | |
165 | int ival; | |
166 | double dval; | |
167 | FcChar8 *sval; | |
168 | FcMatrix *mval; | |
169 | FcBool bval; | |
170 | FcCharSet *cval; | |
171 | char *field; | |
172 | FcChar8 *constant; | |
173 | struct { | |
174 | struct _FcExpr *left, *right; | |
175 | } tree; | |
176 | } u; | |
177 | } FcExpr; | |
178 | ||
179 | typedef enum _FcQual { | |
180 | FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst | |
181 | } FcQual; | |
182 | ||
183 | #define FcMatchDefault ((FcMatchKind) -1) | |
184 | ||
185 | typedef struct _FcTest { | |
186 | struct _FcTest *next; | |
187 | FcMatchKind kind; | |
188 | FcQual qual; | |
189 | const char *field; | |
190 | FcOp op; | |
191 | FcExpr *expr; | |
192 | } FcTest; | |
193 | ||
194 | typedef struct _FcEdit { | |
195 | struct _FcEdit *next; | |
196 | const char *field; | |
197 | FcOp op; | |
198 | FcExpr *expr; | |
199 | FcValueBinding binding; | |
200 | } FcEdit; | |
201 | ||
202 | typedef struct _FcSubst { | |
203 | struct _FcSubst *next; | |
204 | FcTest *test; | |
205 | FcEdit *edit; | |
206 | } FcSubst; | |
207 | ||
208 | typedef struct _FcCharLeaf { | |
209 | FcChar32 map[256/32]; | |
210 | } FcCharLeaf; | |
211 | ||
212 | #define FC_REF_CONSTANT -1 | |
213 | ||
214 | struct _FcCharSet { | |
215 | int ref; /* reference count */ | |
216 | int num; /* size of leaves and numbers arrays */ | |
217 | int bank; | |
218 | union { | |
219 | struct { | |
220 | FcCharLeaf **leaves; | |
221 | FcChar16 *numbers; | |
222 | } dyn; | |
223 | struct { | |
224 | int leafidx_offset; | |
225 | int numbers_offset; | |
226 | } stat; | |
227 | } u; | |
228 | }; | |
229 | ||
230 | struct _FcStrSet { | |
231 | int ref; /* reference count */ | |
232 | int num; | |
233 | int size; | |
234 | FcChar8 **strs; | |
235 | }; | |
236 | ||
237 | struct _FcStrList { | |
238 | FcStrSet *set; | |
239 | int n; | |
240 | }; | |
241 | ||
242 | typedef struct _FcStrBuf { | |
243 | FcChar8 *buf; | |
244 | FcBool allocated; | |
245 | FcBool failed; | |
246 | int len; | |
247 | int size; | |
248 | } FcStrBuf; | |
249 | ||
250 | typedef struct _FcCache { | |
251 | int magic; /* 0xFC02FC02 */ | |
252 | int count; /* number of bytes of data in block */ | |
253 | int bank; /* bank ID */ | |
254 | int pattern_count; /* number of FcPatterns */ | |
255 | int patternelt_count; /* number of FcPatternElts */ | |
256 | int valuelist_count; /* number of FcValueLists */ | |
257 | int str_count; /* size of strings appearing as FcValues */ | |
258 | int langset_count; /* number of FcLangSets */ | |
259 | int charset_count; /* number of FcCharSets */ | |
260 | int charset_numbers_count; | |
261 | int charset_leaf_count; | |
262 | int charset_leaf_idx_count; | |
263 | } FcCache; | |
264 | ||
265 | /* | |
266 | * To map adobe glyph names to unicode values, a precomputed hash | |
267 | * table is used | |
268 | */ | |
269 | ||
270 | typedef struct _FcGlyphName { | |
271 | FcChar32 ucs; /* unicode value */ | |
272 | FcChar8 name[1]; /* name extends beyond struct */ | |
273 | } FcGlyphName; | |
274 | ||
275 | /* | |
276 | * To perform case-insensitive string comparisons, a table | |
277 | * is used which holds three different kinds of folding data. | |
278 | * | |
279 | * The first is a range of upper case values mapping to a range | |
280 | * of their lower case equivalents. Within each range, the offset | |
281 | * between upper and lower case is constant. | |
282 | * | |
283 | * The second is a range of upper case values which are interleaved | |
284 | * with their lower case equivalents. | |
285 | * | |
286 | * The third is a set of raw unicode values mapping to a list | |
287 | * of unicode values for comparison purposes. This allows conversion | |
288 | * of ß to "ss" so that SS, ss and ß all match. A separate array | |
289 | * holds the list of unicode values for each entry. | |
290 | * | |
291 | * These are packed into a single table. Using a binary search, | |
292 | * the appropriate entry can be located. | |
293 | */ | |
294 | ||
295 | #define FC_CASE_FOLD_RANGE 0 | |
296 | #define FC_CASE_FOLD_EVEN_ODD 1 | |
297 | #define FC_CASE_FOLD_FULL 2 | |
298 | ||
299 | typedef struct _FcCaseFold { | |
300 | FcChar32 upper; | |
301 | FcChar16 method : 2; | |
302 | FcChar16 count : 14; | |
303 | short offset; /* lower - upper for RANGE, table id for FULL */ | |
304 | } FcCaseFold; | |
305 | ||
306 | #define FC_MAX_FILE_LEN 4096 | |
307 | ||
308 | #define FC_STORAGE_STATIC 0x80 | |
309 | #define fc_value_string(v) (((v)->type & FC_STORAGE_STATIC) ? ((FcChar8 *) v) + (v)->u.s_off : (v) -> u.s) | |
310 | #define fc_value_charset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcCharSet *)(((char *) v) + (v)->u.c_off) : (v) -> u.c) | |
311 | #define fc_value_langset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcLangSet *)(((char *) v) + (v)->u.l_off) : (v) -> u.l) | |
312 | ||
313 | /* | |
314 | * The per-user ~/.fonts.cache-<version> file is loaded into | |
315 | * this data structure. Each directory gets a substructure | |
316 | * which is validated by comparing the directory timestamp with | |
317 | * that saved in the cache. When valid, the entire directory cache | |
318 | * can be immediately loaded without reading the directory. Otherwise, | |
319 | * the files are checked individually; updated files are loaded into the | |
320 | * cache which is then rewritten to the users home directory | |
321 | */ | |
322 | ||
323 | #define FC_CACHE_MAGIC 0xFC02FC02 | |
324 | ||
325 | typedef struct _FcGlobalCacheDir FcGlobalCacheDir; | |
326 | ||
327 | struct _FcGlobalCacheDir { | |
328 | struct _FcGlobalCacheDir *next; | |
329 | char *name; | |
330 | FcCache metadata; | |
331 | off_t offset; | |
332 | void *ent; | |
333 | }; | |
334 | ||
335 | typedef struct _FcGlobalCache { | |
336 | FcGlobalCacheDir *dirs; | |
337 | FcBool updated; | |
338 | int fd; | |
339 | } FcGlobalCache; | |
340 | ||
341 | struct _FcAtomic { | |
342 | FcChar8 *file; /* original file name */ | |
343 | FcChar8 *new; /* temp file name -- write data here */ | |
344 | FcChar8 *lck; /* lockfile name (used for locking) */ | |
345 | FcChar8 *tmp; /* tmpfile name (used for locking) */ | |
346 | }; | |
347 | ||
348 | struct _FcBlanks { | |
349 | int nblank; | |
350 | int sblank; | |
351 | FcChar32 *blanks; | |
352 | }; | |
353 | ||
354 | struct _FcConfig { | |
355 | /* | |
356 | * File names loaded from the configuration -- saved here as the | |
357 | * cache file must be consulted before the directories are scanned, | |
358 | * and those directives may occur in any order | |
359 | */ | |
360 | FcStrSet *configDirs; /* directories to scan for fonts */ | |
361 | FcChar8 *cache; /* name of per-user cache file */ | |
362 | /* | |
363 | * Set of allowed blank chars -- used to | |
364 | * trim fonts of bogus glyphs | |
365 | */ | |
366 | FcBlanks *blanks; | |
367 | /* | |
368 | * List of directories containing fonts, | |
369 | * built by recursively scanning the set | |
370 | * of configured directories | |
371 | */ | |
372 | FcStrSet *fontDirs; | |
373 | /* | |
374 | * Names of all of the configuration files used | |
375 | * to create this configuration | |
376 | */ | |
377 | FcStrSet *configFiles; /* config files loaded */ | |
378 | /* | |
379 | * Substitution instructions for patterns and fonts; | |
380 | * maxObjects is used to allocate appropriate intermediate storage | |
381 | * while performing a whole set of substitutions | |
382 | */ | |
383 | FcSubst *substPattern; /* substitutions for patterns */ | |
384 | FcSubst *substFont; /* substitutions for fonts */ | |
385 | int maxObjects; /* maximum number of tests in all substs */ | |
386 | /* | |
387 | * List of patterns used to control font file selection | |
388 | */ | |
389 | FcStrSet *acceptGlobs; | |
390 | FcStrSet *rejectGlobs; | |
391 | FcFontSet *acceptPatterns; | |
392 | FcFontSet *rejectPatterns; | |
393 | /* | |
394 | * The set of fonts loaded from the listed directories; the | |
395 | * order within the set does not determine the font selection, | |
396 | * except in the case of identical matches in which case earlier fonts | |
397 | * match preferrentially | |
398 | */ | |
399 | FcFontSet *fonts[FcSetApplication + 1]; | |
400 | /* | |
401 | * Fontconfig can periodically rescan the system configuration | |
402 | * and font directories. This rescanning occurs when font | |
403 | * listing requests are made, but no more often than rescanInterval | |
404 | * seconds apart. | |
405 | */ | |
406 | time_t rescanTime; /* last time information was scanned */ | |
407 | int rescanInterval; /* interval between scans */ | |
408 | }; | |
409 | ||
410 | extern FcConfig *_fcConfig; | |
411 | ||
412 | typedef struct _FcFileTime { | |
413 | time_t time; | |
414 | FcBool set; | |
415 | } FcFileTime; | |
416 | ||
417 | typedef struct _FcCharMap FcCharMap; | |
418 | ||
419 | #define ALIGN(v,type) ((__typeof__(v))(((uintptr_t)(v) + __alignof__(type) - 1) & ~(__alignof__(type) - 1))) | |
420 | ||
421 | /* fcblanks.c */ | |
422 | ||
423 | /* fccache.c */ | |
424 | ||
425 | FcGlobalCache * | |
426 | FcGlobalCacheCreate (void); | |
427 | ||
428 | void | |
429 | FcGlobalCacheDestroy (FcGlobalCache *cache); | |
430 | ||
431 | FcBool | |
432 | FcGlobalCacheReadDir (FcFontSet *set, | |
433 | FcStrSet *dirs, | |
434 | FcGlobalCache *cache, | |
435 | const char *dir, | |
436 | FcConfig *config); | |
437 | ||
438 | void | |
439 | FcGlobalCacheLoad (FcGlobalCache *cache, | |
440 | FcStrSet *staleDirs, | |
441 | const FcChar8 *cache_file, | |
442 | FcConfig *config); | |
443 | ||
444 | FcBool | |
445 | FcGlobalCacheUpdate (FcGlobalCache *cache, | |
446 | const char *file, | |
447 | FcFontSet *set); | |
448 | ||
449 | FcBool | |
450 | FcGlobalCacheSave (FcGlobalCache *cache, | |
451 | const FcChar8 *cache_file); | |
452 | ||
453 | FcFontSet * | |
454 | FcCacheRead (FcConfig *config, FcGlobalCache * cache); | |
455 | ||
456 | FcBool | |
457 | FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir); | |
458 | ||
459 | FcBool | |
460 | FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir); | |
461 | ||
462 | int | |
463 | FcCacheBankToIndex (int bank); | |
464 | ||
465 | const char * | |
466 | FcCacheFindBankDir (int bank); | |
467 | ||
468 | /* fccfg.c */ | |
469 | ||
470 | FcBool | |
471 | FcConfigAddConfigDir (FcConfig *config, | |
472 | const FcChar8 *d); | |
473 | ||
474 | FcBool | |
475 | FcConfigAddFontDir (FcConfig *config, | |
476 | const FcChar8 *d); | |
477 | ||
478 | FcBool | |
479 | FcConfigAddDir (FcConfig *config, | |
480 | const FcChar8 *d); | |
481 | ||
482 | FcBool | |
483 | FcConfigAddConfigFile (FcConfig *config, | |
484 | const FcChar8 *f); | |
485 | ||
486 | FcBool | |
487 | FcConfigSetCache (FcConfig *config, | |
488 | const FcChar8 *c); | |
489 | ||
490 | FcBool | |
491 | FcConfigAddBlank (FcConfig *config, | |
492 | FcChar32 blank); | |
493 | ||
494 | FcBool | |
495 | FcConfigAddEdit (FcConfig *config, | |
496 | FcTest *test, | |
497 | FcEdit *edit, | |
498 | FcMatchKind kind); | |
499 | ||
500 | void | |
501 | FcConfigSetFonts (FcConfig *config, | |
502 | FcFontSet *fonts, | |
503 | FcSetName set); | |
504 | ||
505 | FcBool | |
506 | FcConfigCompareValue (const FcValue *m, | |
507 | FcOp op, | |
508 | const FcValue *v); | |
509 | ||
510 | FcBool | |
511 | FcConfigGlobAdd (FcConfig *config, | |
512 | const FcChar8 *glob, | |
513 | FcBool accept); | |
514 | ||
515 | FcBool | |
516 | FcConfigAcceptFilename (FcConfig *config, | |
517 | const FcChar8 *filename); | |
518 | ||
519 | FcBool | |
520 | FcConfigPatternsAdd (FcConfig *config, | |
521 | FcPattern *pattern, | |
522 | FcBool accept); | |
523 | ||
524 | FcBool | |
525 | FcConfigAcceptFont (FcConfig *config, | |
526 | const FcPattern *font); | |
527 | ||
528 | FcFileTime | |
529 | FcConfigModifiedTime (FcConfig *config); | |
530 | ||
531 | /* fccharset.c */ | |
532 | void | |
533 | FcLangCharSetPopulate (void); | |
534 | ||
535 | FcCharSet * | |
536 | FcCharSetFreeze (FcCharSet *cs); | |
537 | ||
538 | void | |
539 | FcCharSetThawAll (void); | |
540 | ||
541 | FcBool | |
542 | FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c); | |
543 | ||
544 | FcCharSet * | |
545 | FcNameParseCharSet (FcChar8 *string); | |
546 | ||
547 | FcCharLeaf * | |
548 | FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4); | |
549 | ||
550 | void | |
551 | FcCharSetNewBank (void); | |
552 | ||
553 | int | |
554 | FcCharSetNeededBytes (const FcCharSet *c); | |
555 | ||
556 | int | |
557 | FcCharSetNeededBytesAlign (void); | |
558 | ||
559 | void * | |
560 | FcCharSetDistributeBytes (FcCache * metadata, | |
561 | void * block_ptr); | |
562 | ||
563 | FcCharSet * | |
564 | FcCharSetSerialize(int bank, FcCharSet *c); | |
565 | ||
566 | void * | |
567 | FcCharSetUnserialize (FcCache metadata, void *block_ptr); | |
568 | ||
569 | FcCharLeaf * | |
570 | FcCharSetGetLeaf(const FcCharSet *c, int i); | |
571 | ||
572 | FcChar16 * | |
573 | FcCharSetGetNumbers(const FcCharSet *c); | |
574 | ||
575 | /* fcdbg.c */ | |
576 | void | |
577 | FcValueListPrint (const FcValueListPtr l); | |
578 | ||
579 | void | |
580 | FcLangSetPrint (const FcLangSet *ls); | |
581 | ||
582 | void | |
583 | FcOpPrint (FcOp op); | |
584 | ||
585 | void | |
586 | FcTestPrint (const FcTest *test); | |
587 | ||
588 | void | |
589 | FcExprPrint (const FcExpr *expr); | |
590 | ||
591 | void | |
592 | FcEditPrint (const FcEdit *edit); | |
593 | ||
594 | void | |
595 | FcSubstPrint (const FcSubst *subst); | |
596 | ||
597 | extern int FcDebugVal; | |
598 | ||
599 | static __inline__ int | |
600 | FcDebug (void) { return FcDebugVal; } | |
601 | ||
602 | void | |
603 | FcInitDebug (void); | |
604 | ||
605 | /* fcdefault.c */ | |
606 | FcChar8 * | |
607 | FcGetDefaultLang (void); | |
608 | ||
609 | /* fcdir.c */ | |
610 | ||
611 | FcBool | |
612 | FcFileIsDir (const FcChar8 *file); | |
613 | ||
614 | FcBool | |
615 | FcFileScanConfig (FcFontSet *set, | |
616 | FcStrSet *dirs, | |
617 | FcFileCache *cache, | |
618 | FcBlanks *blanks, | |
619 | const FcChar8 *file, | |
620 | FcBool force, | |
621 | FcConfig *config); | |
622 | ||
623 | FcBool | |
624 | FcDirScanConfig (FcFontSet *set, | |
625 | FcStrSet *dirs, | |
626 | FcFileCache *cache, | |
627 | FcBlanks *blanks, | |
628 | const FcChar8 *dir, | |
629 | FcBool force, | |
630 | FcConfig *config); | |
631 | ||
632 | /* fcfont.c */ | |
633 | int | |
634 | FcFontDebug (void); | |
635 | ||
636 | /* fcfreetype.c */ | |
637 | FcBool | |
638 | FcFreeTypeIsExclusiveLang (const FcChar8 *lang); | |
639 | ||
640 | FcBool | |
641 | FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang); | |
642 | ||
643 | FcChar32 | |
644 | FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map); | |
645 | ||
646 | FcChar32 | |
647 | FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map); | |
648 | ||
649 | const FcCharMap * | |
650 | FcFreeTypeGetPrivateMap (FT_Encoding encoding); | |
651 | ||
652 | /* fcfs.c */ | |
653 | ||
654 | void | |
655 | FcFontSetNewBank (void); | |
656 | ||
657 | int | |
658 | FcFontSetNeededBytes (FcFontSet *s); | |
659 | ||
660 | int | |
661 | FcFontSetNeededBytesAlign (void); | |
662 | ||
663 | void * | |
664 | FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr); | |
665 | ||
666 | FcBool | |
667 | FcFontSetSerialize (int bank, FcFontSet * s); | |
668 | ||
669 | FcBool | |
670 | FcFontSetUnserialize(FcCache metadata, FcFontSet * s, void * block_ptr); | |
671 | ||
672 | /* fcgram.y */ | |
673 | int | |
674 | FcConfigparse (void); | |
675 | ||
676 | int | |
677 | FcConfigwrap (void); | |
678 | ||
679 | void | |
680 | FcConfigerror (char *fmt, ...); | |
681 | ||
682 | char * | |
683 | FcConfigSaveField (const char *field); | |
684 | ||
685 | void | |
686 | FcTestDestroy (FcTest *test); | |
687 | ||
688 | FcExpr * | |
689 | FcExprCreateInteger (int i); | |
690 | ||
691 | FcExpr * | |
692 | FcExprCreateDouble (double d); | |
693 | ||
694 | FcExpr * | |
695 | FcExprCreateString (const FcChar8 *s); | |
696 | ||
697 | FcExpr * | |
698 | FcExprCreateMatrix (const FcMatrix *m); | |
699 | ||
700 | FcExpr * | |
701 | FcExprCreateBool (FcBool b); | |
702 | ||
703 | FcExpr * | |
704 | FcExprCreateNil (void); | |
705 | ||
706 | FcExpr * | |
707 | FcExprCreateField (const char *field); | |
708 | ||
709 | FcExpr * | |
710 | FcExprCreateConst (const FcChar8 *constant); | |
711 | ||
712 | FcExpr * | |
713 | FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right); | |
714 | ||
715 | void | |
716 | FcExprDestroy (FcExpr *e); | |
717 | ||
718 | void | |
719 | FcEditDestroy (FcEdit *e); | |
720 | ||
721 | /* fcinit.c */ | |
722 | ||
723 | void | |
724 | FcMemReport (void); | |
725 | ||
726 | void | |
727 | FcMemAlloc (int kind, int size); | |
728 | ||
729 | void | |
730 | FcMemFree (int kind, int size); | |
731 | ||
732 | /* fclang.c */ | |
733 | FcLangSet * | |
734 | FcFreeTypeLangSet (const FcCharSet *charset, | |
735 | const FcChar8 *exclusiveLang); | |
736 | ||
737 | FcLangResult | |
738 | FcLangCompare (const FcChar8 *s1, const FcChar8 *s2); | |
739 | ||
740 | const FcCharSet * | |
741 | FcCharSetForLang (const FcChar8 *lang); | |
742 | ||
743 | FcLangSet * | |
744 | FcLangSetPromote (const FcChar8 *lang); | |
745 | ||
746 | FcLangSet * | |
747 | FcNameParseLangSet (const FcChar8 *string); | |
748 | ||
749 | FcBool | |
750 | FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls); | |
751 | ||
752 | void | |
753 | FcLangSetNewBank (void); | |
754 | ||
755 | int | |
756 | FcLangSetNeededBytes (const FcLangSet *l); | |
757 | ||
758 | int | |
759 | FcLangSetNeededBytesAlign (void); | |
760 | ||
761 | void * | |
762 | FcLangSetDistributeBytes (FcCache * metadata, | |
763 | void * block_ptr); | |
764 | ||
765 | FcLangSet * | |
766 | FcLangSetSerialize (int bank, FcLangSet *l); | |
767 | ||
768 | void * | |
769 | FcLangSetUnserialize (FcCache metadata, void *block_ptr); | |
770 | ||
771 | /* fclist.c */ | |
772 | ||
773 | FcBool | |
774 | FcListPatternMatchAny (const FcPattern *p, | |
775 | const FcPattern *font); | |
776 | ||
777 | /* fcmatch.c */ | |
778 | ||
779 | /* fcname.c */ | |
780 | ||
781 | FcBool | |
782 | FcNameBool (const FcChar8 *v, FcBool *result); | |
783 | ||
784 | void * | |
785 | FcObjectDistributeBytes (FcCache * metadata, | |
786 | void * block_ptr); | |
787 | ||
788 | FcObjectPtr | |
789 | FcObjectToPtr (const char * si); | |
790 | ||
791 | int | |
792 | FcObjectNeededBytes (void); | |
793 | ||
794 | int | |
795 | FcObjectNeededBytesAlign (void); | |
796 | ||
797 | void * | |
798 | FcObjectUnserialize (FcCache metadata, void *block_ptr); | |
799 | ||
800 | void | |
801 | FcObjectSerialize (void); | |
802 | ||
803 | const char * | |
804 | FcObjectPtrU (FcObjectPtr p); | |
805 | ||
806 | int | |
807 | FcObjectPtrCompare (FcObjectPtr a, FcObjectPtr b); | |
808 | ||
809 | void | |
810 | FcObjectStaticNameFini (void); | |
811 | ||
812 | /* fcpat.c */ | |
813 | ||
814 | FcValue | |
815 | FcValueCanonicalize (const FcValue *v); | |
816 | ||
817 | void | |
818 | FcValueListDestroy (FcValueListPtr l); | |
819 | ||
820 | FcPatternElt * | |
821 | FcPatternFindElt (const FcPattern *p, const char *object); | |
822 | ||
823 | FcPatternElt * | |
824 | FcPatternInsertElt (FcPattern *p, const char *object); | |
825 | ||
826 | FcBool | |
827 | FcPatternAddWithBinding (FcPattern *p, | |
828 | const char *object, | |
829 | FcValue value, | |
830 | FcValueBinding binding, | |
831 | FcBool append); | |
832 | ||
833 | FcPattern * | |
834 | FcPatternFreeze (FcPattern *p); | |
835 | ||
836 | void | |
837 | FcPatternFini (void); | |
838 | ||
839 | FcBool | |
840 | FcPatternAppend (FcPattern *p, FcPattern *s); | |
841 | ||
842 | void | |
843 | FcPatternAddFullFname (const FcPattern *p, const char *fname); | |
844 | ||
845 | void | |
846 | FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig); | |
847 | ||
848 | const FcChar8 * | |
849 | FcStrStaticName (const FcChar8 *name); | |
850 | ||
851 | FcChar32 | |
852 | FcStringHash (const FcChar8 *s); | |
853 | ||
854 | void | |
855 | FcPatternNewBank (void); | |
856 | ||
857 | int | |
858 | FcPatternNeededBytes (FcPattern *p); | |
859 | ||
860 | int | |
861 | FcPatternNeededBytesAlign (void); | |
862 | ||
863 | void * | |
864 | FcPatternDistributeBytes (FcCache * metadata, void * block_ptr); | |
865 | ||
866 | FcValueList * | |
867 | FcValueListPtrU(FcValueListPtr p); | |
868 | ||
869 | FcPatternElt * | |
870 | FcPatternEltU (FcPatternEltPtr pei); | |
871 | ||
872 | FcValueListPtr | |
873 | FcValueListPtrCreateDynamic(FcValueList * p); | |
874 | ||
875 | FcPattern * | |
876 | FcPatternSerialize (int bank, FcPattern * p); | |
877 | ||
878 | void * | |
879 | FcPatternUnserialize (FcCache metadata, void *block_ptr); | |
880 | ||
881 | /* fcrender.c */ | |
882 | ||
883 | /* fcmatrix.c */ | |
884 | ||
885 | extern const FcMatrix FcIdentityMatrix; | |
886 | ||
887 | void | |
888 | FcMatrixFree (FcMatrix *mat); | |
889 | ||
890 | /* fcstr.c */ | |
891 | void | |
892 | FcStrSetSort (FcStrSet * set); | |
893 | ||
894 | FcChar8 * | |
895 | FcStrPlus (const FcChar8 *s1, const FcChar8 *s2); | |
896 | ||
897 | void | |
898 | FcStrFree (FcChar8 *s); | |
899 | ||
900 | void | |
901 | FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size); | |
902 | ||
903 | void | |
904 | FcStrBufDestroy (FcStrBuf *buf); | |
905 | ||
906 | FcChar8 * | |
907 | FcStrBufDone (FcStrBuf *buf); | |
908 | ||
909 | FcBool | |
910 | FcStrBufChar (FcStrBuf *buf, FcChar8 c); | |
911 | ||
912 | FcBool | |
913 | FcStrBufString (FcStrBuf *buf, const FcChar8 *s); | |
914 | ||
915 | FcBool | |
916 | FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len); | |
917 | ||
918 | int | |
919 | FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); | |
920 | ||
921 | const FcChar8 * | |
922 | FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); | |
923 | ||
924 | const FcChar8 * | |
925 | FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); | |
926 | ||
927 | FcBool | |
928 | FcStrUsesHome (const FcChar8 *s); | |
929 | ||
930 | FcChar8 * | |
931 | FcStrLastSlash (const FcChar8 *path); | |
932 | ||
933 | FcChar32 | |
934 | FcStrHashIgnoreCase (const FcChar8 *s); | |
935 | ||
936 | #endif /* _FC_INT_H_ */ |