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