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