]> git.wh0rd.org - fontconfig.git/blame_incremental - fontconfig/fontconfig.h
Remove all .cvsignore files
[fontconfig.git] / fontconfig / fontconfig.h
... / ...
CommitLineData
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
36typedef unsigned char FcChar8;
37typedef unsigned short FcChar16;
38typedef unsigned int FcChar32;
39typedef 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 96
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
166typedef enum _FcType {
167 FcTypeVoid,
168 FcTypeInteger,
169 FcTypeDouble,
170 FcTypeString,
171 FcTypeBool,
172 FcTypeMatrix,
173 FcTypeCharSet,
174 FcTypeFTFace,
175 FcTypeLangSet
176} FcType;
177
178typedef 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
190typedef struct _FcCharSet FcCharSet;
191
192typedef struct _FcObjectType {
193 const char *object;
194 FcType type;
195} FcObjectType;
196
197typedef struct _FcConstant {
198 const FcChar8 *name;
199 const char *object;
200 int value;
201} FcConstant;
202
203typedef enum _FcResult {
204 FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
205 FcResultOutOfMemory
206} FcResult;
207
208typedef struct _FcPattern FcPattern;
209
210typedef struct _FcLangSet FcLangSet;
211
212typedef 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
227typedef struct _FcFontSet {
228 int nfont;
229 int sfont;
230 FcPattern **fonts;
231} FcFontSet;
232
233typedef struct _FcObjectSet {
234 int nobject;
235 int sobject;
236 const char **objects;
237} FcObjectSet;
238
239typedef enum _FcMatchKind {
240 FcMatchPattern, FcMatchFont, FcMatchScan
241} FcMatchKind;
242
243typedef enum _FcLangResult {
244 FcLangEqual, FcLangDifferentCountry, FcLangDifferentLang
245} FcLangResult;
246
247typedef enum _FcSetName {
248 FcSetSystem = 0,
249 FcSetApplication = 1
250} FcSetName;
251
252typedef 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
262typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
263
264typedef struct _FcConfig FcConfig;
265
266typedef struct _FcGlobalCache FcFileCache;
267
268typedef struct _FcBlanks FcBlanks;
269
270typedef struct _FcStrList FcStrList;
271
272typedef struct _FcStrSet FcStrSet;
273
274_FCFUNCPROTOBEGIN
275
276FcBool
277FcDirCacheValid (const FcChar8 *cache_file);
278
279/* fcblanks.c */
280FcBlanks *
281FcBlanksCreate (void);
282
283void
284FcBlanksDestroy (FcBlanks *b);
285
286FcBool
287FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
288
289FcBool
290FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
291
292/* fccfg.c */
293FcChar8 *
294FcConfigHome (void);
295
296FcBool
297FcConfigEnableHome (FcBool enable);
298
299FcChar8 *
300FcConfigFilename (const FcChar8 *url);
301
302FcConfig *
303FcConfigCreate (void);
304
305void
306FcConfigDestroy (FcConfig *config);
307
308FcBool
309FcConfigSetCurrent (FcConfig *config);
310
311FcConfig *
312FcConfigGetCurrent (void);
313
314FcBool
315FcConfigUptoDate (FcConfig *config);
316
317FcBool
318FcConfigBuildFonts (FcConfig *config);
319
320FcStrList *
321FcConfigGetFontDirs (FcConfig *config);
322
323FcStrList *
324FcConfigGetConfigDirs (FcConfig *config);
325
326FcStrList *
327FcConfigGetConfigFiles (FcConfig *config);
328
329FcChar8 *
330FcConfigGetCache (FcConfig *config);
331
332FcBlanks *
333FcConfigGetBlanks (FcConfig *config);
334
335int
336FcConfigGetRescanInverval (FcConfig *config);
337
338FcBool
339FcConfigSetRescanInverval (FcConfig *config, int rescanInterval);
340
341FcFontSet *
342FcConfigGetFonts (FcConfig *config,
343 FcSetName set);
344
345FcBool
346FcConfigAppFontAddFile (FcConfig *config,
347 const FcChar8 *file);
348
349FcBool
350FcConfigAppFontAddDir (FcConfig *config,
351 const FcChar8 *dir);
352
353void
354FcConfigAppFontClear (FcConfig *config);
355
356FcBool
357FcConfigSubstituteWithPat (FcConfig *config,
358 FcPattern *p,
359 FcPattern *p_pat,
360 FcMatchKind kind);
361
362FcBool
363FcConfigSubstitute (FcConfig *config,
364 FcPattern *p,
365 FcMatchKind kind);
366
367/* fccharset.c */
368FcCharSet *
369FcCharSetCreate (void);
370
371void
372FcCharSetDestroy (FcCharSet *fcs);
373
374FcBool
375FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
376
377FcCharSet *
378FcCharSetCopy (FcCharSet *src);
379
380FcBool
381FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
382
383FcCharSet *
384FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
385
386FcCharSet *
387FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
388
389FcCharSet *
390FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
391
392FcBool
393FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
394
395FcChar32
396FcCharSetCount (const FcCharSet *a);
397
398FcChar32
399FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
400
401FcChar32
402FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
403
404FcBool
405FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
406
407#define FC_CHARSET_MAP_SIZE (256/32)
408#define FC_CHARSET_DONE ((FcChar32) -1)
409
410FcChar32
411FcCharSetFirstPage (const FcCharSet *a,
412 FcChar32 map[FC_CHARSET_MAP_SIZE],
413 FcChar32 *next);
414
415FcChar32
416FcCharSetNextPage (const FcCharSet *a,
417 FcChar32 map[FC_CHARSET_MAP_SIZE],
418 FcChar32 *next);
419
420
421/* fcdbg.c */
422void
423FcValuePrint (const FcValue v);
424
425void
426FcPatternPrint (const FcPattern *p);
427
428void
429FcFontSetPrint (const FcFontSet *s);
430
431/* fcdefault.c */
432void
433FcDefaultSubstitute (FcPattern *pattern);
434
435/* fcdir.c */
436FcBool
437FcFileScan (FcFontSet *set,
438 FcStrSet *dirs,
439 FcFileCache *cache,
440 FcBlanks *blanks,
441 const FcChar8 *file,
442 FcBool force);
443
444FcBool
445FcDirScan (FcFontSet *set,
446 FcStrSet *dirs,
447 FcFileCache *cache,
448 FcBlanks *blanks,
449 const FcChar8 *dir,
450 FcBool force);
451
452FcBool
453FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
454
455/* fcfreetype.c */
456FcPattern *
457FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
458
459/* fcfs.c */
460
461FcFontSet *
462FcFontSetCreate (void);
463
464void
465FcFontSetDestroy (FcFontSet *s);
466
467FcBool
468FcFontSetAdd (FcFontSet *s, FcPattern *font);
469
470/* fcinit.c */
471FcConfig *
472FcInitLoadConfig (void);
473
474FcConfig *
475FcInitLoadConfigAndFonts (void);
476
477FcBool
478FcInit (void);
479
480void
481FcFini (void);
482
483int
484FcGetVersion (void);
485
486FcBool
487FcInitReinitialize (void);
488
489FcBool
490FcInitBringUptoDate (void);
491
492/* fclang.c */
493FcLangSet *
494FcLangSetCreate (void);
495
496void
497FcLangSetDestroy (FcLangSet *ls);
498
499FcLangSet *
500FcLangSetCopy (const FcLangSet *ls);
501
502FcBool
503FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
504
505FcLangResult
506FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
507
508FcLangResult
509FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
510
511FcBool
512FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
513
514FcBool
515FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
516
517FcChar32
518FcLangSetHash (const FcLangSet *ls);
519
520/* fclist.c */
521FcObjectSet *
522FcObjectSetCreate (void);
523
524FcBool
525FcObjectSetAdd (FcObjectSet *os, const char *object);
526
527void
528FcObjectSetDestroy (FcObjectSet *os);
529
530FcObjectSet *
531FcObjectSetVaBuild (const char *first, va_list va);
532
533FcObjectSet *
534FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
535
536FcFontSet *
537FcFontSetList (FcConfig *config,
538 FcFontSet **sets,
539 int nsets,
540 FcPattern *p,
541 FcObjectSet *os);
542
543FcFontSet *
544FcFontList (FcConfig *config,
545 FcPattern *p,
546 FcObjectSet *os);
547
548/* fcatomic.c */
549
550FcAtomic *
551FcAtomicCreate (const FcChar8 *file);
552
553FcBool
554FcAtomicLock (FcAtomic *atomic);
555
556FcChar8 *
557FcAtomicNewFile (FcAtomic *atomic);
558
559FcChar8 *
560FcAtomicOrigFile (FcAtomic *atomic);
561
562FcBool
563FcAtomicReplaceOrig (FcAtomic *atomic);
564
565void
566FcAtomicDeleteNew (FcAtomic *atomic);
567
568void
569FcAtomicUnlock (FcAtomic *atomic);
570
571void
572FcAtomicDestroy (FcAtomic *atomic);
573
574/* fcmatch.c */
575FcPattern *
576FcFontSetMatch (FcConfig *config,
577 FcFontSet **sets,
578 int nsets,
579 FcPattern *p,
580 FcResult *result);
581
582FcPattern *
583FcFontMatch (FcConfig *config,
584 FcPattern *p,
585 FcResult *result);
586
587FcPattern *
588FcFontRenderPrepare (FcConfig *config,
589 FcPattern *pat,
590 FcPattern *font);
591
592FcFontSet *
593FcFontSetSort (FcConfig *config,
594 FcFontSet **sets,
595 int nsets,
596 FcPattern *p,
597 FcBool trim,
598 FcCharSet **csp,
599 FcResult *result);
600
601FcFontSet *
602FcFontSort (FcConfig *config,
603 FcPattern *p,
604 FcBool trim,
605 FcCharSet **csp,
606 FcResult *result);
607
608void
609FcFontSetSortDestroy (FcFontSet *fs);
610
611/* fcmatrix.c */
612FcMatrix *
613FcMatrixCopy (const FcMatrix *mat);
614
615FcBool
616FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
617
618void
619FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
620
621void
622FcMatrixRotate (FcMatrix *m, double c, double s);
623
624void
625FcMatrixScale (FcMatrix *m, double sx, double sy);
626
627void
628FcMatrixShear (FcMatrix *m, double sh, double sv);
629
630/* fcname.c */
631
632FcBool
633FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
634
635FcBool
636FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
637
638const FcObjectType *
639FcNameGetObjectType (const char *object);
640
641FcBool
642FcNameRegisterConstants (const FcConstant *consts, int nconsts);
643
644FcBool
645FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
646
647const FcConstant *
648FcNameGetConstant (FcChar8 *string);
649
650FcBool
651FcNameConstant (FcChar8 *string, int *result);
652
653FcPattern *
654FcNameParse (const FcChar8 *name);
655
656FcChar8 *
657FcNameUnparse (FcPattern *pat);
658
659/* fcpat.c */
660FcPattern *
661FcPatternCreate (void);
662
663FcPattern *
664FcPatternDuplicate (const FcPattern *p);
665
666void
667FcPatternReference (FcPattern *p);
668
669void
670FcValueDestroy (FcValue v);
671
672FcBool
673FcValueEqual (FcValue va, FcValue vb);
674
675FcValue
676FcValueSave (FcValue v);
677
678void
679FcPatternDestroy (FcPattern *p);
680
681FcBool
682FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
683
684FcBool
685FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
686
687FcChar32
688FcPatternHash (const FcPattern *p);
689
690FcBool
691FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
692
693FcBool
694FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
695
696FcResult
697FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
698
699FcBool
700FcPatternDel (FcPattern *p, const char *object);
701
702FcBool
703FcPatternRemove (FcPattern *p, const char *object, int id);
704
705FcBool
706FcPatternAddInteger (FcPattern *p, const char *object, int i);
707
708FcBool
709FcPatternAddDouble (FcPattern *p, const char *object, double d);
710
711FcBool
712FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
713
714FcBool
715FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
716
717FcBool
718FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
719
720FcBool
721FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
722
723FcBool
724FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
725
726FcResult
727FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
728
729FcResult
730FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
731
732FcResult
733FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
734
735FcResult
736FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
737
738FcResult
739FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
740
741FcResult
742FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
743
744FcResult
745FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
746
747FcPattern *
748FcPatternVaBuild (FcPattern *orig, va_list va);
749
750FcPattern *
751FcPatternBuild (FcPattern *orig, ...) FC_ATTRIBUTE_SENTINEL(0);
752
753/* fcstr.c */
754
755FcChar8 *
756FcStrCopy (const FcChar8 *s);
757
758FcChar8 *
759FcStrCopyFilename (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
766FcChar8 *
767FcStrDowncase (const FcChar8 *s);
768
769int
770FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
771
772int
773FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
774
775const FcChar8 *
776FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
777
778const FcChar8 *
779FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
780
781int
782FcUtf8ToUcs4 (const FcChar8 *src_orig,
783 FcChar32 *dst,
784 int len);
785
786FcBool
787FcUtf8Len (const FcChar8 *string,
788 int len,
789 int *nchar,
790 int *wchar);
791
792#define FC_UTF8_MAX_LEN 6
793
794int
795FcUcs4ToUtf8 (FcChar32 ucs4,
796 FcChar8 dest[FC_UTF8_MAX_LEN]);
797
798int
799FcUtf16ToUcs4 (const FcChar8 *src_orig,
800 FcEndian endian,
801 FcChar32 *dst,
802 int len); /* in bytes */
803
804FcBool
805FcUtf16Len (const FcChar8 *string,
806 FcEndian endian,
807 int len, /* in bytes */
808 int *nchar,
809 int *wchar);
810
811FcChar8 *
812FcStrDirname (const FcChar8 *file);
813
814FcChar8 *
815FcStrBasename (const FcChar8 *file);
816
817FcStrSet *
818FcStrSetCreate (void);
819
820FcBool
821FcStrSetMember (FcStrSet *set, const FcChar8 *s);
822
823FcBool
824FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
825
826FcBool
827FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
828
829FcBool
830FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
831
832FcBool
833FcStrSetDel (FcStrSet *set, const FcChar8 *s);
834
835void
836FcStrSetDestroy (FcStrSet *set);
837
838FcStrList *
839FcStrListCreate (FcStrSet *set);
840
841FcChar8 *
842FcStrListNext (FcStrList *list);
843
844void
845FcStrListDone (FcStrList *list);
846
847/* fcxml.c */
848FcBool
849FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
850
851_FCFUNCPROTOEND
852
853#undef FC_ATTRIBUTE_SENTINEL
854
855#endif /* _FONTCONFIG_H_ */