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