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