Imported Upstream version 2.13.1
[platform/upstream/fontconfig.git] / fontconfig / fontconfig.h
1 /*
2  * fontconfig/fontconfig/fontconfig.h
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 the author(s) not be used in
11  * advertising or publicity pertaining to distribution of the software without
12  * specific, written prior permission.  The authors make 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  * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18  * EVENT SHALL THE AUTHOR(S) 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 <sys/types.h>
29 #include <sys/stat.h>
30 #include <stdarg.h>
31 #include <limits.h>
32
33 #if defined(__GNUC__) && (__GNUC__ >= 4)
34 #define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0)))
35 #else
36 #define FC_ATTRIBUTE_SENTINEL(x)
37 #endif
38
39 #ifndef FcPublic
40 #define FcPublic
41 #endif
42
43 typedef unsigned char   FcChar8;
44 typedef unsigned short  FcChar16;
45 typedef unsigned int    FcChar32;
46 typedef int             FcBool;
47
48 /*
49  * Current Fontconfig version number.  This same number
50  * must appear in the fontconfig configure.in file. Yes,
51  * it'a a pain to synchronize version numbers like this.
52  */
53
54 #define FC_MAJOR        2
55 #define FC_MINOR        13
56 #define FC_REVISION     1
57
58 #define FC_VERSION      ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
59
60 /*
61  * Current font cache file format version
62  * This is appended to the cache files so that multiple
63  * versions of the library will peacefully coexist
64  *
65  * Change this value whenever the disk format for the cache file
66  * changes in any non-compatible way.  Try to avoid such changes as
67  * it means multiple copies of the font information.
68  */
69
70 #define FC_CACHE_VERSION_NUMBER 7
71 #define _FC_STRINGIFY_(s)       #s
72 #define _FC_STRINGIFY(s)        _FC_STRINGIFY_(s)
73 #define FC_CACHE_VERSION        _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
74
75 #define FcFalse         0
76 #define FcTrue          1
77 #define FcDontCare      2
78
79 #define FC_FAMILY           "family"            /* String */
80 #define FC_STYLE            "style"             /* String */
81 #define FC_SLANT            "slant"             /* Int */
82 #define FC_WEIGHT           "weight"            /* Int */
83 #define FC_SIZE             "size"              /* Range (double) */
84 #define FC_ASPECT           "aspect"            /* Double */
85 #define FC_PIXEL_SIZE       "pixelsize"         /* Double */
86 #define FC_SPACING          "spacing"           /* Int */
87 #define FC_FOUNDRY          "foundry"           /* String */
88 #define FC_ANTIALIAS        "antialias"         /* Bool (depends) */
89 #define FC_HINTING          "hinting"           /* Bool (true) */
90 #define FC_HINT_STYLE       "hintstyle"         /* Int */
91 #define FC_VERTICAL_LAYOUT  "verticallayout"    /* Bool (false) */
92 #define FC_AUTOHINT         "autohint"          /* Bool (false) */
93 /* FC_GLOBAL_ADVANCE is deprecated. this is simply ignored on freetype 2.4.5 or later */
94 #define FC_GLOBAL_ADVANCE   "globaladvance"     /* Bool (true) */
95 #define FC_WIDTH            "width"             /* Int */
96 #define FC_FILE             "file"              /* String */
97 #define FC_INDEX            "index"             /* Int */
98 #define FC_FT_FACE          "ftface"            /* FT_Face */
99 #define FC_RASTERIZER       "rasterizer"        /* String (deprecated) */
100 #define FC_OUTLINE          "outline"           /* Bool */
101 #define FC_SCALABLE         "scalable"          /* Bool */
102 #define FC_COLOR            "color"             /* Bool */
103 #define FC_VARIABLE         "variable"          /* Bool */
104 #define FC_SCALE            "scale"             /* double (deprecated) */
105 #define FC_SYMBOL           "symbol"            /* Bool */
106 #define FC_DPI              "dpi"               /* double */
107 #define FC_RGBA             "rgba"              /* Int */
108 #define FC_MINSPACE         "minspace"          /* Bool use minimum line spacing */
109 #define FC_SOURCE           "source"            /* String (deprecated) */
110 #define FC_CHARSET          "charset"           /* CharSet */
111 #define FC_LANG             "lang"              /* String RFC 3066 langs */
112 #define FC_FONTVERSION      "fontversion"       /* Int from 'head' table */
113 #define FC_FULLNAME         "fullname"          /* String */
114 #define FC_FAMILYLANG       "familylang"        /* String RFC 3066 langs */
115 #define FC_STYLELANG        "stylelang"         /* String RFC 3066 langs */
116 #define FC_FULLNAMELANG     "fullnamelang"      /* String RFC 3066 langs */
117 #define FC_CAPABILITY       "capability"        /* String */
118 #define FC_FONTFORMAT       "fontformat"        /* String */
119 #define FC_EMBOLDEN         "embolden"          /* Bool - true if emboldening needed*/
120 #define FC_EMBEDDED_BITMAP  "embeddedbitmap"    /* Bool - true to enable embedded bitmaps */
121 #define FC_DECORATIVE       "decorative"        /* Bool - true if style is a decorative variant */
122 #define FC_LCD_FILTER       "lcdfilter"         /* Int */
123 #define FC_FONT_FEATURES    "fontfeatures"      /* String */
124 #define FC_FONT_VARIATIONS  "fontvariations"    /* String */
125 #define FC_NAMELANG         "namelang"          /* String RFC 3866 langs */
126 #define FC_PRGNAME          "prgname"           /* String */
127 #define FC_HASH             "hash"              /* String (deprecated) */
128 #define FC_POSTSCRIPT_NAME  "postscriptname"    /* String */
129
130 #define FC_CACHE_SUFFIX             ".cache-" FC_CACHE_VERSION
131 #define FC_DIR_CACHE_FILE           "fonts.cache-" FC_CACHE_VERSION
132 #define FC_USER_CACHE_FILE          ".fonts.cache-" FC_CACHE_VERSION
133
134 /* Adjust outline rasterizer */
135 #define FC_CHARWIDTH        "charwidth" /* Int */
136 #define FC_CHAR_WIDTH       FC_CHARWIDTH
137 #define FC_CHAR_HEIGHT      "charheight"/* Int */
138 #define FC_MATRIX           "matrix"    /* FcMatrix */
139
140 #define FC_WEIGHT_THIN              0
141 #define FC_WEIGHT_EXTRALIGHT        40
142 #define FC_WEIGHT_ULTRALIGHT        FC_WEIGHT_EXTRALIGHT
143 #define FC_WEIGHT_LIGHT             50
144 #define FC_WEIGHT_DEMILIGHT         55
145 #define FC_WEIGHT_SEMILIGHT         FC_WEIGHT_DEMILIGHT
146 #define FC_WEIGHT_BOOK              75
147 #define FC_WEIGHT_REGULAR           80
148 #define FC_WEIGHT_NORMAL            FC_WEIGHT_REGULAR
149 #define FC_WEIGHT_MEDIUM            100
150 #define FC_WEIGHT_DEMIBOLD          180
151 #define FC_WEIGHT_SEMIBOLD          FC_WEIGHT_DEMIBOLD
152 #define FC_WEIGHT_BOLD              200
153 #define FC_WEIGHT_EXTRABOLD         205
154 #define FC_WEIGHT_ULTRABOLD         FC_WEIGHT_EXTRABOLD
155 #define FC_WEIGHT_BLACK             210
156 #define FC_WEIGHT_HEAVY             FC_WEIGHT_BLACK
157 #define FC_WEIGHT_EXTRABLACK        215
158 #define FC_WEIGHT_ULTRABLACK        FC_WEIGHT_EXTRABLACK
159
160 #define FC_SLANT_ROMAN              0
161 #define FC_SLANT_ITALIC             100
162 #define FC_SLANT_OBLIQUE            110
163
164 #define FC_WIDTH_ULTRACONDENSED     50
165 #define FC_WIDTH_EXTRACONDENSED     63
166 #define FC_WIDTH_CONDENSED          75
167 #define FC_WIDTH_SEMICONDENSED      87
168 #define FC_WIDTH_NORMAL             100
169 #define FC_WIDTH_SEMIEXPANDED       113
170 #define FC_WIDTH_EXPANDED           125
171 #define FC_WIDTH_EXTRAEXPANDED      150
172 #define FC_WIDTH_ULTRAEXPANDED      200
173
174 #define FC_PROPORTIONAL             0
175 #define FC_DUAL                     90
176 #define FC_MONO                     100
177 #define FC_CHARCELL                 110
178
179 /* sub-pixel order */
180 #define FC_RGBA_UNKNOWN     0
181 #define FC_RGBA_RGB         1
182 #define FC_RGBA_BGR         2
183 #define FC_RGBA_VRGB        3
184 #define FC_RGBA_VBGR        4
185 #define FC_RGBA_NONE        5
186
187 /* hinting style */
188 #define FC_HINT_NONE        0
189 #define FC_HINT_SLIGHT      1
190 #define FC_HINT_MEDIUM      2
191 #define FC_HINT_FULL        3
192
193 /* LCD filter */
194 #define FC_LCD_NONE         0
195 #define FC_LCD_DEFAULT      1
196 #define FC_LCD_LIGHT        2
197 #define FC_LCD_LEGACY       3
198
199 typedef enum _FcType {
200     FcTypeUnknown = -1,
201     FcTypeVoid,
202     FcTypeInteger,
203     FcTypeDouble,
204     FcTypeString,
205     FcTypeBool,
206     FcTypeMatrix,
207     FcTypeCharSet,
208     FcTypeFTFace,
209     FcTypeLangSet,
210     FcTypeRange
211 } FcType;
212
213 typedef struct _FcMatrix {
214     double xx, xy, yx, yy;
215 } FcMatrix;
216
217 #define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
218                          (m)->xy = (m)->yx = 0)
219
220 /*
221  * A data structure to represent the available glyphs in a font.
222  * This is represented as a sparse boolean btree.
223  */
224
225 typedef struct _FcCharSet FcCharSet;
226
227 typedef struct _FcObjectType {
228     char        *object;
229     FcType      type;
230 } FcObjectType;
231
232 typedef struct _FcConstant {
233     const FcChar8  *name;
234     const char  *object;
235     int         value;
236 } FcConstant;
237
238 typedef enum _FcResult {
239     FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
240     FcResultOutOfMemory
241 } FcResult;
242
243 typedef enum _FcValueBinding {
244     FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
245     /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
246     FcValueBindingEnd = INT_MAX
247 } FcValueBinding;
248
249 typedef struct _FcPattern   FcPattern;
250
251 typedef struct _FcPatternIter {
252     void *dummy1;
253     void *dummy2;
254 } FcPatternIter;
255
256 typedef struct _FcLangSet   FcLangSet;
257
258 typedef struct _FcRange     FcRange;
259
260 typedef struct _FcValue {
261     FcType      type;
262     union {
263         const FcChar8   *s;
264         int             i;
265         FcBool          b;
266         double          d;
267         const FcMatrix  *m;
268         const FcCharSet *c;
269         void            *f;
270         const FcLangSet *l;
271         const FcRange   *r;
272     } u;
273 } FcValue;
274
275 typedef struct _FcFontSet {
276     int         nfont;
277     int         sfont;
278     FcPattern   **fonts;
279 } FcFontSet;
280
281 typedef struct _FcObjectSet {
282     int         nobject;
283     int         sobject;
284     const char  **objects;
285 } FcObjectSet;
286     
287 typedef enum _FcMatchKind {
288     FcMatchPattern, FcMatchFont, FcMatchScan,
289     FcMatchKindEnd,
290     FcMatchKindBegin = FcMatchPattern
291 } FcMatchKind;
292
293 typedef enum _FcLangResult {
294     FcLangEqual = 0,
295     FcLangDifferentCountry = 1,
296     FcLangDifferentTerritory = 1,
297     FcLangDifferentLang = 2
298 } FcLangResult;
299
300 typedef enum _FcSetName {
301     FcSetSystem = 0,
302     FcSetApplication = 1
303 } FcSetName;
304
305 typedef struct _FcConfigFileInfoIter {
306     void        *dummy1;
307     void        *dummy2;
308     void        *dummy3;
309 } FcConfigFileInfoIter;
310
311 typedef struct _FcAtomic FcAtomic;
312
313 #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
314 #define _FCFUNCPROTOBEGIN extern "C" {  /* do not leave open across includes */
315 #define _FCFUNCPROTOEND }
316 #else
317 #define _FCFUNCPROTOBEGIN
318 #define _FCFUNCPROTOEND
319 #endif
320
321 typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
322
323 typedef struct _FcConfig    FcConfig;
324
325 typedef struct _FcGlobalCache   FcFileCache;
326
327 typedef struct _FcBlanks    FcBlanks;
328
329 typedef struct _FcStrList   FcStrList;
330
331 typedef struct _FcStrSet    FcStrSet;
332
333 typedef struct _FcCache     FcCache;
334
335 _FCFUNCPROTOBEGIN
336
337 /* fcblanks.c */
338 FcPublic FcBlanks *
339 FcBlanksCreate (void);
340
341 FcPublic void
342 FcBlanksDestroy (FcBlanks *b);
343
344 FcPublic FcBool
345 FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
346
347 FcPublic FcBool
348 FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
349
350 /* fccache.c */
351
352 FcPublic const FcChar8 *
353 FcCacheDir(const FcCache *c);
354
355 FcPublic FcFontSet *
356 FcCacheCopySet(const FcCache *c);
357
358 FcPublic const FcChar8 *
359 FcCacheSubdir (const FcCache *c, int i);
360
361 FcPublic int
362 FcCacheNumSubdir (const FcCache *c);
363
364 FcPublic int
365 FcCacheNumFont (const FcCache *c);
366
367 FcPublic FcBool
368 FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
369
370 FcPublic FcBool
371 FcDirCacheValid (const FcChar8 *cache_file);
372
373 FcPublic FcBool
374 FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);
375
376 FcPublic void
377 FcCacheCreateTagFile (const FcConfig *config);
378
379 FcPublic FcBool
380 FcDirCacheCreateUUID (FcChar8  *dir,
381                       FcBool    force,
382                       FcConfig *config);
383
384 FcPublic FcBool
385 FcDirCacheDeleteUUID (const FcChar8  *dir,
386                       FcConfig       *config);
387
388 /* fccfg.c */
389 FcPublic FcChar8 *
390 FcConfigHome (void);
391
392 FcPublic FcBool
393 FcConfigEnableHome (FcBool enable);
394
395 FcPublic FcChar8 *
396 FcConfigFilename (const FcChar8 *url);
397     
398 FcPublic FcConfig *
399 FcConfigCreate (void);
400
401 FcPublic FcConfig *
402 FcConfigReference (FcConfig *config);
403
404 FcPublic void
405 FcConfigDestroy (FcConfig *config);
406
407 FcPublic FcBool
408 FcConfigSetCurrent (FcConfig *config);
409
410 FcPublic FcConfig *
411 FcConfigGetCurrent (void);
412
413 FcPublic FcBool
414 FcConfigUptoDate (FcConfig *config);
415     
416 FcPublic FcBool
417 FcConfigBuildFonts (FcConfig *config);
418
419 FcPublic FcStrList *
420 FcConfigGetFontDirs (FcConfig   *config);
421
422 FcPublic FcStrList *
423 FcConfigGetConfigDirs (FcConfig   *config);
424
425 FcPublic FcStrList *
426 FcConfigGetConfigFiles (FcConfig    *config);
427
428 FcPublic FcChar8 *
429 FcConfigGetCache (FcConfig  *config);
430
431 FcPublic FcBlanks *
432 FcConfigGetBlanks (FcConfig *config);
433
434 FcPublic FcStrList *
435 FcConfigGetCacheDirs (const FcConfig    *config);
436
437 FcPublic int
438 FcConfigGetRescanInterval (FcConfig *config);
439
440 FcPublic FcBool
441 FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
442
443 FcPublic FcFontSet *
444 FcConfigGetFonts (FcConfig      *config,
445                   FcSetName     set);
446
447 FcPublic FcBool
448 FcConfigAppFontAddFile (FcConfig    *config,
449                         const FcChar8  *file);
450
451 FcPublic FcBool
452 FcConfigAppFontAddDir (FcConfig     *config,
453                        const FcChar8   *dir);
454
455 FcPublic void
456 FcConfigAppFontClear (FcConfig      *config);
457
458 FcPublic FcBool
459 FcConfigSubstituteWithPat (FcConfig     *config,
460                            FcPattern    *p,
461                            FcPattern    *p_pat,
462                            FcMatchKind  kind);
463
464 FcPublic FcBool
465 FcConfigSubstitute (FcConfig    *config,
466                     FcPattern   *p,
467                     FcMatchKind kind);
468
469 FcPublic const FcChar8 *
470 FcConfigGetSysRoot (const FcConfig *config);
471
472 FcPublic void
473 FcConfigSetSysRoot (FcConfig      *config,
474                     const FcChar8 *sysroot);
475
476 FcPublic void
477 FcConfigFileInfoIterInit (FcConfig              *config,
478                           FcConfigFileInfoIter  *iter);
479
480 FcPublic FcBool
481 FcConfigFileInfoIterNext (FcConfig              *config,
482                           FcConfigFileInfoIter  *iter);
483
484 FcPublic FcBool
485 FcConfigFileInfoIterGet (FcConfig               *config,
486                          FcConfigFileInfoIter   *iter,
487                          FcChar8                **name,
488                          FcChar8                **description,
489                          FcBool                 *enabled);
490
491 /* fccharset.c */
492 FcPublic FcCharSet*
493 FcCharSetCreate (void);
494
495 /* deprecated alias for FcCharSetCreate */
496 FcPublic FcCharSet *
497 FcCharSetNew (void);
498
499 FcPublic void
500 FcCharSetDestroy (FcCharSet *fcs);
501
502 FcPublic FcBool
503 FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
504
505 FcPublic FcBool
506 FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);
507
508 FcPublic FcCharSet*
509 FcCharSetCopy (FcCharSet *src);
510
511 FcPublic FcBool
512 FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
513
514 FcPublic FcCharSet*
515 FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
516
517 FcPublic FcCharSet*
518 FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
519
520 FcPublic FcCharSet*
521 FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
522
523 FcPublic FcBool
524 FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
525
526 FcPublic FcBool
527 FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
528
529 FcPublic FcChar32
530 FcCharSetCount (const FcCharSet *a);
531
532 FcPublic FcChar32
533 FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
534
535 FcPublic FcChar32
536 FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
537
538 FcPublic FcBool
539 FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
540
541 #define FC_CHARSET_MAP_SIZE (256/32)
542 #define FC_CHARSET_DONE ((FcChar32) -1)
543
544 FcPublic FcChar32
545 FcCharSetFirstPage (const FcCharSet *a, 
546                     FcChar32        map[FC_CHARSET_MAP_SIZE],
547                     FcChar32        *next);
548
549 FcPublic FcChar32
550 FcCharSetNextPage (const FcCharSet  *a, 
551                    FcChar32         map[FC_CHARSET_MAP_SIZE],
552                    FcChar32         *next);
553
554 /*
555  * old coverage API, rather hard to use correctly
556  */
557
558 FcPublic FcChar32
559 FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
560
561 /* fcdbg.c */
562 FcPublic void
563 FcValuePrint (const FcValue v);
564
565 FcPublic void
566 FcPatternPrint (const FcPattern *p);
567
568 FcPublic void
569 FcFontSetPrint (const FcFontSet *s);
570
571 /* fcdefault.c */
572 FcPublic FcStrSet *
573 FcGetDefaultLangs (void);
574
575 FcPublic void
576 FcDefaultSubstitute (FcPattern *pattern);
577
578 /* fcdir.c */
579 FcPublic FcBool
580 FcFileIsDir (const FcChar8 *file);
581
582 FcPublic FcBool
583 FcFileScan (FcFontSet       *set,
584             FcStrSet        *dirs,
585             FcFileCache     *cache,
586             FcBlanks        *blanks,
587             const FcChar8   *file,
588             FcBool          force);
589
590 FcPublic FcBool
591 FcDirScan (FcFontSet        *set,
592            FcStrSet         *dirs,
593            FcFileCache      *cache,
594            FcBlanks         *blanks,
595            const FcChar8    *dir,
596            FcBool           force);
597
598 FcPublic FcBool
599 FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
600
601 FcPublic FcCache *
602 FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
603
604 FcPublic FcCache *
605 FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
606     
607 FcPublic FcCache *
608 FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
609
610 FcPublic FcCache *
611 FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
612
613 FcPublic void
614 FcDirCacheUnload (FcCache *cache);
615
616 /* fcfreetype.c */
617 FcPublic FcPattern *
618 FcFreeTypeQuery (const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count);
619
620 FcPublic unsigned int
621 FcFreeTypeQueryAll(const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count, FcFontSet *set);
622
623 /* fcfs.c */
624
625 FcPublic FcFontSet *
626 FcFontSetCreate (void);
627
628 FcPublic void
629 FcFontSetDestroy (FcFontSet *s);
630
631 FcPublic FcBool
632 FcFontSetAdd (FcFontSet *s, FcPattern *font);
633
634 /* fcinit.c */
635 FcPublic FcConfig *
636 FcInitLoadConfig (void);
637
638 FcPublic FcConfig *
639 FcInitLoadConfigAndFonts (void);
640
641 FcPublic FcBool
642 FcInit (void);
643
644 FcPublic void
645 FcFini (void);
646
647 FcPublic int
648 FcGetVersion (void);
649
650 FcPublic FcBool
651 FcInitReinitialize (void);
652
653 FcPublic FcBool
654 FcInitBringUptoDate (void);
655
656 /* fclang.c */
657 FcPublic FcStrSet *
658 FcGetLangs (void);
659
660 FcPublic FcChar8 *
661 FcLangNormalize (const FcChar8 *lang);
662
663 FcPublic const FcCharSet *
664 FcLangGetCharSet (const FcChar8 *lang);
665
666 FcPublic FcLangSet*
667 FcLangSetCreate (void);
668
669 FcPublic void
670 FcLangSetDestroy (FcLangSet *ls);
671
672 FcPublic FcLangSet*
673 FcLangSetCopy (const FcLangSet *ls);
674
675 FcPublic FcBool
676 FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
677
678 FcPublic FcBool
679 FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);
680
681 FcPublic FcLangResult
682 FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
683
684 FcPublic FcLangResult
685 FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
686
687 FcPublic FcBool
688 FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
689
690 FcPublic FcBool
691 FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
692
693 FcPublic FcChar32
694 FcLangSetHash (const FcLangSet *ls);
695
696 FcPublic FcStrSet *
697 FcLangSetGetLangs (const FcLangSet *ls);
698
699 FcPublic FcLangSet *
700 FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);
701
702 FcPublic FcLangSet *
703 FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);
704
705 /* fclist.c */
706 FcPublic FcObjectSet *
707 FcObjectSetCreate (void);
708
709 FcPublic FcBool
710 FcObjectSetAdd (FcObjectSet *os, const char *object);
711
712 FcPublic void
713 FcObjectSetDestroy (FcObjectSet *os);
714
715 FcPublic FcObjectSet *
716 FcObjectSetVaBuild (const char *first, va_list va);
717
718 FcPublic FcObjectSet *
719 FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
720
721 FcPublic FcFontSet *
722 FcFontSetList (FcConfig     *config,
723                FcFontSet    **sets,
724                int          nsets,
725                FcPattern    *p,
726                FcObjectSet  *os);
727
728 FcPublic FcFontSet *
729 FcFontList (FcConfig    *config,
730             FcPattern   *p,
731             FcObjectSet *os);
732
733 /* fcatomic.c */
734
735 FcPublic FcAtomic *
736 FcAtomicCreate (const FcChar8   *file);
737
738 FcPublic FcBool
739 FcAtomicLock (FcAtomic *atomic);
740
741 FcPublic FcChar8 *
742 FcAtomicNewFile (FcAtomic *atomic);
743
744 FcPublic FcChar8 *
745 FcAtomicOrigFile (FcAtomic *atomic);
746
747 FcPublic FcBool
748 FcAtomicReplaceOrig (FcAtomic *atomic);
749
750 FcPublic void
751 FcAtomicDeleteNew (FcAtomic *atomic);
752
753 FcPublic void
754 FcAtomicUnlock (FcAtomic *atomic);
755
756 FcPublic void
757 FcAtomicDestroy (FcAtomic *atomic);
758
759 /* fcmatch.c */
760 FcPublic FcPattern *
761 FcFontSetMatch (FcConfig    *config,
762                 FcFontSet   **sets,
763                 int         nsets,
764                 FcPattern   *p,
765                 FcResult    *result);
766
767 FcPublic FcPattern *
768 FcFontMatch (FcConfig   *config,
769              FcPattern  *p, 
770              FcResult   *result);
771
772 FcPublic FcPattern *
773 FcFontRenderPrepare (FcConfig       *config,
774                      FcPattern      *pat,
775                      FcPattern      *font);
776
777 FcPublic FcFontSet *
778 FcFontSetSort (FcConfig     *config,
779                FcFontSet    **sets,
780                int          nsets,
781                FcPattern    *p,
782                FcBool       trim,
783                FcCharSet    **csp,
784                FcResult     *result);
785
786 FcPublic FcFontSet *
787 FcFontSort (FcConfig     *config,
788             FcPattern    *p,
789             FcBool       trim,
790             FcCharSet    **csp,
791             FcResult     *result);
792
793 FcPublic void
794 FcFontSetSortDestroy (FcFontSet *fs);
795
796 /* fcmatrix.c */
797 FcPublic FcMatrix *
798 FcMatrixCopy (const FcMatrix *mat);
799
800 FcPublic FcBool
801 FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
802
803 FcPublic void
804 FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
805
806 FcPublic void
807 FcMatrixRotate (FcMatrix *m, double c, double s);
808
809 FcPublic void
810 FcMatrixScale (FcMatrix *m, double sx, double sy);
811
812 FcPublic void
813 FcMatrixShear (FcMatrix *m, double sh, double sv);
814
815 /* fcname.c */
816
817 /* Deprecated.  Does nothing.  Returns FcFalse. */
818 FcPublic FcBool
819 FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
820
821 /* Deprecated.  Does nothing.  Returns FcFalse. */
822 FcPublic FcBool
823 FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
824
825 FcPublic const FcObjectType *
826 FcNameGetObjectType (const char *object);
827
828 /* Deprecated.  Does nothing.  Returns FcFalse. */
829 FcPublic FcBool
830 FcNameRegisterConstants (const FcConstant *consts, int nconsts);
831
832 /* Deprecated.  Does nothing.  Returns FcFalse. */
833 FcPublic FcBool
834 FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
835
836 FcPublic const FcConstant *
837 FcNameGetConstant (const FcChar8 *string);
838
839 FcPublic FcBool
840 FcNameConstant (const FcChar8 *string, int *result);
841
842 FcPublic FcPattern *
843 FcNameParse (const FcChar8 *name);
844
845 FcPublic FcChar8 *
846 FcNameUnparse (FcPattern *pat);
847
848 /* fcpat.c */
849 FcPublic FcPattern *
850 FcPatternCreate (void);
851
852 FcPublic FcPattern *
853 FcPatternDuplicate (const FcPattern *p);
854
855 FcPublic void
856 FcPatternReference (FcPattern *p);
857
858 FcPublic FcPattern *
859 FcPatternFilter (FcPattern *p, const FcObjectSet *os);
860
861 FcPublic void
862 FcValueDestroy (FcValue v);
863
864 FcPublic FcBool
865 FcValueEqual (FcValue va, FcValue vb);
866
867 FcPublic FcValue
868 FcValueSave (FcValue v);
869
870 FcPublic void
871 FcPatternDestroy (FcPattern *p);
872
873 int
874 FcPatternObjectCount (const FcPattern *pat);
875
876 FcPublic FcBool
877 FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
878
879 FcPublic FcBool
880 FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
881
882 FcPublic FcChar32
883 FcPatternHash (const FcPattern *p);
884
885 FcPublic FcBool
886 FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
887     
888 FcPublic FcBool
889 FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
890     
891 FcPublic FcResult
892 FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
893
894 FcPublic FcResult
895 FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b);
896
897 FcPublic FcBool
898 FcPatternDel (FcPattern *p, const char *object);
899
900 FcPublic FcBool
901 FcPatternRemove (FcPattern *p, const char *object, int id);
902
903 FcPublic FcBool
904 FcPatternAddInteger (FcPattern *p, const char *object, int i);
905
906 FcPublic FcBool
907 FcPatternAddDouble (FcPattern *p, const char *object, double d);
908
909 FcPublic FcBool
910 FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
911
912 FcPublic FcBool
913 FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
914
915 FcPublic FcBool
916 FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
917
918 FcPublic FcBool
919 FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
920
921 FcPublic FcBool
922 FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
923
924 FcPublic FcBool
925 FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);
926
927 FcPublic FcResult
928 FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
929
930 FcPublic FcResult
931 FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
932
933 FcPublic FcResult
934 FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
935
936 FcPublic FcResult
937 FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
938
939 FcPublic FcResult
940 FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
941
942 FcPublic FcResult
943 FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
944
945 FcPublic FcResult
946 FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
947
948 FcPublic FcResult
949 FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);
950
951 FcPublic FcPattern *
952 FcPatternVaBuild (FcPattern *p, va_list va);
953     
954 FcPublic FcPattern *
955 FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
956
957 FcPublic FcChar8 *
958 FcPatternFormat (FcPattern *pat, const FcChar8 *format);
959
960 /* fcrange.c */
961 FcPublic FcRange *
962 FcRangeCreateDouble (double begin, double end);
963
964 FcPublic FcRange *
965 FcRangeCreateInteger (FcChar32 begin, FcChar32 end);
966
967 FcPublic void
968 FcRangeDestroy (FcRange *range);
969
970 FcPublic FcRange *
971 FcRangeCopy (const FcRange *r);
972
973 FcPublic FcBool
974 FcRangeGetDouble(const FcRange *range, double *begin, double *end);
975
976 FcPublic void
977 FcPatternIterStart (const FcPattern *pat, FcPatternIter *iter);
978
979 FcPublic FcBool
980 FcPatternIterNext (const FcPattern *pat, FcPatternIter *iter);
981
982 FcPublic FcBool
983 FcPatternIterEqual (const FcPattern *p1, FcPatternIter *i1,
984                     const FcPattern *p2, FcPatternIter *i2);
985
986 FcPublic FcBool
987 FcPatternFindIter (const FcPattern *pat, FcPatternIter *iter, const char *object);
988
989 FcPublic FcBool
990 FcPatternIterIsValid (const FcPattern *pat, FcPatternIter *iter);
991
992 FcPublic const char *
993 FcPatternIterGetObject (const FcPattern *pat, FcPatternIter *iter);
994
995 FcPublic int
996 FcPatternIterValueCount (const FcPattern *pat, FcPatternIter *iter);
997
998 FcPublic FcResult
999 FcPatternIterGetValue (const FcPattern *pat, FcPatternIter *iter, int id, FcValue *v, FcValueBinding *b);
1000
1001 /* fcweight.c */
1002
1003 FcPublic int
1004 FcWeightFromOpenType (int ot_weight);
1005
1006 FcPublic double
1007 FcWeightFromOpenTypeDouble (double ot_weight);
1008
1009 FcPublic int
1010 FcWeightToOpenType (int fc_weight);
1011
1012 FcPublic double
1013 FcWeightToOpenTypeDouble (double fc_weight);
1014
1015 /* fcstr.c */
1016
1017 FcPublic FcChar8 *
1018 FcStrCopy (const FcChar8 *s);
1019
1020 FcPublic FcChar8 *
1021 FcStrCopyFilename (const FcChar8 *s);
1022     
1023 FcPublic FcChar8 *
1024 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
1025     
1026 FcPublic void
1027 FcStrFree (FcChar8 *s);
1028
1029 /* These are ASCII only, suitable only for pattern element names */
1030 #define FcIsUpper(c)    ((0101 <= (c) && (c) <= 0132))
1031 #define FcIsLower(c)    ((0141 <= (c) && (c) <= 0172))
1032 #define FcToLower(c)    (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
1033
1034 FcPublic FcChar8 *
1035 FcStrDowncase (const FcChar8 *s);
1036
1037 FcPublic int
1038 FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1039
1040 FcPublic int
1041 FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
1042
1043 FcPublic const FcChar8 *
1044 FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1045
1046 FcPublic const FcChar8 *
1047 FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
1048
1049 FcPublic int
1050 FcUtf8ToUcs4 (const FcChar8 *src_orig,
1051               FcChar32      *dst,
1052               int           len);
1053
1054 FcPublic FcBool
1055 FcUtf8Len (const FcChar8    *string,
1056            int              len,
1057            int              *nchar,
1058            int              *wchar);
1059
1060 #define FC_UTF8_MAX_LEN 6
1061
1062 FcPublic int
1063 FcUcs4ToUtf8 (FcChar32  ucs4,
1064               FcChar8   dest[FC_UTF8_MAX_LEN]);
1065
1066 FcPublic int
1067 FcUtf16ToUcs4 (const FcChar8    *src_orig,
1068                FcEndian         endian,
1069                FcChar32         *dst,
1070                int              len);       /* in bytes */
1071
1072 FcPublic FcBool
1073 FcUtf16Len (const FcChar8   *string,
1074             FcEndian        endian,
1075             int             len,            /* in bytes */
1076             int             *nchar,
1077             int             *wchar);
1078
1079 FcPublic FcChar8 *
1080 FcStrDirname (const FcChar8 *file);
1081
1082 FcPublic FcChar8 *
1083 FcStrBasename (const FcChar8 *file);
1084
1085 FcPublic FcStrSet *
1086 FcStrSetCreate (void);
1087
1088 FcPublic FcBool
1089 FcStrSetMember (FcStrSet *set, const FcChar8 *s);
1090
1091 FcPublic FcBool
1092 FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
1093
1094 FcPublic FcBool
1095 FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
1096
1097 FcPublic FcBool
1098 FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
1099
1100 FcPublic FcBool
1101 FcStrSetDel (FcStrSet *set, const FcChar8 *s);
1102
1103 FcPublic void
1104 FcStrSetDestroy (FcStrSet *set);
1105
1106 FcPublic FcStrList *
1107 FcStrListCreate (FcStrSet *set);
1108
1109 FcPublic void
1110 FcStrListFirst (FcStrList *list);
1111
1112 FcPublic FcChar8 *
1113 FcStrListNext (FcStrList *list);
1114
1115 FcPublic void
1116 FcStrListDone (FcStrList *list);
1117
1118 /* fcxml.c */
1119 FcPublic FcBool
1120 FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
1121
1122 FcPublic FcBool
1123 FcConfigParseAndLoadFromMemory (FcConfig       *config,
1124                                 const FcChar8  *buffer,
1125                                 FcBool         complain);
1126
1127 _FCFUNCPROTOEND
1128
1129 #undef FC_ATTRIBUTE_SENTINEL
1130
1131
1132 #ifndef _FCINT_H_
1133
1134 /*
1135  * Deprecated functions are placed here to help users fix their code without
1136  * digging through documentation
1137  */
1138  
1139 #define FcConfigGetRescanInverval   FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
1140 #define FcConfigSetRescanInverval   FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
1141
1142 #endif
1143
1144 #endif /* _FONTCONFIG_H_ */