cosmetix
[iv.d.git] / fontconfig.d
blob43bf76b30026995b56d0fae50f29f571a31b13e5
1 /*
2 * fontconfig/fontconfig/fontconfig.h
4 * Copyright © 2001 Keith Packard
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.
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.
24 module iv.fontconfig /*is aliced*/;
25 pragma(lib, "fontconfig");
26 pragma(lib, "freetype");
28 import core.stdc.stdarg : va_list;
29 import core.sys.posix.sys.stat;
31 import iv.alice;
32 import iv.freetype;
35 extern(C) nothrow @nogc:
37 alias FcChar8 = char;
38 alias FcChar16 = wchar;
39 alias FcChar32 = dchar;
40 alias FcBool = int;
43 * Current Fontconfig version number. This same number
44 * must appear in the fontconfig configure.in file. Yes,
45 * it'a a pain to synchronize version numbers like this.
48 enum FC_MAJOR = 2;
49 enum FC_MINOR = 11;
50 enum FC_REVISION = 1;
52 enum FC_VERSION = ((FC_MAJOR*10000)+(FC_MINOR*100)+(FC_REVISION));
55 * Current font cache file format version
56 * This is appended to the cache files so that multiple
57 * versions of the library will peacefully coexist
59 * Change this value whenever the disk format for the cache file
60 * changes in any non-compatible way. Try to avoid such changes as
61 * it means multiple copies of the font information.
64 enum FC_CACHE_VERSION = "4";
66 enum FcTrue = 1;
67 enum FcFalse = 0;
69 enum FC_FAMILY = "family"; /* String */
70 enum FC_STYLE = "style"; /* String */
71 enum FC_SLANT = "slant"; /* Int */
72 enum FC_WEIGHT = "weight"; /* Int */
73 enum FC_SIZE = "size"; /* Double */
74 enum FC_ASPECT = "aspect"; /* Double */
75 enum FC_PIXEL_SIZE = "pixelsize"; /* Double */
76 enum FC_SPACING = "spacing"; /* Int */
77 enum FC_FOUNDRY = "foundry"; /* String */
78 enum FC_ANTIALIAS = "antialias"; /* Bool (depends) */
79 enum FC_HINTING = "hinting"; /* Bool (true) */
80 enum FC_HINT_STYLE = "hintstyle"; /* Int */
81 enum FC_VERTICAL_LAYOUT = "verticallayout"; /* Bool (false) */
82 enum FC_AUTOHINT = "autohint"; /* Bool (false) */
83 /* FC_GLOBAL_ADVANCE is deprecated. this is simply ignored on freetype 2.4.5 or later */
84 enum FC_GLOBAL_ADVANCE = "globaladvance"; /* Bool (true) */
85 enum FC_WIDTH = "width"; /* Int */
86 enum FC_FILE = "file"; /* String */
87 enum FC_INDEX = "index"; /* Int */
88 enum FC_FT_FACE = "ftface"; /* FT_Face */
89 enum FC_RASTERIZER = "rasterizer"; /* String (deprecated) */
90 enum FC_OUTLINE = "outline"; /* Bool */
91 enum FC_SCALABLE = "scalable"; /* Bool */
92 enum FC_SCALE = "scale"; /* double */
93 enum FC_DPI = "dpi"; /* double */
94 enum FC_RGBA = "rgba"; /* Int */
95 enum FC_MINSPACE = "minspace"; /* Bool use minimum line spacing */
96 enum FC_SOURCE = "source"; /* String (deprecated) */
97 enum FC_CHARSET = "charset"; /* CharSet */
98 enum FC_LANG = "lang"; /* String RFC 3066 langs */
99 enum FC_FONTVERSION = "fontversion"; /* Int from 'head' table */
100 enum FC_FULLNAME = "fullname"; /* String */
101 enum FC_FAMILYLANG = "familylang"; /* String RFC 3066 langs */
102 enum FC_STYLELANG = "stylelang"; /* String RFC 3066 langs */
103 enum FC_FULLNAMELANG = "fullnamelang"; /* String RFC 3066 langs */
104 enum FC_CAPABILITY = "capability"; /* String */
105 enum FC_FONTFORMAT = "fontformat"; /* String */
106 enum FC_EMBOLDEN = "embolden"; /* Bool - true if emboldening needed*/
107 enum FC_EMBEDDED_BITMAP = "embeddedbitmap"; /* Bool - true to enable embedded bitmaps */
108 enum FC_DECORATIVE = "decorative"; /* Bool - true if style is a decorative variant */
109 enum FC_LCD_FILTER = "lcdfilter"; /* Int */
110 enum FC_FONT_FEATURES = "fontfeatures"; /* String */
111 enum FC_NAMELANG = "namelang"; /* String RFC 3866 langs */
112 enum FC_PRGNAME = "prgname"; /* String */
113 enum FC_HASH = "hash"; /* String */
114 enum FC_POSTSCRIPT_NAME = "postscriptname"; /* String */
116 enum FC_CACHE_SUFFIX = ".cache-"~FC_CACHE_VERSION;
117 enum FC_DIR_CACHE_FILE = "fonts.cache-"~FC_CACHE_VERSION;
118 enum FC_USER_CACHE_FILE = ".fonts.cache-"~FC_CACHE_VERSION;
120 /* Adjust outline rasterizer */
121 enum FC_CHAR_WIDTH = "charwidth"; /* Int */
122 enum FC_CHAR_HEIGHT = "charheight"; /* Int */
123 enum FC_MATRIX = "matrix"; /* FcMatrix */
125 enum FC_WEIGHT_THIN = 0;
126 enum FC_WEIGHT_EXTRALIGHT = 40;
127 enum FC_WEIGHT_ULTRALIGHT = FC_WEIGHT_EXTRALIGHT;
128 enum FC_WEIGHT_LIGHT = 50;
129 enum FC_WEIGHT_BOOK = 75;
130 enum FC_WEIGHT_REGULAR = 80;
131 enum FC_WEIGHT_NORMAL = FC_WEIGHT_REGULAR;
132 enum FC_WEIGHT_MEDIUM = 100;
133 enum FC_WEIGHT_DEMIBOLD = 180;
134 enum FC_WEIGHT_SEMIBOLD = FC_WEIGHT_DEMIBOLD;
135 enum FC_WEIGHT_BOLD = 200;
136 enum FC_WEIGHT_EXTRABOLD = 205;
137 enum FC_WEIGHT_ULTRABOLD = FC_WEIGHT_EXTRABOLD;
138 enum FC_WEIGHT_BLACK = 210;
139 enum FC_WEIGHT_HEAVY = FC_WEIGHT_BLACK;
140 enum FC_WEIGHT_EXTRABLACK = 215;
141 enum FC_WEIGHT_ULTRABLACK = FC_WEIGHT_EXTRABLACK;
143 enum FC_SLANT_ROMAN = 0;
144 enum FC_SLANT_ITALIC = 100;
145 enum FC_SLANT_OBLIQUE = 110;
147 enum FC_WIDTH_ULTRACONDENSED = 50;
148 enum FC_WIDTH_EXTRACONDENSED = 63;
149 enum FC_WIDTH_CONDENSED = 75;
150 enum FC_WIDTH_SEMICONDENSED = 87;
151 enum FC_WIDTH_NORMAL = 100;
152 enum FC_WIDTH_SEMIEXPANDED = 113;
153 enum FC_WIDTH_EXPANDED = 125;
154 enum FC_WIDTH_EXTRAEXPANDED = 150;
155 enum FC_WIDTH_ULTRAEXPANDED = 200;
157 enum FC_PROPORTIONAL = 0;
158 enum FC_DUAL = 90;
159 enum FC_MONO = 100;
160 enum FC_CHARCELL = 110;
162 /* sub-pixel order */
163 enum FC_RGBA_UNKNOWN = 0;
164 enum FC_RGBA_RGB = 1;
165 enum FC_RGBA_BGR = 2;
166 enum FC_RGBA_VRGB = 3;
167 enum FC_RGBA_VBGR = 4;
168 enum FC_RGBA_NONE = 5;
170 /* hinting style */
171 enum FC_HINT_NONE = 0;
172 enum FC_HINT_SLIGHT = 1;
173 enum FC_HINT_MEDIUM = 2;
174 enum FC_HINT_FULL = 3;
176 /* LCD filter */
177 enum FC_LCD_NONE = 0;
178 enum FC_LCD_DEFAULT = 1;
179 enum FC_LCD_LIGHT = 2;
180 enum FC_LCD_LEGACY = 3;
182 alias FcType = int;
183 enum : FcType{
184 FcTypeUnknown = -1,
185 FcTypeVoid,
186 FcTypeInteger,
187 FcTypeDouble,
188 FcTypeString,
189 FcTypeBool,
190 FcTypeMatrix,
191 FcTypeCharSet,
192 FcTypeFTFace,
193 FcTypeLangSet
196 struct FcMatrix {
197 double xx=1, xy=0, yx=0, yy=1;
199 //#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, (m)->xy = (m)->yx = 0)
202 * A data structure to represent the available glyphs in a font.
203 * This is represented as a sparse boolean btree.
205 struct FcCharSet;
207 struct FcObjectType {
208 const(char)* object;
209 FcType type;
212 struct FcConstant {
213 const(FcChar8)* name;
214 const(char)* object;
215 int value;
218 alias FcResult = int;
219 enum : FcResult {
220 FcResultMatch,
221 FcResultNoMatch,
222 FcResultTypeMismatch,
223 FcResultNoId,
224 FcResultOutOfMemory
227 struct FcPattern;
229 struct FcLangSet;
231 struct FcValue {
232 FcType type;
233 union U {
234 const(FcChar8)* s;
235 int i;
236 FcBool b;
237 double d;
238 const(FcMatrix)* m;
239 const(FcCharSet)* c;
240 void* f;
241 const(FcLangSet)* l;
243 U u;
246 struct FcFontSet {
247 int nfont;
248 int sfont;
249 FcPattern** fonts;
252 struct FcObjectSet {
253 int nobject;
254 int sobject;
255 const(char)** objects;
258 alias FcMatchKind = int;
259 enum : FcMatchKind {
260 FcMatchPattern,
261 FcMatchFont,
262 FcMatchScan
265 alias FcLangResult = int;
266 enum : FcLangResult {
267 FcLangEqual = 0,
268 FcLangDifferentCountry = 1,
269 FcLangDifferentTerritory = 1,
270 FcLangDifferentLang = 2
273 alias FcSetName = int;
274 enum : FcSetName {
275 FcSetSystem = 0,
276 FcSetApplication = 1
279 struct FcAtomic;
281 alias FcEndian = int;
282 enum : FcEndian { FcEndianBig, FcEndianLittle }
284 struct FcConfig;
285 struct FcFileCache;
286 struct FcBlanks;
287 struct FcStrList;
288 struct FcStrSet;
289 struct FcCache;
292 /* fcblanks.c */
293 /*FcPublic*/ FcBlanks* FcBlanksCreate ();
294 /*FcPublic*/ void FcBlanksDestroy (FcBlanks* b);
295 /*FcPublic*/ FcBool FcBlanksAdd (FcBlanks* b, FcChar32 ucs4);
296 /*FcPublic*/ FcBool FcBlanksIsMember (FcBlanks* b, FcChar32 ucs4);
298 /* fccache.c */
299 /*FcPublic*/ const(FcChar8)* FcCacheDir(const(FcCache)* c);
300 /*FcPublic*/ FcFontSet* FcCacheCopySet(const(FcCache)* c);
301 /*FcPublic*/ const(FcChar8)* FcCacheSubdir (const(FcCache)* c, int i);
302 /*FcPublic*/ int FcCacheNumSubdir (const(FcCache)* c);
303 /*FcPublic*/ int FcCacheNumFont (const(FcCache)* c);
304 /*FcPublic*/ FcBool FcDirCacheUnlink (const(FcChar8)* dir, FcConfig* config);
305 /*FcPublic*/ FcBool FcDirCacheValid (const(FcChar8)* cache_file);
306 /*FcPublic*/ FcBool FcDirCacheClean (const(FcChar8)* cache_dir, FcBool verbose);
307 /*FcPublic*/ void FcCacheCreateTagFile (const(FcConfig)* config);
309 /* fccfg.c */
310 /*FcPublic*/ FcChar8* FcConfigHome ();
311 /*FcPublic*/ FcBool FcConfigEnableHome (FcBool enable);
312 /*FcPublic*/ FcChar8* FcConfigFilename (const(FcChar8)* url);
313 /*FcPublic*/ FcConfig* FcConfigCreate ();
314 /*FcPublic*/ FcConfig* FcConfigReference (FcConfig* config);
315 /*FcPublic*/ void FcConfigDestroy (FcConfig* config);
316 /*FcPublic*/ FcBool FcConfigSetCurrent (FcConfig* config);
317 /*FcPublic*/ FcConfig* FcConfigGetCurrent ();
318 /*FcPublic*/ FcBool FcConfigUptoDate (FcConfig* config);
319 /*FcPublic*/ FcBool FcConfigBuildFonts (FcConfig* config);
320 /*FcPublic*/ FcStrList* FcConfigGetFontDirs (FcConfig* config);
321 /*FcPublic*/ FcStrList* FcConfigGetConfigDirs (FcConfig* config);
322 /*FcPublic*/ FcStrList* FcConfigGetConfigFiles (FcConfig* config);
323 /*FcPublic*/ FcChar8* FcConfigGetCache (FcConfig* config);
324 /*FcPublic*/ FcBlanks* FcConfigGetBlanks (FcConfig* config);
325 /*FcPublic*/ FcStrList* FcConfigGetCacheDirs (const(FcConfig)* config);
326 /*FcPublic*/ int FcConfigGetRescanInterval (FcConfig* config);
327 /*FcPublic*/ FcBool FcConfigSetRescanInterval (FcConfig* config, int rescanInterval);
328 /*FcPublic*/ FcFontSet* FcConfigGetFonts (FcConfig* config, FcSetName set);
329 /*FcPublic*/ FcBool FcConfigAppFontAddFile (FcConfig* config, const(FcChar8)* file);
330 /*FcPublic*/ FcBool FcConfigAppFontAddDir (FcConfig* config, const(FcChar8)* dir);
331 /*FcPublic*/ void FcConfigAppFontClear (FcConfig* config);
332 /*FcPublic*/ FcBool FcConfigSubstituteWithPat (FcConfig* config, FcPattern* p, FcPattern* p_pat, FcMatchKind kind);
333 /*FcPublic*/ FcBool FcConfigSubstitute (FcConfig* config, FcPattern* p, FcMatchKind kind);
334 /*FcPublic*/ const(FcChar8)* FcConfigGetSysRoot (const(FcConfig)* config);
335 /*FcPublic*/ void FcConfigSetSysRoot (FcConfig* config, const(FcChar8)* sysroot);
337 /* fccharset.c */
338 /*FcPublic*/ FcCharSet* FcCharSetCreate ();
340 /* deprecated alias for FcCharSetCreate */
341 /*FcPublic*/ FcCharSet* FcCharSetNew ();
342 /*FcPublic*/ void FcCharSetDestroy (FcCharSet* fcs);
343 /*FcPublic*/ FcBool FcCharSetAddChar (FcCharSet* fcs, FcChar32 ucs4);
344 /*FcPublic*/ FcBool FcCharSetDelChar (FcCharSet* fcs, FcChar32 ucs4);
345 /*FcPublic*/ FcCharSet* FcCharSetCopy (FcCharSet* src);
346 /*FcPublic*/ FcBool FcCharSetEqual (const(FcCharSet)* a, const(FcCharSet)* b);
347 /*FcPublic*/ FcCharSet* FcCharSetIntersect (const(FcCharSet)* a, const(FcCharSet)* b);
348 /*FcPublic*/ FcCharSet* FcCharSetUnion (const(FcCharSet)* a, const(FcCharSet)* b);
349 /*FcPublic*/ FcCharSet* FcCharSetSubtract (const(FcCharSet)* a, const(FcCharSet)* b);
350 /*FcPublic*/ FcBool FcCharSetMerge (FcCharSet* a, const(FcCharSet)* b, FcBool* changed);
351 /*FcPublic*/ FcBool FcCharSetHasChar (const(FcCharSet)* fcs, FcChar32 ucs4);
352 /*FcPublic*/ FcChar32 FcCharSetCount (const(FcCharSet)* a);
353 /*FcPublic*/ FcChar32 FcCharSetIntersectCount (const(FcCharSet)* a, const(FcCharSet)* b);
354 /*FcPublic*/ FcChar32 FcCharSetSubtractCount (const(FcCharSet)* a, const(FcCharSet)* b);
355 /*FcPublic*/ FcBool FcCharSetIsSubset (const(FcCharSet)* a, const(FcCharSet)* b);
357 enum FC_CHARSET_MAP_SIZE = (256/32);
358 enum FC_CHARSET_DONE = (cast(FcChar32)-1);
360 /*FcPublic*/ FcChar32 FcCharSetFirstPage (const(FcCharSet)* a, FcChar32*/*[FC_CHARSET_MAP_SIZE]*/ map, FcChar32 *next);
361 /*FcPublic*/ FcChar32 FcCharSetNextPage (const(FcCharSet)* a, FcChar32*/*[FC_CHARSET_MAP_SIZE]*/ map, FcChar32* next);
364 * old coverage API, rather hard to use correctly
366 /*FcPublic*/ FcChar32 FcCharSetCoverage (const(FcCharSet)* a, FcChar32 page, FcChar32* result);
368 /* fcdbg.c */
369 /*FcPublic*/ void FcValuePrint (const FcValue v);
370 /*FcPublic*/ void FcPatternPrint (const(FcPattern)* p);
371 /*FcPublic*/ void FcFontSetPrint (const(FcFontSet)* s);
373 /* fcdefault.c */
374 /*FcPublic*/ FcStrSet* FcGetDefaultLangs ();
375 /*FcPublic*/ void FcDefaultSubstitute (FcPattern* pattern);
377 /* fcdir.c */
378 /*FcPublic*/ FcBool FcFileIsDir (const(FcChar8)* file);
379 /*FcPublic*/ FcBool FcFileScan (FcFontSet* set, FcStrSet* dirs, FcFileCache* cache, FcBlanks* blanks, const(FcChar8)* file, FcBool force);
380 /*FcPublic*/ FcBool FcDirScan (FcFontSet* set, FcStrSet* dirs, FcFileCache* cache, FcBlanks* blanks, const(FcChar8)* dir, FcBool force);
381 /*FcPublic*/ FcBool FcDirSave (FcFontSet* set, FcStrSet* dirs, const(FcChar8)* dir);
382 /*FcPublic*/ FcCache* FcDirCacheLoad (const(FcChar8)* dir, FcConfig* config, FcChar8** cache_file);
383 /*FcPublic*/ FcCache* FcDirCacheRescan (const(FcChar8)* dir, FcConfig* config);
384 /*FcPublic*/ FcCache* FcDirCacheRead (const(FcChar8)* dir, FcBool force, FcConfig* config);
385 /*FcPublic*/ FcCache* FcDirCacheLoadFile (const(FcChar8)* cache_file, stat_t* file_stat);
386 /*FcPublic*/ void FcDirCacheUnload (FcCache* cache);
388 /* fcfreetype.c */
389 /*FcPublic*/ FcPattern* FcFreeTypeQuery (const(FcChar8)* file, int id, FcBlanks* blanks, int* count);
391 /* fcfs.c */
392 /*FcPublic*/ FcFontSet* FcFontSetCreate ();
393 /*FcPublic*/ void FcFontSetDestroy (FcFontSet* s);
394 /*FcPublic*/ FcBool FcFontSetAdd (FcFontSet* s, FcPattern* font);
396 /* fcinit.c */
397 /*FcPublic*/ FcConfig* FcInitLoadConfig ();
398 /*FcPublic*/ FcConfig* FcInitLoadConfigAndFonts ();
399 /*FcPublic*/ FcBool FcInit ();
400 /*FcPublic*/ void FcFini ();
401 /*FcPublic*/ int FcGetVersion ();
402 /*FcPublic*/ FcBool FcInitReinitialize ();
403 /*FcPublic*/ FcBool FcInitBringUptoDate ();
405 /* fclang.c */
406 /*FcPublic*/ FcStrSet* FcGetLangs ();
407 /*FcPublic*/ FcChar8* FcLangNormalize (const(FcChar8)* lang);
408 /*FcPublic*/ const(FcCharSet)* FcLangGetCharSet (const(FcChar8)* lang);
409 /*FcPublic*/ FcLangSet* FcLangSetCreate ();
410 /*FcPublic*/ void FcLangSetDestroy (FcLangSet* ls);
411 /*FcPublic*/ FcLangSet* FcLangSetCopy (const(FcLangSet)* ls);
412 /*FcPublic*/ FcBool FcLangSetAdd (FcLangSet* ls, const(FcChar8)* lang);
413 /*FcPublic*/ FcBool FcLangSetDel (FcLangSet* ls, const(FcChar8)* lang);
414 /*FcPublic*/ FcLangResult FcLangSetHasLang (const(FcLangSet)* ls, const(FcChar8)* lang);
415 /*FcPublic*/ FcLangResult FcLangSetCompare (const(FcLangSet)* lsa, const(FcLangSet)* lsb);
416 /*FcPublic*/ FcBool FcLangSetContains (const(FcLangSet)* lsa, const(FcLangSet)* lsb);
417 /*FcPublic*/ FcBool FcLangSetEqual (const(FcLangSet)* lsa, const(FcLangSet)* lsb);
418 /*FcPublic*/ FcChar32 FcLangSetHash (const(FcLangSet)* ls);
419 /*FcPublic*/ FcStrSet* FcLangSetGetLangs (const(FcLangSet)* ls);
420 /*FcPublic*/ FcLangSet* FcLangSetUnion (const(FcLangSet)* a, const(FcLangSet)* b);
421 /*FcPublic*/ FcLangSet* FcLangSetSubtract (const(FcLangSet)* a, const(FcLangSet)* b);
423 /* fclist.c */
424 /*FcPublic*/ FcObjectSet* FcObjectSetCreate ();
425 /*FcPublic*/ FcBool FcObjectSetAdd (FcObjectSet* os, const(char)* object);
426 /*FcPublic*/ void FcObjectSetDestroy (FcObjectSet* os);
427 /*FcPublic*/ FcObjectSet* FcObjectSetVaBuild (const(char)* first, va_list va);
428 /*FcPublic*/ FcObjectSet* FcObjectSetBuild (const(char)* first, ...) /*FC_ATTRIBUTE_SENTINEL(0)*/;
429 /*FcPublic*/ FcFontSet* FcFontSetList (FcConfig* config, FcFontSet** sets, int nsets, FcPattern* p, FcObjectSet* os);
430 /*FcPublic*/ FcFontSet* FcFontList (FcConfig* config, FcPattern* p, FcObjectSet* os);
432 /* fcatomic.c */
433 /*FcPublic*/ FcAtomic* FcAtomicCreate (const(FcChar8)* file);
434 /*FcPublic*/ FcBool FcAtomicLock (FcAtomic* atomic);
435 /*FcPublic*/ FcChar8* FcAtomicNewFile (FcAtomic* atomic);
436 /*FcPublic*/ FcChar8* FcAtomicOrigFile (FcAtomic* atomic);
437 /*FcPublic*/ FcBool FcAtomicReplaceOrig (FcAtomic* atomic);
438 /*FcPublic*/ void FcAtomicDeleteNew (FcAtomic* atomic);
439 /*FcPublic*/ void FcAtomicUnlock (FcAtomic* atomic);
440 /*FcPublic*/ void FcAtomicDestroy (FcAtomic* atomic);
442 /* fcmatch.c */
443 /*FcPublic*/ FcPattern* FcFontSetMatch (FcConfig* config, FcFontSet** sets, int nsets, FcPattern* p, FcResult* result);
444 /*FcPublic*/ FcPattern* FcFontMatch (FcConfig* config, FcPattern* p, FcResult* result);
445 /*FcPublic*/ FcPattern* FcFontRenderPrepare (FcConfig* config, FcPattern* pat, FcPattern* font);
446 /*FcPublic*/ FcFontSet* FcFontSetSort (FcConfig* config, FcFontSet** sets, int nsets, FcPattern* p, FcBool trim, FcCharSet** csp,FcResult* result);
447 /*FcPublic*/ FcFontSet* FcFontSort (FcConfig* config, FcPattern* p, FcBool trim, FcCharSet** csp, FcResult* result);
448 /*FcPublic*/ void FcFontSetSortDestroy (FcFontSet* fs);
450 /* fcmatrix.c */
451 /*FcPublic*/ FcMatrix* FcMatrixCopy (const(FcMatrix)* mat);
452 /*FcPublic*/ FcBool FcMatrixEqual (const(FcMatrix)* mat1, const(FcMatrix)* mat2);
453 /*FcPublic*/ void FcMatrixMultiply (FcMatrix* result, const(FcMatrix)* a, const(FcMatrix)* b);
454 /*FcPublic*/ void FcMatrixRotate (FcMatrix* m, double c, double s);
455 /*FcPublic*/ void FcMatrixScale (FcMatrix* m, double sx, double sy);
456 /*FcPublic*/ void FcMatrixShear (FcMatrix* m, double sh, double sv);
458 /* fcname.c */
459 /* Deprecated. Does nothing. Returns FcFalse. */
460 /*FcPublic*/ FcBool FcNameRegisterObjectTypes (const(FcObjectType)* types, int ntype);
461 /* Deprecated. Does nothing. Returns FcFalse. */
462 /*FcPublic*/ FcBool FcNameUnregisterObjectTypes (const(FcObjectType)* types, int ntype);
463 /*FcPublic*/ const(FcObjectType)* FcNameGetObjectType (const(char)* object);
464 /* Deprecated. Does nothing. Returns FcFalse. */
465 /*FcPublic*/ FcBool FcNameRegisterConstants (const(FcConstant)* consts, int nconsts);
466 /* Deprecated. Does nothing. Returns FcFalse. */
467 /*FcPublic*/ FcBool FcNameUnregisterConstants (const(FcConstant)* consts, int nconsts);
468 /*FcPublic*/ const(FcConstant)* FcNameGetConstant (const(FcChar8)* string);
469 /*FcPublic*/ FcBool FcNameConstant (const(FcChar8)* string, int* result);
470 /*FcPublic*/ FcPattern* FcNameParse (const(FcChar8)* name);
471 /*FcPublic*/ FcChar8* FcNameUnparse (FcPattern* pat);
473 /* fcpat.c */
474 /*FcPublic*/ FcPattern* FcPatternCreate ();
475 /*FcPublic*/ FcPattern* FcPatternDuplicate (const(FcPattern)* p);
476 /*FcPublic*/ void FcPatternReference (FcPattern* p);
477 /*FcPublic*/ FcPattern* FcPatternFilter (FcPattern* p, const(FcObjectSet)* os);
478 /*FcPublic*/ void FcValueDestroy (FcValue v);
479 /*FcPublic*/ FcBool FcValueEqual (FcValue va, FcValue vb);
480 /*FcPublic*/ FcValue FcValueSave (FcValue v);
481 /*FcPublic*/ void FcPatternDestroy (FcPattern* p);
482 /*FcPublic*/ FcBool FcPatternEqual (const(FcPattern)* pa, const(FcPattern)* pb);
483 /*FcPublic*/ FcBool FcPatternEqualSubset (const(FcPattern)* pa, const(FcPattern)* pb, const(FcObjectSet)* os);
484 /*FcPublic*/ FcChar32 FcPatternHash (const(FcPattern)* p);
485 /*FcPublic*/ FcBool FcPatternAdd (FcPattern* p, const(char)* object, FcValue value, FcBool append);
486 /*FcPublic*/ FcBool FcPatternAddWeak (FcPattern* p, const(char)* object, FcValue value, FcBool append);
487 /*FcPublic*/ FcResult FcPatternGet (const(FcPattern)* p, const(char)* object, int id, FcValue* v);
488 /*FcPublic*/ FcBool FcPatternDel (FcPattern* p, const(char)* object);
489 /*FcPublic*/ FcBool FcPatternRemove (FcPattern* p, const(char)* object, int id);
490 /*FcPublic*/ FcBool FcPatternAddInteger (FcPattern* p, const(char)* object, int i);
491 /*FcPublic*/ FcBool FcPatternAddDouble (FcPattern* p, const(char)* object, double d);
492 /*FcPublic*/ FcBool FcPatternAddString (FcPattern* p, const(char)* object, const(FcChar8)* s);
493 /*FcPublic*/ FcBool FcPatternAddMatrix (FcPattern* p, const(char)* object, const(FcMatrix)* s);
494 /*FcPublic*/ FcBool FcPatternAddCharSet (FcPattern* p, const(char)* object, const(FcCharSet)* c);
495 /*FcPublic*/ FcBool FcPatternAddBool (FcPattern* p, const(char)* object, FcBool b);
496 /*FcPublic*/ FcBool FcPatternAddLangSet (FcPattern* p, const(char)* object, const(FcLangSet)* ls);
497 /*FcPublic*/ FcResult FcPatternGetInteger (const(FcPattern)* p, const(char)* object, int n, int* i);
498 /*FcPublic*/ FcResult FcPatternGetDouble (const(FcPattern)* p, const(char)* object, int n, double* d);
499 /*FcPublic*/ FcResult FcPatternGetString (const(FcPattern)* p, const(char)* object, int n, FcChar8** s);
500 /*FcPublic*/ FcResult FcPatternGetMatrix (const(FcPattern)* p, const(char)* object, int n, FcMatrix** s);
501 /*FcPublic*/ FcResult FcPatternGetCharSet (const(FcPattern)* p, const(char)* object, int n, FcCharSet** c);
502 /*FcPublic*/ FcResult FcPatternGetBool (const(FcPattern)* p, const(char)* object, int n, FcBool* b);
503 /*FcPublic*/ FcResult FcPatternGetLangSet (const(FcPattern)* p, const(char)* object, int n, FcLangSet** ls);
504 /*FcPublic*/ FcPattern* FcPatternVaBuild (FcPattern* p, va_list va);
505 /*FcPublic*/ FcPattern* FcPatternBuild (FcPattern* p, ...) /*FC_ATTRIBUTE_SENTINEL(0)*/;
506 /*FcPublic*/ FcChar8* FcPatternFormat (FcPattern* pat, const(FcChar8)* format);
508 /* fcstr.c */
509 /*FcPublic*/ FcChar8* FcStrCopy (const(FcChar8)* s);
510 /*FcPublic*/ FcChar8* FcStrCopyFilename (const(FcChar8)* s);
511 /*FcPublic*/ FcChar8* FcStrPlus (const(FcChar8)* s1, const(FcChar8)* s2);
512 /*FcPublic*/ void FcStrFree (FcChar8* s);
514 /* These are ASCII only, suitable only for pattern element names */
516 #define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132))
517 #define FcIsLower(c) ((0141 <= (c) && (c) <= 0172))
518 #define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
521 /*FcPublic*/ FcChar8* FcStrDowncase (const(FcChar8)* s);
522 /*FcPublic*/ int FcStrCmpIgnoreCase (const(FcChar8)* s1, const(FcChar8)* s2);
523 /*FcPublic*/ int FcStrCmp (const(FcChar8)* s1, const(FcChar8)* s2);
524 /*FcPublic*/ const(FcChar8)* FcStrStrIgnoreCase (const(FcChar8)* s1, const(FcChar8)* s2);
525 /*FcPublic*/ const(FcChar8)* FcStrStr (const(FcChar8)* s1, const(FcChar8)* s2);
526 /*FcPublic*/ int FcUtf8ToUcs4 (const(FcChar8)* src_orig, FcChar32* dst, int len);
527 /*FcPublic*/ FcBool FcUtf8Len (const(FcChar8)* string, int len, int* nchar, int* wchr);
529 enum FC_UTF8_MAX_LEN = 6;
531 /*FcPublic*/ int FcUcs4ToUtf8 (FcChar32 ucs4, FcChar8*/*[FC_UTF8_MAX_LEN]*/ dest);
532 /*FcPublic*/ int FcUtf16ToUcs4 (const(FcChar8)* src_orig, FcEndian endian, FcChar32* dst, int len); /* len: in bytes */
533 /*FcPublic*/ FcBool FcUtf16Len (const(FcChar8)* string, FcEndian endian, int len, int* nchar, int* wchr); /* len: in bytes */
534 /*FcPublic*/ FcChar8* FcStrDirname (const(FcChar8)* file);
535 /*FcPublic*/ FcChar8* FcStrBasename (const(FcChar8)* file);
536 /*FcPublic*/ FcStrSet* FcStrSetCreate ();
537 /*FcPublic*/ FcBool FcStrSetMember (FcStrSet* set, const(FcChar8)* s);
538 /*FcPublic*/ FcBool FcStrSetEqual (FcStrSet* sa, FcStrSet* sb);
539 /*FcPublic*/ FcBool FcStrSetAdd (FcStrSet* set, const(FcChar8)* s);
540 /*FcPublic*/ FcBool FcStrSetAddFilename (FcStrSet* set, const(FcChar8)* s);
541 /*FcPublic*/ FcBool FcStrSetDel (FcStrSet* set, const(FcChar8)* s);
542 /*FcPublic*/ void FcStrSetDestroy (FcStrSet* set);
543 /*FcPublic*/ FcStrList* FcStrListCreate (FcStrSet* set);
544 /*FcPublic*/ void FcStrListFirst (FcStrList* list);
545 /*FcPublic*/ FcChar8* FcStrListNext (FcStrList* list);
546 /*FcPublic*/ void FcStrListDone (FcStrList* list);
548 /* fcxml.c */
549 /*FcPublic*/ FcBool FcConfigParseAndLoad (FcConfig* config, const(FcChar8)* file, FcBool complain);
553 #ifndef _FCINT_H_
555 * Deprecated functions are placed here to help users fix their code without
556 * digging through documentation
558 #define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
559 #define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
560 #endif
563 /* fcfreetype.h */
564 /*FcPublic*/ FT_UInt FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4);
565 /*FcPublic*/ FcCharSet* FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks* blanks, int* spacing);
566 /*FcPublic*/ FcCharSet* FcFreeTypeCharSet (FT_Face face, FcBlanks* blanks);
567 /*FcPublic*/ FcResult FcPatternGetFTFace (const(FcPattern)* p, const(char)* object, int n, FT_Face* f);
568 /*FcPublic*/ FcBool FcPatternAddFTFace (FcPattern* p, const(char)* object, const FT_Face f);
569 /*FcPublic*/ FcPattern* FcFreeTypeQueryFace (const FT_Face face, const(FcChar8)* file, int id, FcBlanks* blanks);