]> git.wh0rd.org - fontconfig.git/blob - fontconfig/fontconfig.h
Add FcMatchScan to resolve Delicious font matching issues (bug #6769)
[fontconfig.git] / fontconfig / fontconfig.h
1 /*
2 * $RCSId: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.30 2002/09/26 00:17:27 keithp Exp $
3 *
4 * Copyright © 2001 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 _FONTCONFIG_H_
26 #define _FONTCONFIG_H_
27
28 #include <stdarg.h>
29
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
36 typedef unsigned char FcChar8;
37 typedef unsigned short FcChar16;
38 typedef unsigned int FcChar32;
39 typedef int FcBool;
40
41 /*
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.
45 */
46
47 #define FC_MAJOR 2
48 #define FC_MINOR 3
49 #define FC_REVISION 95
50
51 #define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
52
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
63 #define FC_CACHE_VERSION "2"
64
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 */
73 #define FC_ASPECT "aspect" /* Double */
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) */
79 #define FC_HINT_STYLE "hintstyle" /* Int */
80 #define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
81 #define FC_AUTOHINT "autohint" /* Bool (false) */
82 #define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
83 #define FC_WIDTH "width" /* Int */
84 #define FC_FILE "file" /* String */
85 #define FC_INDEX "index" /* Int */
86 #define FC_FT_FACE "ftface" /* FT_Face */
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 */
94 #define FC_SOURCE "source" /* String (deprecated) */
95 #define FC_CHARSET "charset" /* CharSet */
96 #define FC_LANG "lang" /* String RFC 3066 langs */
97 #define FC_FONTVERSION "fontversion" /* Int from 'head' table */
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 */
102 #define FC_CAPABILITY "capability" /* String */
103 #define FC_FONTFORMAT "fontformat" /* String */
104 #define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/
105 #define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */
106 #define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */
107
108 #define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION
109 #define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION
110 #define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION
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
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
121 #define FC_WEIGHT_BOOK 75
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
129 #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
130 #define FC_WEIGHT_BLACK 210
131 #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
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
148 #define FC_DUAL 90
149 #define FC_MONO 100
150 #define FC_CHARCELL 110
151
152 /* sub-pixel order */
153 #define FC_RGBA_UNKNOWN 0
154 #define FC_RGBA_RGB 1
155 #define FC_RGBA_BGR 2
156 #define FC_RGBA_VRGB 3
157 #define FC_RGBA_VBGR 4
158 #define FC_RGBA_NONE 5
159
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
166 typedef enum _FcType {
167 FcTypeVoid,
168 FcTypeInteger,
169 FcTypeDouble,
170 FcTypeString,
171 FcTypeBool,
172 FcTypeMatrix,
173 FcTypeCharSet,
174 FcTypeFTFace,
175 FcTypeLangSet
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 {
198 const FcChar8 *name;
199 const char *object;
200 int value;
201 } FcConstant;
202
203 typedef enum _FcResult {
204 FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
205 FcResultOutOfMemory
206 } FcResult;
207
208 typedef struct _FcPattern FcPattern;
209
210 typedef struct _FcLangSet FcLangSet;
211
212 typedef struct _FcValue {
213 FcType type;
214 union {
215 const FcChar8 *s;
216 int i;
217 FcBool b;
218 double d;
219 const FcMatrix *m;
220 const FcCharSet *c;
221 void *f;
222 const FcPattern *p;
223 const FcLangSet *l;
224 } u;
225 } FcValue;
226
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;
236 const char **objects;
237 } FcObjectSet;
238
239 typedef enum _FcMatchKind {
240 FcMatchPattern, FcMatchFont, FcMatchScan
241 } FcMatchKind;
242
243 typedef enum _FcLangResult {
244 FcLangEqual, FcLangDifferentCountry, FcLangDifferentLang
245 } FcLangResult;
246
247 typedef enum _FcSetName {
248 FcSetSystem = 0,
249 FcSetApplication = 1
250 } FcSetName;
251
252 typedef struct _FcAtomic FcAtomic;
253
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
262 typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
263
264 typedef struct _FcConfig FcConfig;
265
266 typedef struct _FcGlobalCache FcFileCache;
267
268 typedef struct _FcBlanks FcBlanks;
269
270 typedef struct _FcStrList FcStrList;
271
272 typedef struct _FcStrSet FcStrSet;
273
274 _FCFUNCPROTOBEGIN
275
276 FcBool
277 FcDirCacheValid (const FcChar8 *cache_file);
278
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 */
293 FcChar8 *
294 FcConfigHome (void);
295
296 FcBool
297 FcConfigEnableHome (FcBool enable);
298
299 FcChar8 *
300 FcConfigFilename (const FcChar8 *url);
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
314 FcBool
315 FcConfigUptoDate (FcConfig *config);
316
317 FcBool
318 FcConfigBuildFonts (FcConfig *config);
319
320 FcStrList *
321 FcConfigGetFontDirs (FcConfig *config);
322
323 FcStrList *
324 FcConfigGetConfigDirs (FcConfig *config);
325
326 FcStrList *
327 FcConfigGetConfigFiles (FcConfig *config);
328
329 FcChar8 *
330 FcConfigGetCache (FcConfig *config);
331
332 FcBlanks *
333 FcConfigGetBlanks (FcConfig *config);
334
335 int
336 FcConfigGetRescanInverval (FcConfig *config);
337
338 FcBool
339 FcConfigSetRescanInverval (FcConfig *config, int rescanInterval);
340
341 FcFontSet *
342 FcConfigGetFonts (FcConfig *config,
343 FcSetName set);
344
345 FcBool
346 FcConfigAppFontAddFile (FcConfig *config,
347 const FcChar8 *file);
348
349 FcBool
350 FcConfigAppFontAddDir (FcConfig *config,
351 const FcChar8 *dir);
352
353 void
354 FcConfigAppFontClear (FcConfig *config);
355
356 FcBool
357 FcConfigSubstituteWithPat (FcConfig *config,
358 FcPattern *p,
359 FcPattern *p_pat,
360 FcMatchKind kind);
361
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
404 FcBool
405 FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
406
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
415 FcChar32
416 FcCharSetNextPage (const FcCharSet *a,
417 FcChar32 map[FC_CHARSET_MAP_SIZE],
418 FcChar32 *next);
419
420
421 /* fcdbg.c */
422 void
423 FcValuePrint (const FcValue v);
424
425 void
426 FcPatternPrint (const FcPattern *p);
427
428 void
429 FcFontSetPrint (const FcFontSet *s);
430
431 /* fcdefault.c */
432 void
433 FcDefaultSubstitute (FcPattern *pattern);
434
435 /* fcdir.c */
436 FcBool
437 FcFileScan (FcFontSet *set,
438 FcStrSet *dirs,
439 FcFileCache *cache,
440 FcBlanks *blanks,
441 const FcChar8 *file,
442 FcBool force);
443
444 FcBool
445 FcDirScan (FcFontSet *set,
446 FcStrSet *dirs,
447 FcFileCache *cache,
448 FcBlanks *blanks,
449 const FcChar8 *dir,
450 FcBool force);
451
452 FcBool
453 FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
454
455 /* fcfreetype.c */
456 FcPattern *
457 FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
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 */
471 FcConfig *
472 FcInitLoadConfig (void);
473
474 FcConfig *
475 FcInitLoadConfigAndFonts (void);
476
477 FcBool
478 FcInit (void);
479
480 void
481 FcFini (void);
482
483 int
484 FcGetVersion (void);
485
486 FcBool
487 FcInitReinitialize (void);
488
489 FcBool
490 FcInitBringUptoDate (void);
491
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
511 FcBool
512 FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
513
514 FcBool
515 FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
516
517 FcChar32
518 FcLangSetHash (const FcLangSet *ls);
519
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 *
534 FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
535
536 FcFontSet *
537 FcFontSetList (FcConfig *config,
538 FcFontSet **sets,
539 int nsets,
540 FcPattern *p,
541 FcObjectSet *os);
542
543 FcFontSet *
544 FcFontList (FcConfig *config,
545 FcPattern *p,
546 FcObjectSet *os);
547
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
574 /* fcmatch.c */
575 FcPattern *
576 FcFontSetMatch (FcConfig *config,
577 FcFontSet **sets,
578 int nsets,
579 FcPattern *p,
580 FcResult *result);
581
582 FcPattern *
583 FcFontMatch (FcConfig *config,
584 FcPattern *p,
585 FcResult *result);
586
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
601 FcFontSet *
602 FcFontSort (FcConfig *config,
603 FcPattern *p,
604 FcBool trim,
605 FcCharSet **csp,
606 FcResult *result);
607
608 void
609 FcFontSetSortDestroy (FcFontSet *fs);
610
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 *
648 FcNameGetConstant (FcChar8 *string);
649
650 FcBool
651 FcNameConstant (FcChar8 *string, int *result);
652
653 FcPattern *
654 FcNameParse (const FcChar8 *name);
655
656 FcChar8 *
657 FcNameUnparse (FcPattern *pat);
658
659 /* fcpat.c */
660 FcPattern *
661 FcPatternCreate (void);
662
663 FcPattern *
664 FcPatternDuplicate (const FcPattern *p);
665
666 void
667 FcPatternReference (FcPattern *p);
668
669 void
670 FcValueDestroy (FcValue v);
671
672 FcBool
673 FcValueEqual (FcValue va, FcValue vb);
674
675 FcValue
676 FcValueSave (FcValue v);
677
678 void
679 FcPatternDestroy (FcPattern *p);
680
681 FcBool
682 FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
683
684 FcBool
685 FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
686
687 FcChar32
688 FcPatternHash (const FcPattern *p);
689
690 FcBool
691 FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
692
693 FcBool
694 FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
695
696 FcResult
697 FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
698
699 FcBool
700 FcPatternDel (FcPattern *p, const char *object);
701
702 FcBool
703 FcPatternRemove (FcPattern *p, const char *object, int id);
704
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
712 FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
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
723 FcBool
724 FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
725
726 FcResult
727 FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
728
729 FcResult
730 FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
731
732 FcResult
733 FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
734
735 FcResult
736 FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
737
738 FcResult
739 FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
740
741 FcResult
742 FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
743
744 FcResult
745 FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
746
747 FcPattern *
748 FcPatternVaBuild (FcPattern *orig, va_list va);
749
750 FcPattern *
751 FcPatternBuild (FcPattern *orig, ...) FC_ATTRIBUTE_SENTINEL(0);
752
753 /* fcstr.c */
754
755 FcChar8 *
756 FcStrCopy (const FcChar8 *s);
757
758 FcChar8 *
759 FcStrCopyFilename (const FcChar8 *s);
760
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);
768
769 int
770 FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
771
772 int
773 FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
774
775 const FcChar8 *
776 FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
777
778 const FcChar8 *
779 FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
780
781 int
782 FcUtf8ToUcs4 (const FcChar8 *src_orig,
783 FcChar32 *dst,
784 int len);
785
786 FcBool
787 FcUtf8Len (const FcChar8 *string,
788 int len,
789 int *nchar,
790 int *wchar);
791
792 #define FC_UTF8_MAX_LEN 6
793
794 int
795 FcUcs4ToUtf8 (FcChar32 ucs4,
796 FcChar8 dest[FC_UTF8_MAX_LEN]);
797
798 int
799 FcUtf16ToUcs4 (const FcChar8 *src_orig,
800 FcEndian endian,
801 FcChar32 *dst,
802 int len); /* in bytes */
803
804 FcBool
805 FcUtf16Len (const FcChar8 *string,
806 FcEndian endian,
807 int len, /* in bytes */
808 int *nchar,
809 int *wchar);
810
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
823 FcBool
824 FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
825
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
847 /* fcxml.c */
848 FcBool
849 FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
850
851 _FCFUNCPROTOEND
852
853 #undef FC_ATTRIBUTE_SENTINEL
854
855 #endif /* _FONTCONFIG_H_ */