a89b22f2e9969967283b56685bc1ca97f0616560
[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     0
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 _FcLangSet   FcLangSet;
252
253 typedef struct _FcRange     FcRange;
254
255 typedef struct _FcValue {
256     FcType      type;
257     union {
258         const FcChar8   *s;
259         int             i;
260         FcBool          b;
261         double          d;
262         const FcMatrix  *m;
263         const FcCharSet *c;
264         void            *f;
265         const FcLangSet *l;
266         const FcRange   *r;
267     } u;
268 } FcValue;
269
270 typedef struct _FcFontSet {
271     int         nfont;
272     int         sfont;
273     FcPattern   **fonts;
274 } FcFontSet;
275
276 typedef struct _FcObjectSet {
277     int         nobject;
278     int         sobject;
279     const char  **objects;
280 } FcObjectSet;
281     
282 typedef enum _FcMatchKind {
283     FcMatchPattern, FcMatchFont, FcMatchScan,
284     FcMatchKindEnd,
285     FcMatchKindBegin = FcMatchPattern
286 } FcMatchKind;
287
288 typedef enum _FcLangResult {
289     FcLangEqual = 0,
290     FcLangDifferentCountry = 1,
291     FcLangDifferentTerritory = 1,
292     FcLangDifferentLang = 2
293 } FcLangResult;
294
295 typedef enum _FcSetName {
296     FcSetSystem = 0,
297     FcSetApplication = 1
298 } FcSetName;
299
300 typedef struct _FcConfigFileInfoIter {
301     void        *dummy1;
302     void        *dummy2;
303     void        *dummy3;
304 } FcConfigFileInfoIter;
305
306 typedef struct _FcAtomic FcAtomic;
307
308 #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
309 #define _FCFUNCPROTOBEGIN extern "C" {  /* do not leave open across includes */
310 #define _FCFUNCPROTOEND }
311 #else
312 #define _FCFUNCPROTOBEGIN
313 #define _FCFUNCPROTOEND
314 #endif
315
316 typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
317
318 typedef struct _FcConfig    FcConfig;
319
320 typedef struct _FcGlobalCache   FcFileCache;
321
322 typedef struct _FcBlanks    FcBlanks;
323
324 typedef struct _FcStrList   FcStrList;
325
326 typedef struct _FcStrSet    FcStrSet;
327
328 typedef struct _FcCache     FcCache;
329
330 _FCFUNCPROTOBEGIN
331
332 /* fcblanks.c */
333 FcPublic FcBlanks *
334 FcBlanksCreate (void);
335
336 FcPublic void
337 FcBlanksDestroy (FcBlanks *b);
338
339 FcPublic FcBool
340 FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
341
342 FcPublic FcBool
343 FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
344
345 /* fccache.c */
346
347 FcPublic const FcChar8 *
348 FcCacheDir(const FcCache *c);
349
350 FcPublic FcFontSet *
351 FcCacheCopySet(const FcCache *c);
352
353 FcPublic const FcChar8 *
354 FcCacheSubdir (const FcCache *c, int i);
355
356 FcPublic int
357 FcCacheNumSubdir (const FcCache *c);
358
359 FcPublic int
360 FcCacheNumFont (const FcCache *c);
361
362 FcPublic FcBool
363 FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
364
365 FcPublic FcBool
366 FcDirCacheValid (const FcChar8 *cache_file);
367
368 FcPublic FcBool
369 FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);
370
371 FcPublic void
372 FcCacheCreateTagFile (const FcConfig *config);
373
374 FcPublic FcBool
375 FcDirCacheCreateUUID (FcChar8  *dir,
376                       FcBool    force,
377                       FcConfig *config);
378
379 /* fccfg.c */
380 FcPublic FcChar8 *
381 FcConfigHome (void);
382
383 FcPublic FcBool
384 FcConfigEnableHome (FcBool enable);
385
386 FcPublic FcChar8 *
387 FcConfigFilename (const FcChar8 *url);
388     
389 FcPublic FcConfig *
390 FcConfigCreate (void);
391
392 FcPublic FcConfig *
393 FcConfigReference (FcConfig *config);
394
395 FcPublic void
396 FcConfigDestroy (FcConfig *config);
397
398 FcPublic FcBool
399 FcConfigSetCurrent (FcConfig *config);
400
401 FcPublic FcConfig *
402 FcConfigGetCurrent (void);
403
404 FcPublic FcBool
405 FcConfigUptoDate (FcConfig *config);
406     
407 FcPublic FcBool
408 FcConfigBuildFonts (FcConfig *config);
409
410 FcPublic FcStrList *
411 FcConfigGetFontDirs (FcConfig   *config);
412
413 FcPublic FcStrList *
414 FcConfigGetConfigDirs (FcConfig   *config);
415
416 FcPublic FcStrList *
417 FcConfigGetConfigFiles (FcConfig    *config);
418
419 FcPublic FcChar8 *
420 FcConfigGetCache (FcConfig  *config);
421
422 FcPublic FcBlanks *
423 FcConfigGetBlanks (FcConfig *config);
424
425 FcPublic FcStrList *
426 FcConfigGetCacheDirs (const FcConfig    *config);
427
428 FcPublic int
429 FcConfigGetRescanInterval (FcConfig *config);
430
431 FcPublic FcBool
432 FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
433
434 FcPublic FcFontSet *
435 FcConfigGetFonts (FcConfig      *config,
436                   FcSetName     set);
437
438 FcPublic FcBool
439 FcConfigAppFontAddFile (FcConfig    *config,
440                         const FcChar8  *file);
441
442 FcPublic FcBool
443 FcConfigAppFontAddDir (FcConfig     *config,
444                        const FcChar8   *dir);
445
446 FcPublic void
447 FcConfigAppFontClear (FcConfig      *config);
448
449 FcPublic FcBool
450 FcConfigSubstituteWithPat (FcConfig     *config,
451                            FcPattern    *p,
452                            FcPattern    *p_pat,
453                            FcMatchKind  kind);
454
455 FcPublic FcBool
456 FcConfigSubstitute (FcConfig    *config,
457                     FcPattern   *p,
458                     FcMatchKind kind);
459
460 FcPublic const FcChar8 *
461 FcConfigGetSysRoot (const FcConfig *config);
462
463 FcPublic void
464 FcConfigSetSysRoot (FcConfig      *config,
465                     const FcChar8 *sysroot);
466
467 FcPublic void
468 FcConfigFileInfoIterInit (FcConfig              *config,
469                           FcConfigFileInfoIter  *iter);
470
471 FcPublic FcBool
472 FcConfigFileInfoIterNext (FcConfig              *config,
473                           FcConfigFileInfoIter  *iter);
474
475 FcPublic FcBool
476 FcConfigFileInfoIterGet (FcConfig               *config,
477                          FcConfigFileInfoIter   *iter,
478                          FcChar8                **name,
479                          FcChar8                **description,
480                          FcBool                 *enabled);
481
482 /* fccharset.c */
483 FcPublic FcCharSet*
484 FcCharSetCreate (void);
485
486 /* deprecated alias for FcCharSetCreate */
487 FcPublic FcCharSet *
488 FcCharSetNew (void);
489
490 FcPublic void
491 FcCharSetDestroy (FcCharSet *fcs);
492
493 FcPublic FcBool
494 FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
495
496 FcPublic FcBool
497 FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);
498
499 FcPublic FcCharSet*
500 FcCharSetCopy (FcCharSet *src);
501
502 FcPublic FcBool
503 FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
504
505 FcPublic FcCharSet*
506 FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
507
508 FcPublic FcCharSet*
509 FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
510
511 FcPublic FcCharSet*
512 FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
513
514 FcPublic FcBool
515 FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
516
517 FcPublic FcBool
518 FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
519
520 FcPublic FcChar32
521 FcCharSetCount (const FcCharSet *a);
522
523 FcPublic FcChar32
524 FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
525
526 FcPublic FcChar32
527 FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
528
529 FcPublic FcBool
530 FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
531
532 #define FC_CHARSET_MAP_SIZE (256/32)
533 #define FC_CHARSET_DONE ((FcChar32) -1)
534
535 FcPublic FcChar32
536 FcCharSetFirstPage (const FcCharSet *a, 
537                     FcChar32        map[FC_CHARSET_MAP_SIZE],
538                     FcChar32        *next);
539
540 FcPublic FcChar32
541 FcCharSetNextPage (const FcCharSet  *a, 
542                    FcChar32         map[FC_CHARSET_MAP_SIZE],
543                    FcChar32         *next);
544
545 /*
546  * old coverage API, rather hard to use correctly
547  */
548
549 FcPublic FcChar32
550 FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
551
552 /* fcdbg.c */
553 FcPublic void
554 FcValuePrint (const FcValue v);
555
556 FcPublic void
557 FcPatternPrint (const FcPattern *p);
558
559 FcPublic void
560 FcFontSetPrint (const FcFontSet *s);
561
562 /* fcdefault.c */
563 FcPublic FcStrSet *
564 FcGetDefaultLangs (void);
565
566 FcPublic void
567 FcDefaultSubstitute (FcPattern *pattern);
568
569 /* fcdir.c */
570 FcPublic FcBool
571 FcFileIsDir (const FcChar8 *file);
572
573 FcPublic FcBool
574 FcFileScan (FcFontSet       *set,
575             FcStrSet        *dirs,
576             FcFileCache     *cache,
577             FcBlanks        *blanks,
578             const FcChar8   *file,
579             FcBool          force);
580
581 FcPublic FcBool
582 FcDirScan (FcFontSet        *set,
583            FcStrSet         *dirs,
584            FcFileCache      *cache,
585            FcBlanks         *blanks,
586            const FcChar8    *dir,
587            FcBool           force);
588
589 FcPublic FcBool
590 FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
591
592 FcPublic FcCache *
593 FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
594
595 FcPublic FcCache *
596 FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
597     
598 FcPublic FcCache *
599 FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
600
601 FcPublic FcCache *
602 FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
603
604 FcPublic void
605 FcDirCacheUnload (FcCache *cache);
606
607 /* fcfreetype.c */
608 FcPublic FcPattern *
609 FcFreeTypeQuery (const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count);
610
611 FcPublic unsigned int
612 FcFreeTypeQueryAll(const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count, FcFontSet *set);
613
614 /* fcfs.c */
615
616 FcPublic FcFontSet *
617 FcFontSetCreate (void);
618
619 FcPublic void
620 FcFontSetDestroy (FcFontSet *s);
621
622 FcPublic FcBool
623 FcFontSetAdd (FcFontSet *s, FcPattern *font);
624
625 /* fcinit.c */
626 FcPublic FcConfig *
627 FcInitLoadConfig (void);
628
629 FcPublic FcConfig *
630 FcInitLoadConfigAndFonts (void);
631
632 FcPublic FcBool
633 FcInit (void);
634
635 FcPublic void
636 FcFini (void);
637
638 FcPublic int
639 FcGetVersion (void);
640
641 FcPublic FcBool
642 FcInitReinitialize (void);
643
644 FcPublic FcBool
645 FcInitBringUptoDate (void);
646
647 /* fclang.c */
648 FcPublic FcStrSet *
649 FcGetLangs (void);
650
651 FcPublic FcChar8 *
652 FcLangNormalize (const FcChar8 *lang);
653
654 FcPublic const FcCharSet *
655 FcLangGetCharSet (const FcChar8 *lang);
656
657 FcPublic FcLangSet*
658 FcLangSetCreate (void);
659
660 FcPublic void
661 FcLangSetDestroy (FcLangSet *ls);
662
663 FcPublic FcLangSet*
664 FcLangSetCopy (const FcLangSet *ls);
665
666 FcPublic FcBool
667 FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
668
669 FcPublic FcBool
670 FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);
671
672 FcPublic FcLangResult
673 FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
674
675 FcPublic FcLangResult
676 FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
677
678 FcPublic FcBool
679 FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
680
681 FcPublic FcBool
682 FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
683
684 FcPublic FcChar32
685 FcLangSetHash (const FcLangSet *ls);
686
687 FcPublic FcStrSet *
688 FcLangSetGetLangs (const FcLangSet *ls);
689
690 FcPublic FcLangSet *
691 FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);
692
693 FcPublic FcLangSet *
694 FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);
695
696 /* fclist.c */
697 FcPublic FcObjectSet *
698 FcObjectSetCreate (void);
699
700 FcPublic FcBool
701 FcObjectSetAdd (FcObjectSet *os, const char *object);
702
703 FcPublic void
704 FcObjectSetDestroy (FcObjectSet *os);
705
706 FcPublic FcObjectSet *
707 FcObjectSetVaBuild (const char *first, va_list va);
708
709 FcPublic FcObjectSet *
710 FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
711
712 FcPublic FcFontSet *
713 FcFontSetList (FcConfig     *config,
714                FcFontSet    **sets,
715                int          nsets,
716                FcPattern    *p,
717                FcObjectSet  *os);
718
719 FcPublic FcFontSet *
720 FcFontList (FcConfig    *config,
721             FcPattern   *p,
722             FcObjectSet *os);
723
724 /* fcatomic.c */
725
726 FcPublic FcAtomic *
727 FcAtomicCreate (const FcChar8   *file);
728
729 FcPublic FcBool
730 FcAtomicLock (FcAtomic *atomic);
731
732 FcPublic FcChar8 *
733 FcAtomicNewFile (FcAtomic *atomic);
734
735 FcPublic FcChar8 *
736 FcAtomicOrigFile (FcAtomic *atomic);
737
738 FcPublic FcBool
739 FcAtomicReplaceOrig (FcAtomic *atomic);
740
741 FcPublic void
742 FcAtomicDeleteNew (FcAtomic *atomic);
743
744 FcPublic void
745 FcAtomicUnlock (FcAtomic *atomic);
746
747 FcPublic void
748 FcAtomicDestroy (FcAtomic *atomic);
749
750 /* fcmatch.c */
751 FcPublic FcPattern *
752 FcFontSetMatch (FcConfig    *config,
753                 FcFontSet   **sets,
754                 int         nsets,
755                 FcPattern   *p,
756                 FcResult    *result);
757
758 FcPublic FcPattern *
759 FcFontMatch (FcConfig   *config,
760              FcPattern  *p, 
761              FcResult   *result);
762
763 FcPublic FcPattern *
764 FcFontRenderPrepare (FcConfig       *config,
765                      FcPattern      *pat,
766                      FcPattern      *font);
767
768 FcPublic FcFontSet *
769 FcFontSetSort (FcConfig     *config,
770                FcFontSet    **sets,
771                int          nsets,
772                FcPattern    *p,
773                FcBool       trim,
774                FcCharSet    **csp,
775                FcResult     *result);
776
777 FcPublic FcFontSet *
778 FcFontSort (FcConfig     *config,
779             FcPattern    *p,
780             FcBool       trim,
781             FcCharSet    **csp,
782             FcResult     *result);
783
784 FcPublic void
785 FcFontSetSortDestroy (FcFontSet *fs);
786
787 /* fcmatrix.c */
788 FcPublic FcMatrix *
789 FcMatrixCopy (const FcMatrix *mat);
790
791 FcPublic FcBool
792 FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
793
794 FcPublic void
795 FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
796
797 FcPublic void
798 FcMatrixRotate (FcMatrix *m, double c, double s);
799
800 FcPublic void
801 FcMatrixScale (FcMatrix *m, double sx, double sy);
802
803 FcPublic void
804 FcMatrixShear (FcMatrix *m, double sh, double sv);
805
806 /* fcname.c */
807
808 /* Deprecated.  Does nothing.  Returns FcFalse. */
809 FcPublic FcBool
810 FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
811
812 /* Deprecated.  Does nothing.  Returns FcFalse. */
813 FcPublic FcBool
814 FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
815
816 FcPublic const FcObjectType *
817 FcNameGetObjectType (const char *object);
818
819 /* Deprecated.  Does nothing.  Returns FcFalse. */
820 FcPublic FcBool
821 FcNameRegisterConstants (const FcConstant *consts, int nconsts);
822
823 /* Deprecated.  Does nothing.  Returns FcFalse. */
824 FcPublic FcBool
825 FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
826
827 FcPublic const FcConstant *
828 FcNameGetConstant (const FcChar8 *string);
829
830 FcPublic FcBool
831 FcNameConstant (const FcChar8 *string, int *result);
832
833 FcPublic FcPattern *
834 FcNameParse (const FcChar8 *name);
835
836 FcPublic FcChar8 *
837 FcNameUnparse (FcPattern *pat);
838
839 /* fcpat.c */
840 FcPublic FcPattern *
841 FcPatternCreate (void);
842
843 FcPublic FcPattern *
844 FcPatternDuplicate (const FcPattern *p);
845
846 FcPublic void
847 FcPatternReference (FcPattern *p);
848
849 FcPublic FcPattern *
850 FcPatternFilter (FcPattern *p, const FcObjectSet *os);
851
852 FcPublic void
853 FcValueDestroy (FcValue v);
854
855 FcPublic FcBool
856 FcValueEqual (FcValue va, FcValue vb);
857
858 FcPublic FcValue
859 FcValueSave (FcValue v);
860
861 FcPublic void
862 FcPatternDestroy (FcPattern *p);
863
864 FcPublic FcBool
865 FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
866
867 FcPublic FcBool
868 FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
869
870 FcPublic FcChar32
871 FcPatternHash (const FcPattern *p);
872
873 FcPublic FcBool
874 FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
875     
876 FcPublic FcBool
877 FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
878     
879 FcPublic FcResult
880 FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
881
882 FcPublic FcResult
883 FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b);
884
885 FcPublic FcBool
886 FcPatternDel (FcPattern *p, const char *object);
887
888 FcPublic FcBool
889 FcPatternRemove (FcPattern *p, const char *object, int id);
890
891 FcPublic FcBool
892 FcPatternAddInteger (FcPattern *p, const char *object, int i);
893
894 FcPublic FcBool
895 FcPatternAddDouble (FcPattern *p, const char *object, double d);
896
897 FcPublic FcBool
898 FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
899
900 FcPublic FcBool
901 FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
902
903 FcPublic FcBool
904 FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
905
906 FcPublic FcBool
907 FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
908
909 FcPublic FcBool
910 FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
911
912 FcPublic FcBool
913 FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);
914
915 FcPublic FcResult
916 FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
917
918 FcPublic FcResult
919 FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
920
921 FcPublic FcResult
922 FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
923
924 FcPublic FcResult
925 FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
926
927 FcPublic FcResult
928 FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
929
930 FcPublic FcResult
931 FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
932
933 FcPublic FcResult
934 FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
935
936 FcPublic FcResult
937 FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);
938
939 FcPublic FcPattern *
940 FcPatternVaBuild (FcPattern *p, va_list va);
941     
942 FcPublic FcPattern *
943 FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
944
945 FcPublic FcChar8 *
946 FcPatternFormat (FcPattern *pat, const FcChar8 *format);
947
948 /* fcrange.c */
949 FcPublic FcRange *
950 FcRangeCreateDouble (double begin, double end);
951
952 FcPublic FcRange *
953 FcRangeCreateInteger (FcChar32 begin, FcChar32 end);
954
955 FcPublic void
956 FcRangeDestroy (FcRange *range);
957
958 FcPublic FcRange *
959 FcRangeCopy (const FcRange *r);
960
961 FcPublic FcBool
962 FcRangeGetDouble(const FcRange *range, double *begin, double *end);
963
964 /* fcweight.c */
965
966 FcPublic int
967 FcWeightFromOpenType (int ot_weight);
968
969 FcPublic double
970 FcWeightFromOpenTypeDouble (double ot_weight);
971
972 FcPublic int
973 FcWeightToOpenType (int fc_weight);
974
975 FcPublic double
976 FcWeightToOpenTypeDouble (double fc_weight);
977
978 /* fcstr.c */
979
980 FcPublic FcChar8 *
981 FcStrCopy (const FcChar8 *s);
982
983 FcPublic FcChar8 *
984 FcStrCopyFilename (const FcChar8 *s);
985     
986 FcPublic FcChar8 *
987 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
988     
989 FcPublic void
990 FcStrFree (FcChar8 *s);
991
992 /* These are ASCII only, suitable only for pattern element names */
993 #define FcIsUpper(c)    ((0101 <= (c) && (c) <= 0132))
994 #define FcIsLower(c)    ((0141 <= (c) && (c) <= 0172))
995 #define FcToLower(c)    (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
996
997 FcPublic FcChar8 *
998 FcStrDowncase (const FcChar8 *s);
999
1000 FcPublic int
1001 FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1002
1003 FcPublic int
1004 FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
1005
1006 FcPublic const FcChar8 *
1007 FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1008
1009 FcPublic const FcChar8 *
1010 FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
1011
1012 FcPublic int
1013 FcUtf8ToUcs4 (const FcChar8 *src_orig,
1014               FcChar32      *dst,
1015               int           len);
1016
1017 FcPublic FcBool
1018 FcUtf8Len (const FcChar8    *string,
1019            int              len,
1020            int              *nchar,
1021            int              *wchar);
1022
1023 #define FC_UTF8_MAX_LEN 6
1024
1025 FcPublic int
1026 FcUcs4ToUtf8 (FcChar32  ucs4,
1027               FcChar8   dest[FC_UTF8_MAX_LEN]);
1028
1029 FcPublic int
1030 FcUtf16ToUcs4 (const FcChar8    *src_orig,
1031                FcEndian         endian,
1032                FcChar32         *dst,
1033                int              len);       /* in bytes */
1034
1035 FcPublic FcBool
1036 FcUtf16Len (const FcChar8   *string,
1037             FcEndian        endian,
1038             int             len,            /* in bytes */
1039             int             *nchar,
1040             int             *wchar);
1041
1042 FcPublic FcChar8 *
1043 FcStrDirname (const FcChar8 *file);
1044
1045 FcPublic FcChar8 *
1046 FcStrBasename (const FcChar8 *file);
1047
1048 FcPublic FcStrSet *
1049 FcStrSetCreate (void);
1050
1051 FcPublic FcBool
1052 FcStrSetMember (FcStrSet *set, const FcChar8 *s);
1053
1054 FcPublic FcBool
1055 FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
1056
1057 FcPublic FcBool
1058 FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
1059
1060 FcPublic FcBool
1061 FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
1062
1063 FcPublic FcBool
1064 FcStrSetDel (FcStrSet *set, const FcChar8 *s);
1065
1066 FcPublic void
1067 FcStrSetDestroy (FcStrSet *set);
1068
1069 FcPublic FcStrList *
1070 FcStrListCreate (FcStrSet *set);
1071
1072 FcPublic void
1073 FcStrListFirst (FcStrList *list);
1074
1075 FcPublic FcChar8 *
1076 FcStrListNext (FcStrList *list);
1077
1078 FcPublic void
1079 FcStrListDone (FcStrList *list);
1080
1081 /* fcxml.c */
1082 FcPublic FcBool
1083 FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
1084
1085 FcPublic FcBool
1086 FcConfigParseAndLoadFromMemory (FcConfig       *config,
1087                                 const FcChar8  *buffer,
1088                                 FcBool         complain);
1089
1090 _FCFUNCPROTOEND
1091
1092 #undef FC_ATTRIBUTE_SENTINEL
1093
1094
1095 #ifndef _FCINT_H_
1096
1097 /*
1098  * Deprecated functions are placed here to help users fix their code without
1099  * digging through documentation
1100  */
1101  
1102 #define FcConfigGetRescanInverval   FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
1103 #define FcConfigSetRescanInverval   FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
1104
1105 #endif
1106
1107 #endif /* _FONTCONFIG_H_ */