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