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