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