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