Whitespace
[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 FcPublic FcBool
738 FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
739
740 FcPublic FcBool
741 FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
742     
743 FcPublic const FcObjectType *
744 FcNameGetObjectType (const char *object);
745
746 FcPublic FcBool
747 FcNameRegisterConstants (const FcConstant *consts, int nconsts);
748
749 FcPublic FcBool
750 FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
751     
752 FcPublic const FcConstant *
753 FcNameGetConstant (const FcChar8 *string);
754
755 FcPublic FcBool
756 FcNameConstant (const FcChar8 *string, int *result);
757
758 FcPublic FcPattern *
759 FcNameParse (const FcChar8 *name);
760
761 FcPublic FcChar8 *
762 FcNameUnparse (FcPattern *pat);
763
764 /* fcpat.c */
765 FcPublic FcPattern *
766 FcPatternCreate (void);
767
768 FcPublic FcPattern *
769 FcPatternDuplicate (const FcPattern *p);
770
771 FcPublic void
772 FcPatternReference (FcPattern *p);
773
774 FcPublic FcPattern *
775 FcPatternFilter (FcPattern *p, const FcObjectSet *os);
776
777 FcPublic void
778 FcValueDestroy (FcValue v);
779
780 FcPublic FcBool
781 FcValueEqual (FcValue va, FcValue vb);
782
783 FcPublic FcValue
784 FcValueSave (FcValue v);
785
786 FcPublic void
787 FcPatternDestroy (FcPattern *p);
788
789 FcPublic FcBool
790 FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
791
792 FcPublic FcBool
793 FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
794
795 FcPublic FcChar32
796 FcPatternHash (const FcPattern *p);
797
798 FcPublic FcBool
799 FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
800     
801 FcPublic FcBool
802 FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
803     
804 FcPublic FcResult
805 FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
806     
807 FcPublic FcBool
808 FcPatternDel (FcPattern *p, const char *object);
809
810 FcPublic FcBool
811 FcPatternRemove (FcPattern *p, const char *object, int id);
812
813 FcPublic FcBool
814 FcPatternAddInteger (FcPattern *p, const char *object, int i);
815
816 FcPublic FcBool
817 FcPatternAddDouble (FcPattern *p, const char *object, double d);
818
819 FcPublic FcBool
820 FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
821
822 FcPublic FcBool
823 FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
824
825 FcPublic FcBool
826 FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
827
828 FcPublic FcBool
829 FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
830
831 FcPublic FcBool
832 FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
833
834 FcPublic FcResult
835 FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
836
837 FcPublic FcResult
838 FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
839
840 FcPublic FcResult
841 FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
842
843 FcPublic FcResult
844 FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
845
846 FcPublic FcResult
847 FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
848
849 FcPublic FcResult
850 FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
851
852 FcPublic FcResult
853 FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
854
855 FcPublic FcPattern *
856 FcPatternVaBuild (FcPattern *p, va_list va);
857     
858 FcPublic FcPattern *
859 FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
860
861 FcPublic FcChar8 *
862 FcPatternFormat (FcPattern *pat, const FcChar8 *format);
863
864 /* fcstr.c */
865
866 FcPublic FcChar8 *
867 FcStrCopy (const FcChar8 *s);
868
869 FcPublic FcChar8 *
870 FcStrCopyFilename (const FcChar8 *s);
871     
872 FcPublic FcChar8 *
873 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
874     
875 FcPublic void
876 FcStrFree (FcChar8 *s);
877
878 /* These are ASCII only, suitable only for pattern element names */
879 #define FcIsUpper(c)    ((0101 <= (c) && (c) <= 0132))
880 #define FcIsLower(c)    ((0141 <= (c) && (c) <= 0172))
881 #define FcToLower(c)    (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
882
883 FcPublic FcChar8 *
884 FcStrDowncase (const FcChar8 *s);
885
886 FcPublic int
887 FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
888
889 FcPublic int
890 FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
891
892 FcPublic const FcChar8 *
893 FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
894
895 FcPublic const FcChar8 *
896 FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
897
898 FcPublic int
899 FcUtf8ToUcs4 (const FcChar8 *src_orig,
900               FcChar32      *dst,
901               int           len);
902
903 FcPublic FcBool
904 FcUtf8Len (const FcChar8    *string,
905            int              len,
906            int              *nchar,
907            int              *wchar);
908
909 #define FC_UTF8_MAX_LEN 6
910
911 FcPublic int
912 FcUcs4ToUtf8 (FcChar32  ucs4,
913               FcChar8   dest[FC_UTF8_MAX_LEN]);
914
915 FcPublic int
916 FcUtf16ToUcs4 (const FcChar8    *src_orig,
917                FcEndian         endian,
918                FcChar32         *dst,
919                int              len);       /* in bytes */
920
921 FcPublic FcBool
922 FcUtf16Len (const FcChar8   *string,
923             FcEndian        endian,
924             int             len,            /* in bytes */
925             int             *nchar,
926             int             *wchar);
927
928 FcPublic FcChar8 *
929 FcStrDirname (const FcChar8 *file);
930
931 FcPublic FcChar8 *
932 FcStrBasename (const FcChar8 *file);
933
934 FcPublic FcStrSet *
935 FcStrSetCreate (void);
936
937 FcPublic FcBool
938 FcStrSetMember (FcStrSet *set, const FcChar8 *s);
939
940 FcPublic FcBool
941 FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
942
943 FcPublic FcBool
944 FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
945
946 FcPublic FcBool
947 FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
948
949 FcPublic FcBool
950 FcStrSetDel (FcStrSet *set, const FcChar8 *s);
951
952 FcPublic void
953 FcStrSetDestroy (FcStrSet *set);
954
955 FcPublic FcStrList *
956 FcStrListCreate (FcStrSet *set);
957
958 FcPublic FcChar8 *
959 FcStrListNext (FcStrList *list);
960
961 FcPublic void
962 FcStrListDone (FcStrList *list);
963
964 /* fcxml.c */
965 FcPublic FcBool
966 FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
967
968 _FCFUNCPROTOEND
969
970 #undef FC_ATTRIBUTE_SENTINEL
971
972
973 #ifndef _FCINT_H_
974
975 /*
976  * Deprecated functions are placed here to help users fix their code without
977  * digging through documentation
978  */
979  
980 #define FcConfigGetRescanInverval   FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
981 #define FcConfigSetRescanInverval   FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
982
983 #endif
984
985 #endif /* _FONTCONFIG_H_ */