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