]>
Commit | Line | Data |
---|---|---|
24330d27 | 1 | /* |
793e946c | 2 | * $RCSId: xc/lib/fontconfig/src/fcint.h,v 1.27 2002/08/31 22:17:32 keithp Exp $ |
24330d27 | 3 | * |
46b51147 | 4 | * Copyright © 2000 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 _FCINT_H_ | |
26 | #define _FCINT_H_ | |
27 | ||
91fe51b4 PL |
28 | #ifdef HAVE_CONFIG_H |
29 | #include <config.h> | |
30 | #endif | |
31 | ||
24330d27 KP |
32 | #include <stdlib.h> |
33 | #include <stdio.h> | |
dc70c15a PL |
34 | #ifdef HAVE_INTTYPES_H |
35 | #include <inttypes.h> | |
91fe51b4 | 36 | #elif defined(HAVE_STDINT_H) |
7fd7221e | 37 | #include <stdint.h> |
91fe51b4 PL |
38 | #else |
39 | #error missing C99 integer data types | |
dc70c15a | 40 | #endif |
24330d27 KP |
41 | #include <string.h> |
42 | #include <ctype.h> | |
43 | #include <errno.h> | |
44 | #include <unistd.h> | |
45 | #include <sys/types.h> | |
46 | #include <sys/stat.h> | |
179c3995 | 47 | #include <time.h> |
24330d27 KP |
48 | #include <fontconfig/fontconfig.h> |
49 | #include <fontconfig/fcprivate.h> | |
be094850 | 50 | #include <fontconfig/fcfreetype.h> |
24330d27 | 51 | |
24330d27 KP |
52 | #ifndef FC_CONFIG_PATH |
53 | #define FC_CONFIG_PATH "fonts.conf" | |
54 | #endif | |
55 | ||
179c3995 KP |
56 | #define FC_FONT_FILE_INVALID ((FcChar8 *) ".") |
57 | #define FC_FONT_FILE_DIR ((FcChar8 *) ".dir") | |
c60ec7cc | 58 | #define FC_GLOBAL_MAGIC_COOKIE "GLOBAL" |
179c3995 | 59 | |
daeed6e0 TL |
60 | #ifdef _WIN32 |
61 | #define FC_SEARCH_PATH_SEPARATOR ';' | |
62 | #else | |
63 | #define FC_SEARCH_PATH_SEPARATOR ':' | |
64 | #endif | |
65 | ||
24330d27 KP |
66 | #define FC_DBG_MATCH 1 |
67 | #define FC_DBG_MATCHV 2 | |
68 | #define FC_DBG_EDIT 4 | |
69 | #define FC_DBG_FONTSET 8 | |
70 | #define FC_DBG_CACHE 16 | |
71 | #define FC_DBG_CACHEV 32 | |
72 | #define FC_DBG_PARSE 64 | |
73 | #define FC_DBG_SCAN 128 | |
4c003605 | 74 | #define FC_DBG_SCANV 256 |
24330d27 | 75 | #define FC_DBG_MEMORY 512 |
2d9c79c0 | 76 | #define FC_DBG_CONFIG 1024 |
7ce19673 | 77 | #define FC_DBG_LANGSET 2048 |
24330d27 KP |
78 | |
79 | #define FC_MEM_CHARSET 0 | |
d8d73958 | 80 | #define FC_MEM_CHARLEAF 1 |
24330d27 KP |
81 | #define FC_MEM_FONTSET 2 |
82 | #define FC_MEM_FONTPTR 3 | |
83 | #define FC_MEM_OBJECTSET 4 | |
84 | #define FC_MEM_OBJECTPTR 5 | |
85 | #define FC_MEM_MATRIX 6 | |
86 | #define FC_MEM_PATTERN 7 | |
87 | #define FC_MEM_PATELT 8 | |
88 | #define FC_MEM_VALLIST 9 | |
89 | #define FC_MEM_SUBSTATE 10 | |
90 | #define FC_MEM_STRING 11 | |
91 | #define FC_MEM_LISTBUCK 12 | |
d8d73958 KP |
92 | #define FC_MEM_STRSET 13 |
93 | #define FC_MEM_STRLIST 14 | |
94 | #define FC_MEM_CONFIG 15 | |
95 | #define FC_MEM_LANGSET 16 | |
9dac3c59 KP |
96 | #define FC_MEM_ATOMIC 17 |
97 | #define FC_MEM_BLANKS 18 | |
98 | #define FC_MEM_CACHE 19 | |
99 | #define FC_MEM_STRBUF 20 | |
100 | #define FC_MEM_SUBST 21 | |
101 | #define FC_MEM_OBJECTTYPE 22 | |
102 | #define FC_MEM_CONSTANT 23 | |
103 | #define FC_MEM_TEST 24 | |
104 | #define FC_MEM_EXPR 25 | |
105 | #define FC_MEM_VSTACK 26 | |
106 | #define FC_MEM_ATTR 27 | |
107 | #define FC_MEM_PSTACK 28 | |
1c52c0f0 | 108 | #define FC_MEM_STATICSTR 29 |
d8d73958 | 109 | |
1c52c0f0 | 110 | #define FC_MEM_NUM 30 |
24330d27 | 111 | |
1c9fdcca PL |
112 | #define FC_BANK_DYNAMIC 0 |
113 | #define FC_BANK_FIRST 1 | |
82f35f8b PL |
114 | #define FC_BANK_LANGS 0xfcfcfcfc |
115 | ||
4c003605 | 116 | typedef enum _FcValueBinding { |
dda7794f | 117 | FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame |
4c003605 KP |
118 | } FcValueBinding; |
119 | ||
7ce19673 KP |
120 | /* |
121 | * Serialized data structures use only offsets instead of pointers | |
122 | * A low bit of 1 indicates an offset. | |
123 | */ | |
124 | ||
125 | /* Is the provided pointer actually an offset? */ | |
126 | #define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0) | |
cd2ec1a9 | 127 | |
7ce19673 KP |
128 | /* Encode offset in a pointer of type t */ |
129 | #define FcOffsetEncode(o,t) ((t *) ((o) | 1)) | |
130 | ||
131 | /* Decode a pointer into an offset */ | |
132 | #define FcOffsetDecode(p) (((intptr_t) (p)) & ~1) | |
133 | ||
134 | /* Compute pointer offset */ | |
135 | #define FcPtrToOffset(b,p) ((intptr_t) (p) - (intptr_t) (b)) | |
136 | ||
137 | /* Given base address, offset and type, return a pointer */ | |
138 | #define FcOffsetToPtr(b,o,t) ((t *) ((intptr_t) (b) + (o))) | |
139 | ||
140 | /* Given base address, encoded offset and type, return a pointer */ | |
141 | #define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t) | |
cd2ec1a9 | 142 | |
7ce19673 KP |
143 | /* Given base address, pointer and type, return an encoded offset */ |
144 | #define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t) | |
145 | ||
146 | /* Given a structure, offset member and type, return pointer */ | |
147 | #define FcOffsetMember(s,m,t) FcOffsetToPtr(s,(s)->m,t) | |
148 | ||
149 | /* Given a structure, encoded offset member and type, return pointer to member */ | |
150 | #define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t) | |
151 | ||
152 | /* Given a structure, member and type, convert the member to a pointer */ | |
153 | #define FcPointerMember(s,m,t) (FcIsEncodedOffset((s)->m) ? \ | |
154 | FcEncodedOffsetMember (s,m,t) : \ | |
155 | (s)->m) | |
156 | ||
157 | /* | |
158 | * Serialized values may hold strings, charsets and langsets as pointers, | |
159 | * unfortunately FcValue is an exposed type so we can't just always use | |
160 | * offsets | |
161 | */ | |
162 | #define FcValueString(v) FcPointerMember(v,u.s,FcChar8) | |
163 | #define FcValueCharSet(v) FcPointerMember(v,u.c,const FcCharSet) | |
164 | #define FcValueLangSet(v) FcPointerMember(v,u.l,const FcLangSet) | |
165 | ||
166 | typedef struct _FcValueList *FcValueListPtr; | |
167 | ||
168 | typedef struct _FcValueList { | |
169 | struct _FcValueList *next; | |
170 | FcValue value; | |
171 | FcValueBinding binding; | |
24330d27 KP |
172 | } FcValueList; |
173 | ||
7ce19673 KP |
174 | #define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList) |
175 | ||
176 | typedef int FcObject; | |
4262e0b3 | 177 | |
7ce19673 | 178 | typedef struct _FcPatternElt *FcPatternEltPtr; |
cd2ec1a9 | 179 | |
7ce19673 KP |
180 | /* |
181 | * Pattern elts are stuck in a structure connected to the pattern, | |
182 | * so they get moved around when the pattern is resized. Hence, the | |
183 | * values field must be a pointer/offset instead of just an offset | |
184 | */ | |
24330d27 | 185 | typedef struct _FcPatternElt { |
7ce19673 KP |
186 | FcObject object; |
187 | FcValueList *values; | |
24330d27 KP |
188 | } FcPatternElt; |
189 | ||
7ce19673 KP |
190 | #define FcPatternEltValues(pe) FcPointerMember(pe,values,FcValueList) |
191 | ||
24330d27 KP |
192 | struct _FcPattern { |
193 | int num; | |
194 | int size; | |
7ce19673 | 195 | intptr_t elts_offset; |
e709ddfa | 196 | int ref; |
24330d27 KP |
197 | }; |
198 | ||
7ce19673 KP |
199 | #define FcPatternElts(p) FcOffsetMember(p,elts_offset,FcPatternElt) |
200 | ||
201 | #define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *) | |
202 | /* | |
203 | #define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \ | |
204 | FcOffsetToPtr(FcFontSetFonts(fs), \ | |
205 | FcFontSetFonts(fs)[i]) : \ | |
206 | fs->fonts[i])*/ | |
207 | ||
24330d27 KP |
208 | typedef enum _FcOp { |
209 | FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet, | |
210 | FcOpNil, | |
211 | FcOpField, FcOpConst, | |
212 | FcOpAssign, FcOpAssignReplace, | |
213 | FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast, | |
214 | FcOpQuest, | |
74a623e0 KP |
215 | FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, |
216 | FcOpContains, FcOpListing, FcOpNotContains, | |
24330d27 KP |
217 | FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual, |
218 | FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide, | |
3f7653c2 KP |
219 | FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc, |
220 | FcOpInvalid | |
24330d27 KP |
221 | } FcOp; |
222 | ||
223 | typedef struct _FcExpr { | |
224 | FcOp op; | |
225 | union { | |
226 | int ival; | |
227 | double dval; | |
ccb3e93b | 228 | FcChar8 *sval; |
24330d27 KP |
229 | FcMatrix *mval; |
230 | FcBool bval; | |
231 | FcCharSet *cval; | |
7ce19673 | 232 | FcObject object; |
ccb3e93b | 233 | FcChar8 *constant; |
24330d27 KP |
234 | struct { |
235 | struct _FcExpr *left, *right; | |
236 | } tree; | |
237 | } u; | |
238 | } FcExpr; | |
239 | ||
240 | typedef enum _FcQual { | |
6f6563ed | 241 | FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst |
24330d27 KP |
242 | } FcQual; |
243 | ||
938bc633 KP |
244 | #define FcMatchDefault ((FcMatchKind) -1) |
245 | ||
24330d27 KP |
246 | typedef struct _FcTest { |
247 | struct _FcTest *next; | |
938bc633 | 248 | FcMatchKind kind; |
24330d27 | 249 | FcQual qual; |
7ce19673 | 250 | FcObject object; |
24330d27 KP |
251 | FcOp op; |
252 | FcExpr *expr; | |
253 | } FcTest; | |
254 | ||
255 | typedef struct _FcEdit { | |
256 | struct _FcEdit *next; | |
7ce19673 | 257 | FcObject object; |
24330d27 KP |
258 | FcOp op; |
259 | FcExpr *expr; | |
6fff2cda | 260 | FcValueBinding binding; |
24330d27 KP |
261 | } FcEdit; |
262 | ||
263 | typedef struct _FcSubst { | |
264 | struct _FcSubst *next; | |
265 | FcTest *test; | |
266 | FcEdit *edit; | |
267 | } FcSubst; | |
268 | ||
20ac65ab | 269 | typedef struct _FcCharLeaf { |
24330d27 | 270 | FcChar32 map[256/32]; |
20ac65ab | 271 | } FcCharLeaf; |
24330d27 | 272 | |
d8d73958 | 273 | #define FC_REF_CONSTANT -1 |
82f4243f | 274 | |
24330d27 | 275 | struct _FcCharSet { |
24330d27 | 276 | int ref; /* reference count */ |
20ac65ab | 277 | int num; /* size of leaves and numbers arrays */ |
7ce19673 KP |
278 | intptr_t leaves_offset; |
279 | intptr_t numbers_offset; | |
24330d27 KP |
280 | }; |
281 | ||
7ce19673 KP |
282 | #define FcCharSetLeaves(c) FcOffsetMember(c,leaves_offset,intptr_t) |
283 | #define FcCharSetLeaf(c,i) (FcOffsetToPtr(FcCharSetLeaves(c), \ | |
284 | FcCharSetLeaves(c)[i], \ | |
285 | FcCharLeaf)) | |
286 | #define FcCharSetNumbers(c) FcOffsetMember(c,numbers_offset,FcChar16) | |
287 | ||
179c3995 KP |
288 | struct _FcStrSet { |
289 | int ref; /* reference count */ | |
290 | int num; | |
291 | int size; | |
4262e0b3 | 292 | FcChar8 **strs; |
179c3995 KP |
293 | }; |
294 | ||
295 | struct _FcStrList { | |
296 | FcStrSet *set; | |
297 | int n; | |
298 | }; | |
299 | ||
c2e7c611 | 300 | typedef struct _FcStrBuf { |
24330d27 KP |
301 | FcChar8 *buf; |
302 | FcBool allocated; | |
303 | FcBool failed; | |
304 | int len; | |
305 | int size; | |
c2e7c611 | 306 | } FcStrBuf; |
24330d27 | 307 | |
212c9f43 | 308 | typedef struct _FcCache { |
7ce19673 KP |
309 | int magic; /* FC_CACHE_MAGIC */ |
310 | off_t size; /* size of file */ | |
311 | intptr_t dir; /* offset to dir name */ | |
312 | intptr_t dirs; /* offset to subdirs */ | |
313 | int dirs_count; /* number of subdir strings */ | |
314 | intptr_t set; /* offset to font set */ | |
212c9f43 PL |
315 | } FcCache; |
316 | ||
7ce19673 KP |
317 | #define FcCacheDir(c) FcOffsetMember(c,dir,FcChar8) |
318 | #define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t) | |
319 | #define FcCacheSet(c) FcOffsetMember(c,set,FcFontSet) | |
320 | ||
321 | /* | |
322 | * Used while constructing a directory cache object | |
323 | */ | |
324 | ||
325 | #define FC_SERIALIZE_HASH_SIZE 8191 | |
326 | ||
327 | typedef struct _FcSerializeBucket { | |
328 | struct _FcSerializeBucket *next; | |
329 | const void *object; | |
330 | intptr_t offset; | |
331 | } FcSerializeBucket; | |
332 | ||
333 | typedef struct _FcSerialize { | |
334 | intptr_t size; | |
335 | void *linear; | |
336 | FcSerializeBucket *buckets[FC_SERIALIZE_HASH_SIZE]; | |
337 | } FcSerialize; | |
338 | ||
7769c321 KP |
339 | /* |
340 | * To map adobe glyph names to unicode values, a precomputed hash | |
341 | * table is used | |
342 | */ | |
343 | ||
344 | typedef struct _FcGlyphName { | |
345 | FcChar32 ucs; /* unicode value */ | |
346 | FcChar8 name[1]; /* name extends beyond struct */ | |
347 | } FcGlyphName; | |
348 | ||
192296d8 KP |
349 | /* |
350 | * To perform case-insensitive string comparisons, a table | |
351 | * is used which holds three different kinds of folding data. | |
352 | * | |
353 | * The first is a range of upper case values mapping to a range | |
354 | * of their lower case equivalents. Within each range, the offset | |
355 | * between upper and lower case is constant. | |
356 | * | |
357 | * The second is a range of upper case values which are interleaved | |
358 | * with their lower case equivalents. | |
359 | * | |
360 | * The third is a set of raw unicode values mapping to a list | |
361 | * of unicode values for comparison purposes. This allows conversion | |
362 | * of ß to "ss" so that SS, ss and ß all match. A separate array | |
363 | * holds the list of unicode values for each entry. | |
364 | * | |
365 | * These are packed into a single table. Using a binary search, | |
366 | * the appropriate entry can be located. | |
367 | */ | |
368 | ||
369 | #define FC_CASE_FOLD_RANGE 0 | |
370 | #define FC_CASE_FOLD_EVEN_ODD 1 | |
371 | #define FC_CASE_FOLD_FULL 2 | |
372 | ||
373 | typedef struct _FcCaseFold { | |
374 | FcChar32 upper; | |
375 | FcChar16 method : 2; | |
376 | FcChar16 count : 14; | |
377 | short offset; /* lower - upper for RANGE, table id for FULL */ | |
378 | } FcCaseFold; | |
379 | ||
2d9c79c0 KP |
380 | #define FC_MAX_FILE_LEN 4096 |
381 | ||
7ce19673 KP |
382 | /* XXX remove these when we're ready */ |
383 | ||
384 | #define fc_value_string(v) FcValueString(v) | |
385 | #define fc_value_charset(v) FcValueCharSet(v) | |
386 | #define fc_value_langset(v) FcValueLangSet(v) | |
387 | #define fc_storage_type(v) ((v)->type) | |
4262e0b3 | 388 | |
44415a07 PL |
389 | #define fc_alignof(type) offsetof (struct { char c; type member; }, member) |
390 | ||
7ce19673 KP |
391 | #define FC_CACHE_MAGIC 0xFC02FC04 |
392 | #define FC_CACHE_MAGIC_COPY 0xFC02FC05 | |
327a7fd4 | 393 | |
134f6011 KP |
394 | struct _FcAtomic { |
395 | FcChar8 *file; /* original file name */ | |
396 | FcChar8 *new; /* temp file name -- write data here */ | |
397 | FcChar8 *lck; /* lockfile name (used for locking) */ | |
398 | FcChar8 *tmp; /* tmpfile name (used for locking) */ | |
399 | }; | |
400 | ||
24330d27 KP |
401 | struct _FcBlanks { |
402 | int nblank; | |
403 | int sblank; | |
404 | FcChar32 *blanks; | |
405 | }; | |
406 | ||
407 | struct _FcConfig { | |
408 | /* | |
409 | * File names loaded from the configuration -- saved here as the | |
410 | * cache file must be consulted before the directories are scanned, | |
411 | * and those directives may occur in any order | |
412 | */ | |
179c3995 | 413 | FcStrSet *configDirs; /* directories to scan for fonts */ |
ccb3e93b | 414 | FcChar8 *cache; /* name of per-user cache file */ |
24330d27 KP |
415 | /* |
416 | * Set of allowed blank chars -- used to | |
417 | * trim fonts of bogus glyphs | |
418 | */ | |
419 | FcBlanks *blanks; | |
179c3995 KP |
420 | /* |
421 | * List of directories containing fonts, | |
422 | * built by recursively scanning the set | |
423 | * of configured directories | |
424 | */ | |
425 | FcStrSet *fontDirs; | |
7410e40b PL |
426 | /* |
427 | * List of directories containing cache files. | |
428 | */ | |
429 | FcStrSet *cacheDirs; | |
24330d27 KP |
430 | /* |
431 | * Names of all of the configuration files used | |
432 | * to create this configuration | |
433 | */ | |
179c3995 | 434 | FcStrSet *configFiles; /* config files loaded */ |
24330d27 KP |
435 | /* |
436 | * Substitution instructions for patterns and fonts; | |
437 | * maxObjects is used to allocate appropriate intermediate storage | |
438 | * while performing a whole set of substitutions | |
439 | */ | |
440 | FcSubst *substPattern; /* substitutions for patterns */ | |
441 | FcSubst *substFont; /* substitutions for fonts */ | |
442 | int maxObjects; /* maximum number of tests in all substs */ | |
d47c9d6e KP |
443 | /* |
444 | * List of patterns used to control font file selection | |
445 | */ | |
446 | FcStrSet *acceptGlobs; | |
447 | FcStrSet *rejectGlobs; | |
4f27c1c0 KP |
448 | FcFontSet *acceptPatterns; |
449 | FcFontSet *rejectPatterns; | |
24330d27 KP |
450 | /* |
451 | * The set of fonts loaded from the listed directories; the | |
452 | * order within the set does not determine the font selection, | |
453 | * except in the case of identical matches in which case earlier fonts | |
454 | * match preferrentially | |
455 | */ | |
456 | FcFontSet *fonts[FcSetApplication + 1]; | |
179c3995 KP |
457 | /* |
458 | * Fontconfig can periodically rescan the system configuration | |
459 | * and font directories. This rescanning occurs when font | |
460 | * listing requests are made, but no more often than rescanInterval | |
461 | * seconds apart. | |
462 | */ | |
463 | time_t rescanTime; /* last time information was scanned */ | |
464 | int rescanInterval; /* interval between scans */ | |
24330d27 KP |
465 | }; |
466 | ||
6e9fc5de KP |
467 | extern FcConfig *_fcConfig; |
468 | ||
2b25f00c PL |
469 | typedef struct _FcFileTime { |
470 | time_t time; | |
471 | FcBool set; | |
472 | } FcFileTime; | |
473 | ||
69937bd9 KP |
474 | typedef struct _FcCharMap FcCharMap; |
475 | ||
44415a07 PL |
476 | /* watch out; assumes that v is void * -PL */ |
477 | #define ALIGN(v,type) ((void *)(((uintptr_t)(v) + fc_alignof(type) - 1) & ~(fc_alignof(type) - 1))) | |
7fd7221e | 478 | |
24330d27 KP |
479 | /* fcblanks.c */ |
480 | ||
481 | /* fccache.c */ | |
482 | ||
4262e0b3 | 483 | FcFontSet * |
00f059e9 | 484 | FcCacheRead (FcConfig *config); |
24330d27 KP |
485 | |
486 | FcBool | |
7410e40b | 487 | FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config); |
4262e0b3 | 488 | |
af180c40 KP |
489 | FcBool |
490 | FcDirCacheConsume (FILE *file, FcFontSet *set, FcStrSet *dirs, | |
491 | const FcChar8 *dir, char *dirname); | |
492 | ||
2eb84374 | 493 | FcBool |
cd9bca69 | 494 | FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config); |
212c9f43 | 495 | |
24330d27 KP |
496 | /* fccfg.c */ |
497 | ||
179c3995 KP |
498 | FcBool |
499 | FcConfigAddConfigDir (FcConfig *config, | |
500 | const FcChar8 *d); | |
501 | ||
502 | FcBool | |
503 | FcConfigAddFontDir (FcConfig *config, | |
504 | const FcChar8 *d); | |
505 | ||
24330d27 | 506 | FcBool |
ccb3e93b KP |
507 | FcConfigAddDir (FcConfig *config, |
508 | const FcChar8 *d); | |
24330d27 | 509 | |
7410e40b PL |
510 | FcBool |
511 | FcConfigAddCacheDir (FcConfig *config, | |
512 | const FcChar8 *d); | |
513 | ||
514 | FcStrList * | |
515 | FcConfigGetCacheDirs (FcConfig *config); | |
516 | ||
24330d27 | 517 | FcBool |
ccb3e93b KP |
518 | FcConfigAddConfigFile (FcConfig *config, |
519 | const FcChar8 *f); | |
24330d27 KP |
520 | |
521 | FcBool | |
522 | FcConfigSetCache (FcConfig *config, | |
ccb3e93b | 523 | const FcChar8 *c); |
24330d27 KP |
524 | |
525 | FcBool | |
526 | FcConfigAddBlank (FcConfig *config, | |
527 | FcChar32 blank); | |
528 | ||
529 | FcBool | |
530 | FcConfigAddEdit (FcConfig *config, | |
531 | FcTest *test, | |
532 | FcEdit *edit, | |
533 | FcMatchKind kind); | |
534 | ||
535 | void | |
536 | FcConfigSetFonts (FcConfig *config, | |
537 | FcFontSet *fonts, | |
538 | FcSetName set); | |
539 | ||
540 | FcBool | |
4262e0b3 | 541 | FcConfigCompareValue (const FcValue *m, |
24330d27 | 542 | FcOp op, |
4262e0b3 | 543 | const FcValue *v); |
24330d27 | 544 | |
d47c9d6e KP |
545 | FcBool |
546 | FcConfigGlobAdd (FcConfig *config, | |
547 | const FcChar8 *glob, | |
548 | FcBool accept); | |
549 | ||
550 | FcBool | |
551 | FcConfigAcceptFilename (FcConfig *config, | |
552 | const FcChar8 *filename); | |
553 | ||
4f27c1c0 KP |
554 | FcBool |
555 | FcConfigPatternsAdd (FcConfig *config, | |
556 | FcPattern *pattern, | |
557 | FcBool accept); | |
558 | ||
559 | FcBool | |
560 | FcConfigAcceptFont (FcConfig *config, | |
561 | const FcPattern *font); | |
562 | ||
2b25f00c PL |
563 | FcFileTime |
564 | FcConfigModifiedTime (FcConfig *config); | |
565 | ||
7ce19673 KP |
566 | intptr_t |
567 | FcAlignSize (intptr_t size); | |
568 | ||
569 | FcSerialize * | |
570 | FcSerializeCreate (void); | |
571 | ||
572 | void | |
573 | FcSerializeDestroy (FcSerialize *serialize); | |
574 | ||
575 | FcBool | |
576 | FcSerializeAlloc (FcSerialize *serialize, const void *object, int size); | |
577 | ||
578 | intptr_t | |
579 | FcSerializeReserve (FcSerialize *serialize, int size); | |
580 | ||
581 | intptr_t | |
582 | FcSerializeOffset (FcSerialize *serialize, const void *object); | |
583 | ||
584 | void * | |
585 | FcSerializePtr (FcSerialize *serialize, const void *object); | |
586 | ||
587 | FcBool | |
588 | FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l); | |
589 | ||
590 | FcLangSet * | |
591 | FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l); | |
592 | ||
24330d27 | 593 | /* fccharset.c */ |
82f35f8b PL |
594 | void |
595 | FcLangCharSetPopulate (void); | |
596 | ||
4c003605 KP |
597 | FcCharSet * |
598 | FcCharSetFreeze (FcCharSet *cs); | |
599 | ||
34cd0514 CW |
600 | void |
601 | FcCharSetThawAll (void); | |
602 | ||
24330d27 | 603 | FcBool |
c2e7c611 | 604 | FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c); |
24330d27 KP |
605 | |
606 | FcCharSet * | |
607 | FcNameParseCharSet (FcChar8 *string); | |
608 | ||
c647f6f1 KP |
609 | FcCharLeaf * |
610 | FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4); | |
69937bd9 | 611 | |
7ce19673 KP |
612 | FcBool |
613 | FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs); | |
cd2ec1a9 | 614 | |
4262e0b3 | 615 | FcCharSet * |
7ce19673 | 616 | FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs); |
cd2ec1a9 PL |
617 | |
618 | FcChar16 * | |
619 | FcCharSetGetNumbers(const FcCharSet *c); | |
620 | ||
24330d27 | 621 | /* fcdbg.c */ |
24330d27 | 622 | void |
cd2ec1a9 | 623 | FcValueListPrint (const FcValueListPtr l); |
24330d27 | 624 | |
793e946c KP |
625 | void |
626 | FcLangSetPrint (const FcLangSet *ls); | |
627 | ||
24330d27 KP |
628 | void |
629 | FcOpPrint (FcOp op); | |
630 | ||
631 | void | |
938bc633 | 632 | FcTestPrint (const FcTest *test); |
24330d27 KP |
633 | |
634 | void | |
938bc633 | 635 | FcExprPrint (const FcExpr *expr); |
24330d27 KP |
636 | |
637 | void | |
938bc633 | 638 | FcEditPrint (const FcEdit *edit); |
24330d27 KP |
639 | |
640 | void | |
938bc633 | 641 | FcSubstPrint (const FcSubst *subst); |
24330d27 | 642 | |
7ce19673 KP |
643 | void |
644 | FcCharSetPrint (const FcCharSet *c); | |
645 | ||
b97a34b5 PL |
646 | extern int FcDebugVal; |
647 | ||
44415a07 | 648 | static inline int |
b97a34b5 PL |
649 | FcDebug (void) { return FcDebugVal; } |
650 | ||
651 | void | |
652 | FcInitDebug (void); | |
24330d27 | 653 | |
90442681 PL |
654 | /* fcdefault.c */ |
655 | FcChar8 * | |
656 | FcGetDefaultLang (void); | |
657 | ||
24330d27 | 658 | /* fcdir.c */ |
24330d27 | 659 | |
2d9c79c0 KP |
660 | FcBool |
661 | FcFileIsDir (const FcChar8 *file); | |
662 | ||
d47c9d6e KP |
663 | FcBool |
664 | FcFileScanConfig (FcFontSet *set, | |
665 | FcStrSet *dirs, | |
d47c9d6e KP |
666 | FcBlanks *blanks, |
667 | const FcChar8 *file, | |
668 | FcBool force, | |
669 | FcConfig *config); | |
670 | ||
671 | FcBool | |
672 | FcDirScanConfig (FcFontSet *set, | |
673 | FcStrSet *dirs, | |
d47c9d6e KP |
674 | FcBlanks *blanks, |
675 | const FcChar8 *dir, | |
676 | FcBool force, | |
677 | FcConfig *config); | |
678 | ||
24330d27 KP |
679 | /* fcfont.c */ |
680 | int | |
681 | FcFontDebug (void); | |
682 | ||
82f4243f | 683 | /* fcfreetype.c */ |
e50b9ae7 KP |
684 | FcBool |
685 | FcFreeTypeIsExclusiveLang (const FcChar8 *lang); | |
686 | ||
82f4243f KP |
687 | FcBool |
688 | FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang); | |
689 | ||
c647f6f1 KP |
690 | FcChar32 |
691 | FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map); | |
692 | ||
693 | FcChar32 | |
694 | FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map); | |
695 | ||
696 | const FcCharMap * | |
697 | FcFreeTypeGetPrivateMap (FT_Encoding encoding); | |
698 | ||
24330d27 | 699 | /* fcfs.c */ |
cd2ec1a9 | 700 | |
212c9f43 | 701 | FcBool |
7ce19673 | 702 | FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s); |
212c9f43 | 703 | |
7ce19673 KP |
704 | FcFontSet * |
705 | FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s); | |
706 | ||
24330d27 KP |
707 | /* fcgram.y */ |
708 | int | |
709 | FcConfigparse (void); | |
710 | ||
711 | int | |
712 | FcConfigwrap (void); | |
713 | ||
714 | void | |
715 | FcConfigerror (char *fmt, ...); | |
716 | ||
717 | char * | |
718 | FcConfigSaveField (const char *field); | |
719 | ||
24330d27 KP |
720 | void |
721 | FcTestDestroy (FcTest *test); | |
722 | ||
723 | FcExpr * | |
724 | FcExprCreateInteger (int i); | |
725 | ||
726 | FcExpr * | |
727 | FcExprCreateDouble (double d); | |
728 | ||
729 | FcExpr * | |
ccb3e93b | 730 | FcExprCreateString (const FcChar8 *s); |
24330d27 KP |
731 | |
732 | FcExpr * | |
733 | FcExprCreateMatrix (const FcMatrix *m); | |
734 | ||
735 | FcExpr * | |
736 | FcExprCreateBool (FcBool b); | |
737 | ||
738 | FcExpr * | |
739 | FcExprCreateNil (void); | |
740 | ||
741 | FcExpr * | |
742 | FcExprCreateField (const char *field); | |
743 | ||
744 | FcExpr * | |
ccb3e93b | 745 | FcExprCreateConst (const FcChar8 *constant); |
24330d27 KP |
746 | |
747 | FcExpr * | |
748 | FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right); | |
749 | ||
750 | void | |
751 | FcExprDestroy (FcExpr *e); | |
752 | ||
24330d27 KP |
753 | void |
754 | FcEditDestroy (FcEdit *e); | |
755 | ||
756 | /* fcinit.c */ | |
757 | ||
758 | void | |
759 | FcMemReport (void); | |
760 | ||
761 | void | |
762 | FcMemAlloc (int kind, int size); | |
763 | ||
764 | void | |
765 | FcMemFree (int kind, int size); | |
766 | ||
82f4243f | 767 | /* fclang.c */ |
d8d73958 KP |
768 | FcLangSet * |
769 | FcFreeTypeLangSet (const FcCharSet *charset, | |
e50b9ae7 | 770 | const FcChar8 *exclusiveLang); |
82f4243f KP |
771 | |
772 | FcLangResult | |
773 | FcLangCompare (const FcChar8 *s1, const FcChar8 *s2); | |
774 | ||
775 | const FcCharSet * | |
776 | FcCharSetForLang (const FcChar8 *lang); | |
777 | ||
d8d73958 KP |
778 | FcLangSet * |
779 | FcLangSetPromote (const FcChar8 *lang); | |
780 | ||
781 | FcLangSet * | |
782 | FcNameParseLangSet (const FcChar8 *string); | |
783 | ||
784 | FcBool | |
785 | FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls); | |
786 | ||
24330d27 KP |
787 | /* fclist.c */ |
788 | ||
4f27c1c0 KP |
789 | FcBool |
790 | FcListPatternMatchAny (const FcPattern *p, | |
791 | const FcPattern *font); | |
792 | ||
24330d27 KP |
793 | /* fcmatch.c */ |
794 | ||
795 | /* fcname.c */ | |
24330d27 | 796 | |
7ce19673 KP |
797 | /* |
798 | * NOTE -- this ordering is part of the cache file format. | |
799 | * It must also match the ordering in fcname.c | |
800 | */ | |
4262e0b3 | 801 | |
7ce19673 KP |
802 | #define FC_FAMILY_OBJECT 1 |
803 | #define FC_FAMILYLANG_OBJECT 2 | |
804 | #define FC_STYLE_OBJECT 3 | |
805 | #define FC_STYLELANG_OBJECT 4 | |
806 | #define FC_FULLNAME_OBJECT 5 | |
807 | #define FC_FULLNAMELANG_OBJECT 6 | |
808 | #define FC_SLANT_OBJECT 7 | |
809 | #define FC_WEIGHT_OBJECT 8 | |
810 | #define FC_WIDTH_OBJECT 9 | |
811 | #define FC_SIZE_OBJECT 10 | |
812 | #define FC_ASPECT_OBJECT 11 | |
813 | #define FC_PIXEL_SIZE_OBJECT 12 | |
814 | #define FC_SPACING_OBJECT 13 | |
815 | #define FC_FOUNDRY_OBJECT 14 | |
816 | #define FC_ANTIALIAS_OBJECT 15 | |
817 | #define FC_HINT_STYLE_OBJECT 16 | |
818 | #define FC_HINTING_OBJECT 17 | |
819 | #define FC_VERTICAL_LAYOUT_OBJECT 18 | |
820 | #define FC_AUTOHINT_OBJECT 19 | |
821 | #define FC_GLOBAL_ADVANCE_OBJECT 20 | |
822 | #define FC_FILE_OBJECT 21 | |
823 | #define FC_INDEX_OBJECT 22 | |
824 | #define FC_RASTERIZER_OBJECT 23 | |
825 | #define FC_OUTLINE_OBJECT 24 | |
826 | #define FC_SCALABLE_OBJECT 25 | |
827 | #define FC_DPI_OBJECT 26 | |
828 | #define FC_RGBA_OBJECT 27 | |
829 | #define FC_SCALE_OBJECT 28 | |
830 | #define FC_MINSPACE_OBJECT 29 | |
831 | #define FC_CHAR_WIDTH_OBJECT 30 | |
832 | #define FC_CHAR_HEIGHT_OBJECT 31 | |
833 | #define FC_MATRIX_OBJECT 32 | |
834 | #define FC_CHARSET_OBJECT 33 | |
835 | #define FC_LANG_OBJECT 34 | |
836 | #define FC_FONTVERSION_OBJECT 35 | |
837 | #define FC_CAPABILITY_OBJECT 36 | |
838 | #define FC_FONTFORMAT_OBJECT 37 | |
839 | #define FC_EMBOLDEN_OBJECT 38 | |
840 | #define FC_EMBEDDED_BITMAP_OBJECT 39 | |
7f37423d | 841 | |
7ce19673 KP |
842 | FcBool |
843 | FcNameBool (const FcChar8 *v, FcBool *result); | |
7fd7221e | 844 | |
7ce19673 KP |
845 | FcBool |
846 | FcObjectValidType (FcObject object, FcType type); | |
4262e0b3 | 847 | |
7ce19673 KP |
848 | FcObject |
849 | FcObjectFromName (const char * name); | |
4262e0b3 | 850 | |
7f37423d | 851 | const char * |
7ce19673 | 852 | FcObjectName (FcObject object); |
7f37423d | 853 | |
7ce19673 | 854 | #define FcObjectCompare(a, b) ((int) a - (int) b) |
7f37423d PL |
855 | |
856 | void | |
857 | FcObjectStaticNameFini (void); | |
4262e0b3 | 858 | |
24330d27 | 859 | /* fcpat.c */ |
4262e0b3 PL |
860 | |
861 | FcValue | |
862 | FcValueCanonicalize (const FcValue *v); | |
863 | ||
24330d27 | 864 | void |
cd2ec1a9 PL |
865 | FcValueListDestroy (FcValueListPtr l); |
866 | ||
24330d27 | 867 | FcPatternElt * |
7ce19673 | 868 | FcPatternObjectFindElt (const FcPattern *p, FcObject object); |
e9be9cd1 KP |
869 | |
870 | FcPatternElt * | |
7ce19673 | 871 | FcPatternObjectInsertElt (FcPattern *p, FcObject object); |
24330d27 | 872 | |
82f4243f | 873 | FcBool |
7ce19673 KP |
874 | FcPatternObjectAddWithBinding (FcPattern *p, |
875 | FcObject object, | |
876 | FcValue value, | |
877 | FcValueBinding binding, | |
878 | FcBool append); | |
82f4243f | 879 | |
7ce19673 KP |
880 | FcBool |
881 | FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append); | |
882 | ||
883 | FcBool | |
884 | FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append); | |
885 | ||
886 | FcResult | |
887 | FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v); | |
888 | ||
889 | FcBool | |
890 | FcPatternObjectDel (FcPattern *p, FcObject object); | |
34cd0514 | 891 | |
4f27c1c0 | 892 | FcBool |
7ce19673 | 893 | FcPatternObjectRemove (FcPattern *p, FcObject object, int id); |
4f27c1c0 | 894 | |
7ce19673 KP |
895 | FcBool |
896 | FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i); | |
cd2ec1a9 | 897 | |
7ce19673 KP |
898 | FcBool |
899 | FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d); | |
cd2ec1a9 | 900 | |
7ce19673 KP |
901 | FcBool |
902 | FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s); | |
cd2ec1a9 | 903 | |
7ce19673 KP |
904 | FcBool |
905 | FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s); | |
cd2ec1a9 | 906 | |
7ce19673 KP |
907 | FcBool |
908 | FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c); | |
7fd7221e | 909 | |
7ce19673 KP |
910 | FcBool |
911 | FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b); | |
cd2ec1a9 | 912 | |
7ce19673 KP |
913 | FcBool |
914 | FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls); | |
915 | ||
916 | FcResult | |
917 | FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i); | |
918 | ||
919 | FcResult | |
920 | FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d); | |
9ab79bdf | 921 | |
7ce19673 KP |
922 | FcResult |
923 | FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s); | |
9ab79bdf | 924 | |
7ce19673 KP |
925 | FcResult |
926 | FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s); | |
9ab79bdf | 927 | |
7ce19673 KP |
928 | FcResult |
929 | FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c); | |
9ab79bdf | 930 | |
7ce19673 KP |
931 | FcResult |
932 | FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b); | |
cd2ec1a9 | 933 | |
7ce19673 KP |
934 | FcResult |
935 | FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls); | |
936 | ||
937 | void | |
938 | FcPatternFini (void); | |
939 | ||
940 | FcBool | |
941 | FcPatternAppend (FcPattern *p, FcPattern *s); | |
942 | ||
943 | const FcChar8 * | |
944 | FcStrStaticName (const FcChar8 *name); | |
945 | ||
946 | FcChar32 | |
947 | FcStringHash (const FcChar8 *s); | |
948 | ||
949 | FcBool | |
950 | FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat); | |
cd2ec1a9 | 951 | |
cd2ec1a9 | 952 | FcPattern * |
7ce19673 | 953 | FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat); |
212c9f43 | 954 | |
7ce19673 KP |
955 | FcBool |
956 | FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat); | |
957 | ||
958 | FcValueList * | |
959 | FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat); | |
212c9f43 | 960 | |
24330d27 KP |
961 | /* fcrender.c */ |
962 | ||
963 | /* fcmatrix.c */ | |
327a7fd4 | 964 | |
4262e0b3 | 965 | extern const FcMatrix FcIdentityMatrix; |
327a7fd4 | 966 | |
24330d27 KP |
967 | void |
968 | FcMatrixFree (FcMatrix *mat); | |
969 | ||
970 | /* fcstr.c */ | |
cd2ec1a9 PL |
971 | void |
972 | FcStrSetSort (FcStrSet * set); | |
973 | ||
ccb3e93b KP |
974 | FcChar8 * |
975 | FcStrPlus (const FcChar8 *s1, const FcChar8 *s2); | |
24330d27 KP |
976 | |
977 | void | |
ccb3e93b | 978 | FcStrFree (FcChar8 *s); |
24330d27 | 979 | |
c2e7c611 KP |
980 | void |
981 | FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size); | |
982 | ||
983 | void | |
984 | FcStrBufDestroy (FcStrBuf *buf); | |
985 | ||
986 | FcChar8 * | |
987 | FcStrBufDone (FcStrBuf *buf); | |
988 | ||
989 | FcBool | |
990 | FcStrBufChar (FcStrBuf *buf, FcChar8 c); | |
991 | ||
992 | FcBool | |
993 | FcStrBufString (FcStrBuf *buf, const FcChar8 *s); | |
994 | ||
995 | FcBool | |
996 | FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len); | |
997 | ||
82f4243f KP |
998 | int |
999 | FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); | |
1000 | ||
11fec41c KP |
1001 | const FcChar8 * |
1002 | FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); | |
1003 | ||
1004 | const FcChar8 * | |
1005 | FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); | |
1006 | ||
ff3f1f98 KP |
1007 | FcBool |
1008 | FcStrUsesHome (const FcChar8 *s); | |
1009 | ||
daeed6e0 TL |
1010 | FcChar8 * |
1011 | FcStrLastSlash (const FcChar8 *path); | |
1012 | ||
192296d8 KP |
1013 | FcChar32 |
1014 | FcStrHashIgnoreCase (const FcChar8 *s); | |
1015 | ||
0d9e31c8 KP |
1016 | FcChar8 * |
1017 | FcStrCanonFilename (const FcChar8 *s); | |
1018 | ||
7ce19673 KP |
1019 | FcBool |
1020 | FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str); | |
1021 | ||
1022 | FcChar8 * | |
1023 | FcStrSerialize (FcSerialize *serialize, const FcChar8 *str); | |
1024 | ||
24330d27 | 1025 | #endif /* _FC_INT_H_ */ |