fontconfig-devel.txt revision 2c393a42
1Fontconfig Developers Reference, Version 2.6.0 2 3Keith Packard 4 5 HP Cambridge Research Lab 6 __________________________________________________________ 7 8 Table of Contents 9 1. DESCRIPTION 10 2. FUNCTIONAL OVERVIEW 11 12 2.1. FONT CONFIGURATION 13 2.2. FONT PROPERTIES 14 15 3. Datatypes 16 17 3.1. FcChar8, FcChar16, FcChar32, FcBool 18 3.2. FcMatrix 19 3.3. FcCharSet 20 3.4. FcLangSet 21 3.5. FcLangResult 22 3.6. FcType 23 3.7. FcValue 24 3.8. FcPattern 25 3.9. FcFontSet 26 3.10. FcStrSet, FcStrList 27 3.11. FcObjectSet 28 3.12. FcObjectType 29 3.13. FcConstant 30 3.14. FcBlanks 31 3.15. FcFileCache 32 3.16. FcConfig 33 3.17. FcSetName 34 3.18. FcResult 35 3.19. FcAtomic 36 3.20. FcCache 37 38 4. FUNCTIONS 39 40 4.1. Initialization 41 42 FcInitLoadConfig -- load configuration 43 FcInitLoadConfigAndFonts -- load configuration and 44 font data 45 46 FcInit -- initialize fontconfig library 47 FcFini -- finalize fonconfig library 48 FcGetVersion -- library version number 49 FcInitReinitialize -- re-initialize library 50 FcInitBringUptoDate -- reload configuration files if 51 needed 52 53 4.2. FcPattern 54 55 FcPatternCreate -- Create a pattern 56 FcPatternDuplicate -- Copy a pattern 57 FcPatternReference -- Increment pattern reference 58 count 59 60 FcPatternDestroy -- Destroy a pattern 61 FcPatternEqual -- Compare patterns 62 FcPatternEqualSubset -- Compare portions of patterns 63 FcPatternHash -- Compute a pattern hash value 64 FcPatternAdd -- Add a value to a pattern 65 FcPatternAddWeak -- Add a value to a pattern with 66 weak binding 67 68 FcPatternAdd-Type -- Add a typed value to a pattern 69 FcPatternGet -- Return a value from a pattern 70 FcPatternGet-Type -- Return a typed value from a 71 pattern 72 73 FcPatternBuild -- Create patterns from arguments 74 FcPatternDel -- Delete a property from a pattern 75 FcPatternRemove -- Remove one object of the 76 specified type from the pattern 77 78 FcPatternPrint -- Print a pattern for debugging 79 FcDefaultSubstitute -- Perform default substitutions 80 in a pattern 81 82 FcNameParse -- Parse a pattern string 83 FcNameUnparse -- Convert a pattern back into a 84 string that can be parsed 85 86 4.3. FcFontSet 87 88 FcFontSetCreate -- Create a font set 89 FcFontSetDestroy -- Destroy a font set 90 FcFontSetAdd -- Add to a font set 91 FcFontSetList -- List fonts from a set of font sets 92 FcFontSetMatch -- Return the best font from a set of 93 font sets 94 95 FcFontSetPrint -- Print a set of patterns to stdout 96 FcFontSetSort -- Add to a font set 97 FcFontSetSortDestroy -- DEPRECATED destroy a font 98 set 99 100 4.4. FcObjectSet 101 102 FcObjectSetCreate -- Create an object set 103 FcObjectSetAdd -- Add to an object set 104 FcObjectSetDestroy -- Destroy an object set 105 FcObjectSetBuild -- Build object set from args 106 107 4.5. FreeType specific functions 108 109 FcFreeTypeCharIndex -- map Unicode to glyph id 110 FcFreeTypeCharSet -- compute unicode coverage 111 FcFreeTypeCharSetAndSpacing -- compute unicode 112 coverage and spacing type 113 114 FcFreeTypeQuery -- compute pattern from font file 115 (and index) 116 117 FcFreeTypeQueryFace -- compute pattern from FT_Face 118 119 4.6. FcValue 120 121 FcValueDestroy -- Free a value 122 FcValueSave -- Copy a value 123 FcValuePrint -- Print a value to stdout 124 FcValueEqual -- Test two values for equality 125 126 4.7. FcCharSet 127 128 FcCharSetCreate -- Create an empty character set 129 FcCharSetDestroy -- Destroy a character set 130 FcCharSetAddChar -- Add a character to a charset 131 FcCharSetCopy -- Copy a charset 132 FcCharSetEqual -- Compare two charsets 133 FcCharSetIntersect -- Intersect charsets 134 FcCharSetUnion -- Add charsets 135 FcCharSetSubtract -- Subtract charsets 136 FcCharSetHasChar -- Check a charset for a char 137 FcCharSetCount -- Count entries in a charset 138 FcCharSetIntersectCount -- Intersect and count 139 charsets 140 141 FcCharSetSubtractCount -- Subtract and count 142 charsets 143 144 FcCharSetIsSubset -- Test for charset inclusion 145 FcCharSetFirstPage -- Start enumerating charset 146 contents 147 148 FcCharSetNextPage -- Continue enumerating charset 149 contents 150 151 FcCharSetCoverage -- DEPRECATED return coverage for 152 a Unicode page 153 154 FcCharSetNew -- DEPRECATED alias for FcCharSetCreate 155 156 4.8. FcLangSet 157 158 FcLangSetCreate -- create a langset object 159 FcLangSetDestroy -- destroy a langset object 160 FcLangSetCopy -- copy a langset object 161 FcLangSetAdd -- add a language to a langset 162 FcLangSetCompare -- compare language sets 163 FcLangSetContains -- check langset subset relation 164 FcLangSetEqual -- test for matching langsets 165 FcLangSetHash -- return a hash value for a langset 166 FcLangSetHasLang -- test langset for language 167 support 168 169 FcGetLangs -- Get list of languages 170 FcLangGetCharSet -- Get character map for a language 171 172 4.9. FcMatrix 173 174 FcMatrixInit -- initialize an FcMatrix structure 175 FcMatrixCopy -- Copy a matrix 176 FcMatrixEqual -- Compare two matrices 177 FcMatrixMultiply -- Multiply matrices 178 FcMatrixRotate -- Rotate a matrix 179 FcMatrixScale -- Scale a matrix 180 FcMatrixShear -- Shear a matrix 181 182 4.10. FcConfig 183 184 FcConfigCreate -- Create a configuration 185 FcConfigDestroy -- Destroy a configuration 186 FcConfigSetCurrent -- Set configuration as default 187 FcConfigGetCurrent -- Return current configuration 188 FcConfigUptoDate -- Check timestamps on config files 189 FcConfigHome -- return the current home directory. 190 FcConfigEnableHome -- controls use of the home 191 directory. 192 193 FcConfigBuildFonts -- Build font database 194 FcConfigGetConfigDirs -- Get config directories 195 FcConfigGetFontDirs -- Get font directories 196 FcConfigGetConfigFiles -- Get config files 197 FcConfigGetCache -- DEPRECATED used to return 198 per-user cache filename 199 200 FcConfigGetCacheDirs -- return the list of 201 directories searched for cache files 202 203 FcConfigGetFonts -- Get config font set 204 FcConfigGetBlanks -- Get config blanks 205 FcConfigGetRescanInterval -- Get config rescan 206 interval 207 208 FcConfigSetRescanInterval -- Set config rescan 209 interval 210 211 FcConfigAppFontAddFile -- Add font file to font 212 database 213 214 FcConfigAppFontAddDir -- Add fonts from directory to 215 font database 216 217 FcConfigAppFontClear -- Remove all app fonts from 218 font database 219 220 FcConfigSubstituteWithPat -- Execute substitutions 221 FcConfigSubstitute -- Execute substitutions 222 FcFontMatch -- Return best font 223 FcFontSort -- Return list of matching fonts 224 FcFontRenderPrepare -- Prepare pattern for loading 225 font file 226 227 FcFontList -- List fonts 228 FcConfigFilename -- Find a config file 229 FcConfigParseAndLoad -- load a configuration file 230 231 4.11. FcObjectType 232 233 FcNameRegisterObjectTypes -- Register object types 234 FcNameUnregisterObjectTypes -- Unregister object 235 types 236 237 FcNameGetObjectType -- Lookup an object type 238 239 4.12. FcConstant 240 241 FcNameRegisterConstants -- Register symbolic 242 constants 243 244 FcNameUnregisterConstants -- Unregister symbolic 245 constants 246 247 FcNameGetConstant -- Lookup symbolic constant 248 FcNameConstant -- Get the value for a symbolic 249 constant 250 251 4.13. FcBlanks 252 253 FcBlanksCreate -- Create an FcBlanks 254 FcBlanksDestroy -- Destroy and FcBlanks 255 FcBlanksAdd -- Add a character to an FcBlanks 256 FcBlanksIsMember -- Query membership in an FcBlanks 257 258 4.14. FcAtomic 259 260 FcAtomicCreate -- create an FcAtomic object 261 FcAtomicLock -- lock a file 262 FcAtomicNewFile -- return new temporary file name 263 FcAtomicOrigFile -- return original file name 264 FcAtomicReplaceOrig -- replace original with new 265 FcAtomicDeleteNew -- delete new file 266 FcAtomicUnlock -- unlock a file 267 FcAtomicDestroy -- destroy an FcAtomic object 268 269 4.15. File and Directory routines 270 271 FcFileScan -- scan a font file 272 FcFileIsDir -- check whether a file is a directory 273 FcDirScan -- DEPRECATED: formerly used to scan a 274 font directory 275 276 FcDirSave -- DEPRECATED: formerly used to save a 277 directory cache 278 279 FcDirCacheUnlink -- Remove all caches related to dir 280 FcDirCacheValid -- check directory cache 281 FcDirCacheLoad -- load a directory cache 282 FcDirCacheRead -- read or construct a directory 283 cache 284 285 FcDirCacheLoadFile -- load a cache file 286 FcDirCacheUnload -- unload a cache file 287 288 4.16. FcCache routines 289 290 FcCacheDir -- Return directory of cache 291 FcCacheCopySet -- Returns a copy of the fontset from 292 cache 293 294 FcCacheSubdir -- Return the i'th subdirectory. 295 FcCacheNumSubdir -- Return the number of 296 subdirectories in cache. 297 298 FcCacheNumFont -- Returns the number of fonts in 299 cache. 300 301 4.17. FcStrSet and FcStrList 302 303 FcStrSetCreate -- create a string set 304 FcStrSetMember -- check set for membership 305 FcStrSetEqual -- check sets for equality 306 FcStrSetAdd -- add to a string set 307 FcStrSetAddFilename -- add a filename to a string 308 set 309 310 FcStrSetDel -- delete from a string set 311 FcStrSetDestroy -- destroy a string set 312 FcStrListCreate -- create a string iterator 313 FcStrListNext -- get next string in iteration 314 FcStrListDone -- destroy a string iterator 315 316 4.18. String utilities 317 318 FcUtf8ToUcs4 -- convert UTF-8 to UCS4 319 FcUcs4ToUtf8 -- convert UCS4 to UTF-8 320 FcUtf8Len -- count UTF-8 encoded chars 321 FcUtf16ToUcs4 -- convert UTF-16 to UCS4 322 FcUtf16Len -- count UTF-16 encoded chars 323 FcIsLower -- check for lower case ASCII character 324 FcIsUpper -- check for upper case ASCII character 325 FcToLower -- convert upper case ASCII to lower case 326 FcStrCopy -- duplicate a string 327 FcStrDowncase -- create a lower case translation of 328 a string 329 330 FcStrCopyFilename -- create a complete path from a 331 filename 332 333 FcStrCmp -- compare UTF-8 strings 334 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring 335 case 336 337 FcStrStr -- locate UTF-8 substring 338 FcStrStrIgnoreCase -- locate UTF-8 substring 339 ignoring ASCII case 340 341 FcStrPlus -- concatenate two strings 342 FcStrFree -- free a string 343 FcStrDirname -- directory part of filename 344 FcStrBasename -- last component of filename 345 3461. DESCRIPTION 347 348 Fontconfig is a library designed to provide system-wide font 349 configuration, customization and application access. 350 __________________________________________________________ 351 3522. FUNCTIONAL OVERVIEW 353 354 Fontconfig contains two essential modules, the configuration 355 module which builds an internal configuration from XML files 356 and the matching module which accepts font patterns and returns 357 the nearest matching font. 358 __________________________________________________________ 359 3602.1. FONT CONFIGURATION 361 362 The configuration module consists of the FcConfig datatype, 363 libexpat and FcConfigParse which walks over an XML tree and 364 ammends a configuration with data found within. From an 365 external perspective, configuration of the library consists of 366 generating a valid XML tree and feeding that to FcConfigParse. 367 The only other mechanism provided to applications for changing 368 the running configuration is to add fonts and directories to 369 the list of application-provided font files. 370 371 The intent is to make font configurations relatively static, 372 and shared by as many applications as possible. It is hoped 373 that this will lead to more stable font selection when passing 374 names from one application to another. XML was chosen as a 375 configuration file format because it provides a format which is 376 easy for external agents to edit while retaining the correct 377 structure and syntax. 378 379 Font configuration is separate from font matching; applications 380 needing to do their own matching can access the available fonts 381 from the library and perform private matching. The intent is to 382 permit applications to pick and choose appropriate 383 functionality from the library instead of forcing them to 384 choose between this library and a private configuration 385 mechanism. The hope is that this will ensure that configuration 386 of fonts for all applications can be centralized in one place. 387 Centralizing font configuration will simplify and regularize 388 font installation and customization. 389 __________________________________________________________ 390 3912.2. FONT PROPERTIES 392 393 While font patterns may contain essentially any properties, 394 there are some well known properties with associated types. 395 Fontconfig uses some of these properties for font matching and 396 font completion. Others are provided as a convenience for the 397 applications rendering mechanism. 398 Property Definitions 399 400 Property CPP Symbol Type Description 401 ---------------------------------------------------- 402 family FC_FAMILY String Font family names 403 familylang FC_FAMILYLANG String Language cooresponding t 404o 405 each family name 406 style FC_STYLE String Font style. Overrides we 407ight 408 and slant 409 stylelang FC_STYLELANG String Language cooresponding t 410o 411 each style name 412 fullname FC_FULLNAME String Font face full name wher 413e 414 different from family an 415d 416 family + style 417 fullnamelang FC_FULLNAMELANG String Language cooresponding t 418o 419 each fullname 420 slant FC_SLANT Int Italic, oblique or roman 421 weight FC_WEIGHT Int Light, medium, demibold, 422 bold or black 423 size FC_SIZE Double Point size 424 width FC_WIDTH Int Condensed, normal or exp 425anded 426 aspect FC_ASPECT Double Stretches glyphs horizon 427tally 428 before hinting 429 pixelsize FC_PIXEL_SIZE Double Pixel size 430 spacing FC_SPACING Int Proportional, dual-width 431, 432 monospace or charcell 433 foundry FC_FOUNDRY String Font foundry name 434 antialias FC_ANTIALIAS Bool Whether glyphs can be 435 antialiased 436 hinting FC_HINTING Bool Whether the rasterizer s 437hould 438 use hinting 439 hintstyle FC_HINT_STYLE Int Automatic hinting style 440 verticallayout FC_VERTICAL_LAYOUT Bool Use vertical layout 441 autohint FC_AUTOHINT Bool Use autohinter instead o 442f 443 normal hinter 444 globaladvance FC_GLOBAL_ADVANCE Bool Use font global advance 445data 446 file FC_FILE String The filename holding the 447 font 448 index FC_INDEX Int The index of the font wi 449thin 450 the file 451 ftface FC_FT_FACE FT_Face Use the specified FreeTy 452pe 453 face object 454 rasterizer FC_RASTERIZER String Which rasterizer is in u 455se 456 outline FC_OUTLINE Bool Whether the glyphs are o 457utlines 458 scalable FC_SCALABLE Bool Whether glyphs can be sc 459aled 460 scale FC_SCALE Double Scale factor for point-> 461pixel 462 conversions 463 dpi FC_DPI Double Target dots per inch 464 rgba FC_RGBA Int unknown, rgb, bgr, vrgb, 465 vbgr, none - subpixel ge 466ometry 467 lcdfilter FC_LCD_FILTER Int Type of LCD filter 468 minspace FC_MINSPACE Bool Eliminate leading from l 469ine 470 spacing 471 charset FC_CHARSET CharSet Unicode chars encoded by 472 the font 473 lang FC_LANG LangSet Set of RFC-3066-style 474 languages this font supp 475orts 476 fontversion FC_FONTVERSION Int Version number of the fo 477nt 478 capability FC_CAPABILITY String List of layout capabilit 479ies in 480 the font 481 embolden FC_EMBOLDEN Bool Rasterizer should 482 synthetically embolden t 483he font 484 __________________________________________________________ 485 4863. Datatypes 487 488 Fontconfig uses abstract datatypes to hide internal 489 implementation details for most data structures. A few 490 structures are exposed where appropriate. 491 __________________________________________________________ 492 4933.1. FcChar8, FcChar16, FcChar32, FcBool 494 495 These are primitive datatypes; the FcChar* types hold precisely 496 the number of bits stated (if supported by the C 497 implementation). FcBool holds one of two CPP symbols: FcFalse 498 or FcTrue. 499 __________________________________________________________ 500 5013.2. FcMatrix 502 503 An FcMatrix holds an affine transformation, usually used to 504 reshape glyphs. A small set of matrix operations are provided 505 to manipulate these. 506 typedef struct _FcMatrix { 507 double xx, xy, yx, yy; 508 } FcMatrix; 509 __________________________________________________________ 510 5113.3. FcCharSet 512 513 An FcCharSet is an abstract type that holds the set of encoded 514 unicode chars in a font. Operations to build and compare these 515 sets are provided. 516 __________________________________________________________ 517 5183.4. FcLangSet 519 520 An FcLangSet is an abstract type that holds the set of 521 languages supported by a font. Operations to build and compare 522 these sets are provided. These are computed for a font based on 523 orthographic information built into the fontconfig library. 524 Fontconfig has orthographies for all of the ISO 639-1 languages 525 except for MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA. 526 If you have orthographic information for any of these 527 languages, please submit them. 528 __________________________________________________________ 529 5303.5. FcLangResult 531 532 An FcLangResult is an enumeration used to return the results of 533 comparing two language strings or FcLangSet objects. 534 FcLangEqual means the objects match language and territory. 535 FcLangDifferentTerritory means the objects match in language 536 but differ in territory. FcLangDifferentLang means the objects 537 differ in language. 538 __________________________________________________________ 539 5403.6. FcType 541 542 Tags the kind of data stored in an FcValue. 543 __________________________________________________________ 544 5453.7. FcValue 546 547 An FcValue object holds a single value with one of a number of 548 different types. The 'type' tag indicates which member is 549 valid. 550 typedef struct _FcValue { 551 FcType type; 552 union { 553 const FcChar8 *s; 554 int i; 555 FcBool b; 556 double d; 557 const FcMatrix *m; 558 const FcCharSet *c; 559 void *f; 560 const FcLangSet *l; 561 } u; 562 } FcValue; 563 564 FcValue Members 565 566 Type Union member Datatype 567 -------------------------------- 568 FcTypeVoid (none) (none) 569 FcTypeInteger i int 570 FcTypeDouble d double 571 FcTypeString s FcChar8 * 572 FcTypeBool b b 573 FcTypeMatrix m FcMatrix * 574 FcTypeCharSet c FcCharSet * 575 FcTypeFTFace f void * (FT_Face) 576 FcTypeLangSet l FcLangSet * 577 __________________________________________________________ 578 5793.8. FcPattern 580 581 holds a set of names with associated value lists; each name 582 refers to a property of a font. FcPatterns are used as inputs 583 to the matching code as well as holding information about 584 specific fonts. Each property can hold one or more values; 585 conventionally all of the same type, although the interface 586 doesn't demand that. 587 __________________________________________________________ 588 5893.9. FcFontSet 590 591 typedef struct _FcFontSet { 592 int nfont; 593 int sfont; 594 FcPattern **fonts; 595 } FcFontSet; 596 597 An FcFontSet contains a list of FcPatterns. Internally 598 fontconfig uses this data structure to hold sets of fonts. 599 Externally, fontconfig returns the results of listing fonts in 600 this format. 'nfont' holds the number of patterns in the 601 'fonts' array; 'sfont' is used to indicate the size of that 602 array. 603 __________________________________________________________ 604 6053.10. FcStrSet, FcStrList 606 607 FcStrSet holds a list of strings that can be appended to and 608 enumerated. Its unique characteristic is that the enumeration 609 works even while strings are appended during enumeration. 610 FcStrList is used during enumeration to safely and correctly 611 walk the list of strings even while that list is edited in the 612 middle of enumeration. 613 __________________________________________________________ 614 6153.11. FcObjectSet 616 617 typedef struct _FcObjectSet { 618 int nobject; 619 int sobject; 620 const char **objects; 621 } FcObjectSet; 622 623 holds a set of names and is used to specify which fields from 624 fonts are placed in the the list of returned patterns when 625 listing fonts. 626 __________________________________________________________ 627 6283.12. FcObjectType 629 630 typedef struct _FcObjectType { 631 const char *object; 632 FcType type; 633 } FcObjectType; 634 635 marks the type of a pattern element generated when parsing font 636 names. Applications can add new object types so that font names 637 may contain the new elements. 638 __________________________________________________________ 639 6403.13. FcConstant 641 642 typedef struct _FcConstant { 643 const FcChar8 *name; 644 const char *object; 645 int value; 646 } FcConstant; 647 648 Provides for symbolic constants for new pattern elements. When 649 'name' is seen in a font name, an 'object' element is created 650 with value 'value'. 651 __________________________________________________________ 652 6533.14. FcBlanks 654 655 holds a list of Unicode chars which are expected to be blank; 656 unexpectedly blank chars are assumed to be invalid and are 657 elided from the charset associated with the font. 658 __________________________________________________________ 659 6603.15. FcFileCache 661 662 holds the per-user cache information for use while loading the 663 font database. This is built automatically for the current 664 configuration when that is loaded. Applications must always 665 pass '0' when one is requested. 666 __________________________________________________________ 667 6683.16. FcConfig 669 670 holds a complete configuration of the library; there is one 671 default configuration, other can be constructed from XML data 672 structures. All public entry points that need global data can 673 take an optional FcConfig* argument; passing 0 uses the default 674 configuration. FcConfig objects hold two sets of fonts, the 675 first contains those specified by the configuration, the second 676 set holds those added by the application at run-time. 677 Interfaces that need to reference a particulat set use one of 678 the FcSetName enumerated values. 679 __________________________________________________________ 680 6813.17. FcSetName 682 683 Specifies one of the two sets of fonts available in a 684 configuration; FcSetSystem for those fonts specified in the 685 configuration and FcSetApplication which holds fonts provided 686 by the application. 687 __________________________________________________________ 688 6893.18. FcResult 690 691 Used as a return type for functions manipulating FcPattern 692 objects. 693 FcResult Values 694 Result Code Meaning 695 ----------------------------------------------------------- 696 FcResultMatch Object exists with the specified ID 697 FcResultNoMatch Object doesn't exist at all 698 FcResultTypeMismatch Object exists, but the type doesn't matc 699h 700 FcResultNoId Object exists, but has fewer values 701 than specified 702 FcResultOutOfMemory Malloc failed 703 __________________________________________________________ 704 7053.19. FcAtomic 706 707 Used for locking access to config files. Provides a safe way to 708 update configuration files. 709 __________________________________________________________ 710 7113.20. FcCache 712 713 Holds information about the fonts contained in a single 714 directory. Normal applications need not worry about this as 715 caches for font access are automatically managed by the 716 library. Applications dealing with cache management may want to 717 use some of these objects in their work, however the included 718 'fc-cache' program generally suffices for all of that. 719 __________________________________________________________ 720 7214. FUNCTIONS 722 723 These are grouped by functionality, often using the main 724 datatype being manipulated. 725 __________________________________________________________ 726 7274.1. Initialization 728 729 Table of Contents 730 FcInitLoadConfig -- load configuration 731 FcInitLoadConfigAndFonts -- load configuration and font data 732 FcInit -- initialize fontconfig library 733 FcFini -- finalize fonconfig library 734 FcGetVersion -- library version number 735 FcInitReinitialize -- re-initialize library 736 FcInitBringUptoDate -- reload configuration files if needed 737 738 These functions provide some control over how the library is 739 initialized. 740 741FcInitLoadConfig 742 743Name 744 745 FcInitLoadConfig -- load configuration 746 747Synopsis 748 749#include <fontconfig.h> 750 751 FcConfig * FcInitLoadConfig(void); 752 753Description 754 755 Loads the default configuration file and returns the resulting 756 configuration. Does not load any font information. 757 758Version 759 760 Fontconfig version 2.6.0 761 762FcInitLoadConfigAndFonts 763 764Name 765 766 FcInitLoadConfigAndFonts -- load configuration and font data 767 768Synopsis 769 770#include <fontconfig.h> 771 772 FcConfig * FcInitLoadConfigAndFonts(void); 773 774Description 775 776 Loads the default configuration file and builds information 777 about the available fonts. Returns the resulting configuration. 778 779Version 780 781 Fontconfig version 2.6.0 782 783FcInit 784 785Name 786 787 FcInit -- initialize fontconfig library 788 789Synopsis 790 791#include <fontconfig.h> 792 793 FcBool FcInit(void); 794 795Description 796 797 Loads the default configuration file and the fonts referenced 798 therein and sets the default configuration to that result. 799 Returns whether this process succeeded or not. If the default 800 configuration has already been loaded, this routine does 801 nothing and returns FcTrue. 802 803Version 804 805 Fontconfig version 2.6.0 806 807FcFini 808 809Name 810 811 FcFini -- finalize fonconfig library 812 813Synopsis 814 815#include <fontconfig.h> 816 817 void FcFini(void); 818 819Description 820 821 Frees all data structures allocated by previous calls to 822 fontconfig functions. Fontconfig returns to an uninitialized 823 state, requiring a new call to one of the FcInit functions 824 before any other fontconfig function may be called. 825 826Version 827 828 Fontconfig version 2.6.0 829 830FcGetVersion 831 832Name 833 834 FcGetVersion -- library version number 835 836Synopsis 837 838#include <fontconfig.h> 839 840 int FcGetVersion(void); 841 842Description 843 844 Returns the version number of the library. 845 846Version 847 848 Fontconfig version 2.6.0 849 850FcInitReinitialize 851 852Name 853 854 FcInitReinitialize -- re-initialize library 855 856Synopsis 857 858#include <fontconfig.h> 859 860 FcBool FcInitReinitialize(void); 861 862Description 863 864 Forces the default configuration file to be reloaded and resets 865 the default configuration. Returns FcFalse if the configuration 866 cannot be reloaded (due to config file errors, allocation 867 failures or other issues) and leaves the existing configuration 868 unchanged. Otherwise returns FcTrue. 869 870Version 871 872 Fontconfig version 2.6.0 873 874FcInitBringUptoDate 875 876Name 877 878 FcInitBringUptoDate -- reload configuration files if needed 879 880Synopsis 881 882#include <fontconfig.h> 883 884 FcBool FcInitBringUptoDate(void); 885 886Description 887 888 Checks the rescan interval in the default configuration, 889 checking the configuration if the interval has passed and 890 reloading the configuration if when any changes are detected. 891 Returns FcFalse if the configuration cannot be reloaded (see 892 FcInitReinitialize). Otherwise returns FcTrue. 893 894Version 895 896 Fontconfig version 2.6.0 897 __________________________________________________________ 898 8994.2. FcPattern 900 901 Table of Contents 902 FcPatternCreate -- Create a pattern 903 FcPatternDuplicate -- Copy a pattern 904 FcPatternReference -- Increment pattern reference count 905 FcPatternDestroy -- Destroy a pattern 906 FcPatternEqual -- Compare patterns 907 FcPatternEqualSubset -- Compare portions of patterns 908 FcPatternHash -- Compute a pattern hash value 909 FcPatternAdd -- Add a value to a pattern 910 FcPatternAddWeak -- Add a value to a pattern with weak binding 911 FcPatternAdd-Type -- Add a typed value to a pattern 912 FcPatternGet -- Return a value from a pattern 913 FcPatternGet-Type -- Return a typed value from a pattern 914 FcPatternBuild -- Create patterns from arguments 915 FcPatternDel -- Delete a property from a pattern 916 FcPatternRemove -- Remove one object of the specified type from 917 the pattern 918 919 FcPatternPrint -- Print a pattern for debugging 920 FcDefaultSubstitute -- Perform default substitutions in a 921 pattern 922 923 FcNameParse -- Parse a pattern string 924 FcNameUnparse -- Convert a pattern back into a string that can 925 be parsed 926 927 An FcPattern is an opaque type that holds both patterns to 928 match against the available fonts, as well as the information 929 about each font. 930 931FcPatternCreate 932 933Name 934 935 FcPatternCreate -- Create a pattern 936 937Synopsis 938 939#include <fontconfig.h> 940 941 FcPattern * FcPatternCreate(void); 942 943Description 944 945 Creates a pattern with no properties; used to build patterns 946 from scratch. 947 948Version 949 950 Fontconfig version 2.6.0 951 952FcPatternDuplicate 953 954Name 955 956 FcPatternDuplicate -- Copy a pattern 957 958Synopsis 959 960#include <fontconfig.h> 961 962 FcPattern * FcPatternDuplicate(FcPattern *p); 963 964Description 965 966 Copy a pattern, returning a new pattern that matches p. Each 967 pattern may be modified without affecting the other. 968 969Version 970 971 Fontconfig version 2.6.0 972 973FcPatternReference 974 975Name 976 977 FcPatternReference -- Increment pattern reference count 978 979Synopsis 980 981#include <fontconfig.h> 982 983 void FcPatternReference(FcPattern *p); 984 985Description 986 987 Add another reference to p. Patterns are freed only when the 988 reference count reaches zero. 989 990Version 991 992 Fontconfig version 2.6.0 993 994FcPatternDestroy 995 996Name 997 998 FcPatternDestroy -- Destroy a pattern 999 1000Synopsis 1001 1002#include <fontconfig.h> 1003 1004 void FcPatternDestroy(FcPattern *p); 1005 1006Description 1007 1008 Decrement the pattern reference count. If all references are 1009 gone, destroys the pattern, in the process destroying all 1010 related values. 1011 1012Version 1013 1014 Fontconfig version 2.6.0 1015 1016FcPatternEqual 1017 1018Name 1019 1020 FcPatternEqual -- Compare patterns 1021 1022Synopsis 1023 1024#include <fontconfig.h> 1025 1026 FcBool FcPatternEqual(const FcPattern *pa, const FcPattern 1027 *pb); 1028 1029Description 1030 1031 Returns whether pa and pb are exactly alike. 1032 1033Version 1034 1035 Fontconfig version 2.6.0 1036 1037FcPatternEqualSubset 1038 1039Name 1040 1041 FcPatternEqualSubset -- Compare portions of patterns 1042 1043Synopsis 1044 1045#include <fontconfig.h> 1046 1047 FcBool FcPatternEqualSubset(const FcPattern *pa, const 1048 FcPattern *pb, const FcObjectSet *os); 1049 1050Description 1051 1052 Returns whether pa and pb have exactly the same values for all 1053 of the objects in os. 1054 1055Version 1056 1057 Fontconfig version 2.6.0 1058 1059FcPatternHash 1060 1061Name 1062 1063 FcPatternHash -- Compute a pattern hash value 1064 1065Synopsis 1066 1067#include <fontconfig.h> 1068 1069 FcChar32 FcPatternHash(const FcPattern *p); 1070 1071Description 1072 1073 Returns a 32-bit number which is the same for any two patterns 1074 which are equal. 1075 1076Version 1077 1078 Fontconfig version 2.6.0 1079 1080FcPatternAdd 1081 1082Name 1083 1084 FcPatternAdd -- Add a value to a pattern 1085 1086Synopsis 1087 1088#include <fontconfig.h> 1089 1090 FcBool FcPatternAdd(FcPattern *p, const char *object, FcValue 1091 value, FcBool append); 1092 1093Description 1094 1095 Adds a single value to the list of values associated with the 1096 property named `object. If `append is FcTrue, the value is 1097 added at the end of any existing list, otherwise it is inserted 1098 at the begining. `value' is saved (with FcValueSave) when 1099 inserted into the pattern so that the library retains no 1100 reference to any application-supplied data structure. 1101 1102Version 1103 1104 Fontconfig version 2.6.0 1105 1106FcPatternAddWeak 1107 1108Name 1109 1110 FcPatternAddWeak -- Add a value to a pattern with weak binding 1111 1112Synopsis 1113 1114#include <fontconfig.h> 1115 1116 FcBool FcPatternAddWeak(FcPattern *p, const char *object, 1117 FcValue value, FcBool append); 1118 1119Description 1120 1121 FcPatternAddWeak is essentially the same as FcPatternAdd except 1122 that any values added to the list have binding weak instead of 1123 strong. 1124 1125Version 1126 1127 Fontconfig version 2.6.0 1128 1129FcPatternAdd-Type 1130 1131Name 1132 1133 FcPatternAddInteger, FcPatternAddDouble, FcPatternAddString, 1134 FcPatternAddMatrix, FcPatternAddCharSet, FcPatternAddBool, 1135 FcPatternAddFTFace, FcPatternAddLangSet -- Add a typed value to 1136 a pattern 1137 1138Synopsis 1139 1140#include <fontconfig.h> 1141 1142 FcBool FcPatternAddInteger(FcPattern *p, const char *object, 1143 int i); 1144 1145 FcBool FcPatternAddDouble(FcPattern *p, const char *object, 1146 double d); 1147 1148 FcBool FcPatternAddString(FcPattern *p, const char *object, 1149 const FcChar8 *s); 1150 1151 FcBool FcPatternAddMatrix(FcPattern *p, const char *object, 1152 const FcMatrix *m); 1153 1154 FcBool FcPatternAddCharSet(FcPattern *p, const char *object, 1155 const FcCharSet *c); 1156 1157 FcBool FcPatternAddBool(FcPattern *p, const char *object, 1158 FcBool b); 1159 1160 FcBool FcPatternAddFTFace(FcPattern *p, const char *object, 1161 const FT_Facef); 1162 1163 FcBool FcPatternAddLangSet(FcPattern *p, const char *object, 1164 const FcLangSet *l); 1165 1166Description 1167 1168 These are all convenience functions that insert objects of the 1169 specified type into the pattern. Use these in preference to 1170 FcPatternAdd as they will provide compile-time typechecking. 1171 These all append values to any existing list of values. 1172 1173Version 1174 1175 Fontconfig version 2.6.0 1176 1177FcPatternGet 1178 1179Name 1180 1181 FcPatternGet -- Return a value from a pattern 1182 1183Synopsis 1184 1185#include <fontconfig.h> 1186 1187 FcResult FcPatternGet(FcPattern *p, const char *object, int id, 1188 FcValue *v); 1189 1190Description 1191 1192 Returns in v the id'th value associated with the property 1193 object. The value returned is not a copy, but rather refers to 1194 the data stored within the pattern directly. Applications must 1195 not free this value. 1196 1197Version 1198 1199 Fontconfig version 2.6.0 1200 1201FcPatternGet-Type 1202 1203Name 1204 1205 FcPatternGetInteger, FcPatternGetDouble, FcPatternGetString, 1206 FcPatternGetMatrix, FcPatternGetCharSet, FcPatternGetBool, 1207 FcPatternGetFTFace, FcPatternGetLangSet -- Return a typed value 1208 from a pattern 1209 1210Synopsis 1211 1212#include <fontconfig.h> 1213 1214 FcResult FcPatternGetInteger(FcPattern *p, const char *object, 1215 int n, int *i); 1216 1217 FcResult FcPatternGetDouble(FcPattern *p, const char *object, 1218 int n, double *d); 1219 1220 FcResult FcPatternGetString(FcPattern *p, const char *object, 1221 int n, FcChar8 **s); 1222 1223 FcResult FcPatternGetMatrix(FcPattern *p, const char *object, 1224 int n, FcMatrix **s); 1225 1226 FcResult FcPatternGetCharSet(FcPattern *p, const char *object, 1227 int n, FcCharSet **c); 1228 1229 FcResult FcPatternGetBool(FcPattern *p, const char *object, int 1230 n, FcBool *b); 1231 1232 FcBool FcPatternGetFTFace(FcPattern *p, const char *object, 1233 const FT_Face *f); 1234 1235 FcBool FcPatternGetLangSet(FcPattern *p, const char *object, 1236 const FcLangSet **l); 1237 1238Description 1239 1240 These are convenience functions that call FcPatternGet and 1241 verify that the returned data is of the expected type. They 1242 return FcResultTypeMismatch if this is not the case. Note that 1243 these (like FcPatternGet) do not make a copy of any data 1244 structure referenced by the return value. Use these in 1245 preference to FcPatternGet to provide compile-time 1246 typechecking. 1247 1248Version 1249 1250 Fontconfig version 2.6.0 1251 1252FcPatternBuild 1253 1254Name 1255 1256 FcPatternBuild, FcPatternVaBuild, FcPatternVapBuild -- Create 1257 patterns from arguments 1258 1259Synopsis 1260 1261#include <fontconfig.h> 1262 1263 FcPattern * FcPatternBuild(FcPattern *orig, ...); 1264 1265 FcPattern * FcPatternVaBuild(FcPattern *orig, va_list va); 1266 1267 void FcPatternVapBuild(FcPattern *result, FcPattern *orig, 1268 va_list va); 1269 1270Description 1271 1272 Builds a pattern using a list of objects, types and values. 1273 Each value to be entered in the pattern is specified with three 1274 arguments: 1275 1276 1. Object name, a string describing the property to be added. 1277 2. Object type, one of the FcType enumerated values 1278 3. Value, not an FcValue, but the raw type as passed to any of 1279 the FcPatternAdd<type> functions. Must match the type of 1280 the second argument. 1281 1282 The argument list is terminated by a null object name, no 1283 object type nor value need be passed for this. The values are 1284 added to `pattern', if `pattern' is null, a new pattern is 1285 created. In either case, the pattern is returned. Example 1286pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Times", (char *) 12870); 1288 1289 FcPatternVaBuild is used when the arguments are already in the 1290 form of a varargs value. FcPatternVapBuild is a macro version 1291 of FcPatternVaBuild which returns its result directly in the 1292 result variable. 1293 1294Version 1295 1296 Fontconfig version 2.6.0 1297 1298FcPatternDel 1299 1300Name 1301 1302 FcPatternDel -- Delete a property from a pattern 1303 1304Synopsis 1305 1306#include <fontconfig.h> 1307 1308 FcBool FcPatternDel(FcPattern *p, const char *object); 1309 1310Description 1311 1312 Deletes all values associated with the property `object', 1313 returning whether the property existed or not. 1314 1315Version 1316 1317 Fontconfig version 2.6.0 1318 1319FcPatternRemove 1320 1321Name 1322 1323 FcPatternRemove -- Remove one object of the specified type from 1324 the pattern 1325 1326Synopsis 1327 1328#include <fontconfig.h> 1329 1330 FcBool FcPatternRemove(FcPattern *p, const char *object, int 1331 id); 1332 1333Description 1334 1335 Removes the value associated with the property `object' at 1336 position `id', returning whether the property existed and had a 1337 value at that position or not. 1338 1339Version 1340 1341 Fontconfig version 2.6.0 1342 1343FcPatternPrint 1344 1345Name 1346 1347 FcPatternPrint -- Print a pattern for debugging 1348 1349Synopsis 1350 1351#include <fontconfig.h> 1352 1353 void FcPatternPrint(const FcPattern *p); 1354 1355Description 1356 1357 Prints an easily readable version of the pattern to stdout. 1358 There is no provision for reparsing data in this format, it's 1359 just for diagnostics and debugging. 1360 1361Version 1362 1363 Fontconfig version 2.6.0 1364 1365FcDefaultSubstitute 1366 1367Name 1368 1369 FcDefaultSubstitute -- Perform default substitutions in a 1370 pattern 1371 1372Synopsis 1373 1374#include <fontconfig.h> 1375 1376 void FcDefaultSubstitute(FcPattern *pattern); 1377 1378Description 1379 1380 Supplies default values for underspecified font patterns: 1381 1382 * Patterns without a specified style or weight are set to 1383 Medium 1384 * Patterns without a specified style or slant are set to 1385 Roman 1386 * Patterns without a specified pixel size are given one 1387 computed from any specified point size (default 12), dpi 1388 (default 75) and scale (default 1). 1389 1390Version 1391 1392 Fontconfig version 2.6.0 1393 1394FcNameParse 1395 1396Name 1397 1398 FcNameParse -- Parse a pattern string 1399 1400Synopsis 1401 1402#include <fontconfig.h> 1403 1404 FcPattern * FcNameParse(const FcChar8 *name); 1405 1406Description 1407 1408 Converts name from the standard text format described above 1409 into a pattern. 1410 1411Version 1412 1413 Fontconfig version 2.6.0 1414 1415FcNameUnparse 1416 1417Name 1418 1419 FcNameUnparse -- Convert a pattern back into a string that can 1420 be parsed 1421 1422Synopsis 1423 1424#include <fontconfig.h> 1425 1426 FcChar8 * FcNameUnparse(FcPattern *pat); 1427 1428Description 1429 1430 Converts the given pattern into the standard text format 1431 described above. The return value is not static, but instead 1432 refers to newly allocated memory which should be freed by the 1433 caller. 1434 1435Version 1436 1437 Fontconfig version 2.6.0 1438 __________________________________________________________ 1439 14404.3. FcFontSet 1441 1442 Table of Contents 1443 FcFontSetCreate -- Create a font set 1444 FcFontSetDestroy -- Destroy a font set 1445 FcFontSetAdd -- Add to a font set 1446 FcFontSetList -- List fonts from a set of font sets 1447 FcFontSetMatch -- Return the best font from a set of font sets 1448 FcFontSetPrint -- Print a set of patterns to stdout 1449 FcFontSetSort -- Add to a font set 1450 FcFontSetSortDestroy -- DEPRECATED destroy a font set 1451 1452 An FcFontSet simply holds a list of patterns; these are used to 1453 return the results of listing available fonts. 1454 1455FcFontSetCreate 1456 1457Name 1458 1459 FcFontSetCreate -- Create a font set 1460 1461Synopsis 1462 1463#include <fontconfig.h> 1464 1465 FcFontSet * FcFontSetCreate(void); 1466 1467Description 1468 1469 Creates an empty font set. 1470 1471Version 1472 1473 Fontconfig version 2.6.0 1474 1475FcFontSetDestroy 1476 1477Name 1478 1479 FcFontSetDestroy -- Destroy a font set 1480 1481Synopsis 1482 1483#include <fontconfig.h> 1484 1485 void FcFontSetDestroy(FcFontSet *s); 1486 1487Description 1488 1489 Destroys a font set. Note that this destroys any referenced 1490 patterns as well. 1491 1492Version 1493 1494 Fontconfig version 2.6.0 1495 1496FcFontSetAdd 1497 1498Name 1499 1500 FcFontSetAdd -- Add to a font set 1501 1502Synopsis 1503 1504#include <fontconfig.h> 1505 1506 FcBool FcFontSetAdd(FcFontSet *s, FcPattern *font); 1507 1508Description 1509 1510 Adds a pattern to a font set. Note that the pattern is not 1511 copied before being inserted into the set. Returns FcFalse if 1512 the pattern cannot be inserted into the set (due to allocation 1513 failure). Otherwise returns FcTrue. 1514 1515Version 1516 1517 Fontconfig version 2.6.0 1518 1519FcFontSetList 1520 1521Name 1522 1523 FcFontSetList -- List fonts from a set of font sets 1524 1525Synopsis 1526 1527#include <fontconfig.h> 1528 1529 FcFontSet * FcFontSetList(FcConfig *config, FcFontSet **sets, 1530 intnsets, FcPattern *pattern, FcObjectSet *object_set); 1531 1532Description 1533 1534 Selects fonts matching pattern from sets, creates patterns from 1535 those fonts containing only the objects in object_set and 1536 returns the set of unique such patterns. 1537 1538Version 1539 1540 Fontconfig version 2.6.0 1541 1542FcFontSetMatch 1543 1544Name 1545 1546 FcFontSetMatch -- Return the best font from a set of font sets 1547 1548Synopsis 1549 1550#include <fontconfig.h> 1551 1552 FcPattern * FcFontSetMatch(FcConfig *config, FcFontSet **sets, 1553 intnsets, FcPattern *pattern, FcResult *result); 1554 1555Description 1556 1557 Finds the font in sets most closely matching pattern and 1558 returns the result of FcFontRenderPrepare for that font and the 1559 provided pattern. This function should be called only after 1560 FcConfigSubstitute and FcDefaultSubstitute have been called for 1561 pattern; otherwise the results will not be correct. Returns 1562 NULL if an error occurs during this process. 1563 1564Version 1565 1566 Fontconfig version 2.6.0 1567 1568FcFontSetPrint 1569 1570Name 1571 1572 FcFontSetPrint -- Print a set of patterns to stdout 1573 1574Synopsis 1575 1576#include <fontconfig.h> 1577 1578 void FcFontSetPrint(FcFontSet *set); 1579 1580Description 1581 1582 This function is useful for diagnosing font related issues, 1583 printing the complete contents of every pattern in set. The 1584 format of the output is designed to be of help to users and 1585 developers, and may change at any time. 1586 1587Version 1588 1589 Fontconfig version 2.6.0 1590 1591FcFontSetSort 1592 1593Name 1594 1595 FcFontSetSort -- Add to a font set 1596 1597Synopsis 1598 1599#include <fontconfig.h> 1600 1601 FcFontSetSort(FcConfig *config, FcFontSet **sets, intnsets, 1602 FcPattern *pattern, FcBool trim, FcCharSet **csp, FcResult 1603 *result); 1604 1605Description 1606 1607 Returns the list of fonts from sets sorted by closeness to 1608 pattern. If trim is FcTrue, elements in the list which don't 1609 include Unicode coverage not provided by earlier elements in 1610 the list are elided. The union of Unicode coverage of all of 1611 the fonts is returned in csp, if csp is not NULL. This function 1612 should be called only after FcConfigSubstitute and 1613 FcDefaultSubstitute have been called for p; otherwise the 1614 results will not be correct. 1615 1616 The returned FcFontSet references FcPattern structures which 1617 may be shared by the return value from multiple FcFontSort 1618 calls, applications cannot modify these patterns. Instead, they 1619 should be passed, along with pattern to FcFontRenderPrepare 1620 which combines them into a complete pattern. 1621 1622 The FcFontSet returned by FcFontSetSort is destroyed by caling 1623 FcFontSetDestroy. 1624 1625Version 1626 1627 Fontconfig version 2.6.0 1628 1629FcFontSetSortDestroy 1630 1631Name 1632 1633 FcFontSetSortDestroy -- DEPRECATED destroy a font set 1634 1635Synopsis 1636 1637#include <fontconfig.h> 1638 1639 FcFontSetSortDestroy(FcFontSet *set); 1640 1641Description 1642 1643 This function is DEPRECATED. FcFontSetSortDestroy destroys set 1644 by calling FcFontSetDestroy. Applications should use 1645 FcFontSetDestroy directly instead. 1646 1647Version 1648 1649 Fontconfig version 2.6.0 1650 __________________________________________________________ 1651 16524.4. FcObjectSet 1653 1654 Table of Contents 1655 FcObjectSetCreate -- Create an object set 1656 FcObjectSetAdd -- Add to an object set 1657 FcObjectSetDestroy -- Destroy an object set 1658 FcObjectSetBuild -- Build object set from args 1659 1660 An FcObjectSet holds a list of pattern property names; it is 1661 used to indiciate which properties are to be returned in the 1662 patterns from FcFontList. 1663 1664FcObjectSetCreate 1665 1666Name 1667 1668 FcObjectSetCreate -- Create an object set 1669 1670Synopsis 1671 1672#include <fontconfig.h> 1673 1674 FcObjectSet * FcObjectSetCreate(void); 1675 1676Description 1677 1678 Creates an empty set. 1679 1680Version 1681 1682 Fontconfig version 2.6.0 1683 1684FcObjectSetAdd 1685 1686Name 1687 1688 FcObjectSetAdd -- Add to an object set 1689 1690Synopsis 1691 1692#include <fontconfig.h> 1693 1694 FcBool FcObjectSetAdd(FcObjectSet *os, const char *object); 1695 1696Description 1697 1698 Adds a proprety name to the set. Returns FcFalse if the 1699 property name cannot be inserted into the set (due to 1700 allocation failure). Otherwise returns FcTrue. 1701 1702Version 1703 1704 Fontconfig version 2.6.0 1705 1706FcObjectSetDestroy 1707 1708Name 1709 1710 FcObjectSetDestroy -- Destroy an object set 1711 1712Synopsis 1713 1714#include <fontconfig.h> 1715 1716 void FcObjectSetDestroy(FcObjectSet *os); 1717 1718Description 1719 1720 Destroys an object set. 1721 1722Version 1723 1724 Fontconfig version 2.6.0 1725 1726FcObjectSetBuild 1727 1728Name 1729 1730 FcObjectSetBuild, FcObjectSetVaBuild, 1731 FcObjectSetVapBuild -- Build object set from args 1732 1733Synopsis 1734 1735#include <fontconfig.h> 1736 1737 FcObjectSet * FcObjectSetBuild(const char *first, ...); 1738 1739 FcObjectSet * FcObjectSetVaBuild(const char *first, va_list 1740 va); 1741 1742 void FcObjectSetVapBuild(FcObjectSet *result, const char 1743 *first, va_list va); 1744 1745Description 1746 1747 These build an object set from a null-terminated list of 1748 property names. FcObjectSetVapBuild is a macro version of 1749 FcObjectSetVaBuild which returns the result in the result 1750 variable directly. 1751 1752Version 1753 1754 Fontconfig version 2.6.0 1755 __________________________________________________________ 1756 17574.5. FreeType specific functions 1758 1759 Table of Contents 1760 FcFreeTypeCharIndex -- map Unicode to glyph id 1761 FcFreeTypeCharSet -- compute unicode coverage 1762 FcFreeTypeCharSetAndSpacing -- compute unicode coverage and 1763 spacing type 1764 1765 FcFreeTypeQuery -- compute pattern from font file (and index) 1766 FcFreeTypeQueryFace -- compute pattern from FT_Face 1767 1768 While the fontconfig library doesn't insist that FreeType be 1769 used as the rasterization mechanism for fonts, it does provide 1770 some convenience functions. 1771 1772FcFreeTypeCharIndex 1773 1774Name 1775 1776 FcFreeTypeCharIndex -- map Unicode to glyph id 1777 1778Synopsis 1779 1780#include <fontconfig.h> 1781#include <fcfreetype.h> 1782 1783 FT_UInt FcFreeTypeCharIndex(FT_Face face, FcChar32 ucs4); 1784 1785Description 1786 1787 Maps a Unicode char to a glyph index. This function uses 1788 information from several possible underlying encoding tables to 1789 work around broken fonts. As a result, this function isn't 1790 designed to be used in performance sensitive areas; results 1791 from this function are intended to be cached by higher level 1792 functions. 1793 1794Version 1795 1796 Fontconfig version 2.6.0 1797 1798FcFreeTypeCharSet 1799 1800Name 1801 1802 FcFreeTypeCharSet -- compute unicode coverage 1803 1804Synopsis 1805 1806#include <fontconfig.h> 1807#include <fcfreetype.h> 1808 1809 FcCharSet * FcFreeTypeCharSet(FT_Face face, FcBlanks *blanks); 1810 1811Description 1812 1813 Scans a FreeType face and returns the set of encoded Unicode 1814 chars. This scans several encoding tables to build as complete 1815 a list as possible. If 'blanks' is not 0, the glyphs in the 1816 font are examined and any blank glyphs not in 'blanks' are not 1817 placed in the returned FcCharSet. 1818 1819Version 1820 1821 Fontconfig version 2.6.0 1822 1823FcFreeTypeCharSetAndSpacing 1824 1825Name 1826 1827 FcFreeTypeCharSetAndSpacing -- compute unicode coverage and 1828 spacing type 1829 1830Synopsis 1831 1832#include <fontconfig.h> 1833#include <fcfreetype.h> 1834 1835 FcCharSet * FcFreeTypeCharSetAndSpacing(FT_Face face, FcBlanks 1836 *blanks, int *spacing); 1837 1838Description 1839 1840 Scans a FreeType face and returns the set of encoded Unicode 1841 chars. This scans several encoding tables to build as complete 1842 a list as possible. If 'blanks' is not 0, the glyphs in the 1843 font are examined and any blank glyphs not in 'blanks' are not 1844 placed in the returned FcCharSet. spacing receives the computed 1845 spacing type of the font, one of FC_MONO for a font where all 1846 glyphs have the same width, FC_DUAL, where the font has glyphs 1847 in precisely two widths, one twice as wide as the other, or 1848 FC_PROPORTIONAL where the font has glyphs of many widths. 1849 1850Version 1851 1852 Fontconfig version 2.6.0 1853 1854FcFreeTypeQuery 1855 1856Name 1857 1858 FcFreeTypeQuery -- compute pattern from font file (and index) 1859 1860Synopsis 1861 1862#include <fontconfig.h> 1863#include <fcfreetype.h> 1864 1865 FcPattern * FcFreeTypeQuery(const FcChar8 *file, int id, 1866 FcBlanks *blanks, int *count); 1867 1868Description 1869 1870 Constructs a pattern representing the 'id'th font in 'file'. 1871 The number of fonts in 'file' is returned in 'count'. 1872 1873Version 1874 1875 Fontconfig version 2.6.0 1876 1877FcFreeTypeQueryFace 1878 1879Name 1880 1881 FcFreeTypeQueryFace -- compute pattern from FT_Face 1882 1883Synopsis 1884 1885#include <fontconfig.h> 1886#include <fcfreetype.h> 1887 1888 FcPattern * FcFreeTypeQueryFace(const FT_Face face, const 1889 FcChar8 *file, int id, FcBlanks *blanks); 1890 1891Description 1892 1893 Constructs a pattern representing 'face'. 'file' and 'id' are 1894 used solely as data for pattern elements (FC_FILE, FC_INDEX and 1895 sometimes FC_FAMILY). 1896 1897Version 1898 1899 Fontconfig version 2.6.0 1900 __________________________________________________________ 1901 19024.6. FcValue 1903 1904 Table of Contents 1905 FcValueDestroy -- Free a value 1906 FcValueSave -- Copy a value 1907 FcValuePrint -- Print a value to stdout 1908 FcValueEqual -- Test two values for equality 1909 1910 FcValue is a structure containing a type tag and a union of all 1911 possible datatypes. The tag is an enum of type FcType and is 1912 intended to provide a measure of run-time typechecking, 1913 although that depends on careful programming. 1914 1915FcValueDestroy 1916 1917Name 1918 1919 FcValueDestroy -- Free a value 1920 1921Synopsis 1922 1923#include <fontconfig.h> 1924 1925 void FcValueDestroy(FcValue v); 1926 1927Description 1928 1929 Frees any memory referenced by v. Values of type FcTypeString, 1930 FcTypeMatrix and FcTypeCharSet reference memory, the other 1931 types do not. 1932 1933Version 1934 1935 Fontconfig version 2.6.0 1936 1937FcValueSave 1938 1939Name 1940 1941 FcValueSave -- Copy a value 1942 1943Synopsis 1944 1945#include <fontconfig.h> 1946 1947 FcValue FcValueSave(FcValue v); 1948 1949Description 1950 1951 Returns a copy of v duplicating any object referenced by it so 1952 that v may be safely destroyed without harming the new value. 1953 1954Version 1955 1956 Fontconfig version 2.6.0 1957 1958FcValuePrint 1959 1960Name 1961 1962 FcValuePrint -- Print a value to stdout 1963 1964Synopsis 1965 1966#include <fontconfig.h> 1967 1968 void FcValuePrint(FcValue v); 1969 1970Description 1971 1972 Prints a human-readable representation of v to stdout. The 1973 format should not be considered part of the library 1974 specification as it may change in the future. 1975 1976Version 1977 1978 Fontconfig version 2.6.0 1979 1980FcValueEqual 1981 1982Name 1983 1984 FcValueEqual -- Test two values for equality 1985 1986Synopsis 1987 1988#include <fontconfig.h> 1989 1990 FcBool FcValueEqual(FcValue v_a, FcValue v_b); 1991 1992Description 1993 1994 Compares two values. Integers and Doubles are compared as 1995 numbers; otherwise the two values have to be the same type to 1996 be considered equal. Strings are compared ignoring case. 1997 1998Version 1999 2000 Fontconfig version 2.6.0 2001 __________________________________________________________ 2002 20034.7. FcCharSet 2004 2005 Table of Contents 2006 FcCharSetCreate -- Create an empty character set 2007 FcCharSetDestroy -- Destroy a character set 2008 FcCharSetAddChar -- Add a character to a charset 2009 FcCharSetCopy -- Copy a charset 2010 FcCharSetEqual -- Compare two charsets 2011 FcCharSetIntersect -- Intersect charsets 2012 FcCharSetUnion -- Add charsets 2013 FcCharSetSubtract -- Subtract charsets 2014 FcCharSetHasChar -- Check a charset for a char 2015 FcCharSetCount -- Count entries in a charset 2016 FcCharSetIntersectCount -- Intersect and count charsets 2017 FcCharSetSubtractCount -- Subtract and count charsets 2018 FcCharSetIsSubset -- Test for charset inclusion 2019 FcCharSetFirstPage -- Start enumerating charset contents 2020 FcCharSetNextPage -- Continue enumerating charset contents 2021 FcCharSetCoverage -- DEPRECATED return coverage for a Unicode 2022 page 2023 2024 FcCharSetNew -- DEPRECATED alias for FcCharSetCreate 2025 2026 An FcCharSet is a boolean array indicating a set of unicode 2027 chars. Those associated with a font are marked constant and 2028 cannot be edited. FcCharSets may be reference counted 2029 internally to reduce memory consumption; this may be visible to 2030 applications as the result of FcCharSetCopy may return it's 2031 argument, and that CharSet may remain unmodifiable. 2032 2033FcCharSetCreate 2034 2035Name 2036 2037 FcCharSetCreate -- Create an empty character set 2038 2039Synopsis 2040 2041#include <fontconfig.h> 2042 2043 FcCharSet * FcCharSetCreate(void); 2044 2045Description 2046 2047 FcCharSetCreate allocates and initializes a new empty character 2048 set object. 2049 2050Version 2051 2052 Fontconfig version 2.6.0 2053 2054FcCharSetDestroy 2055 2056Name 2057 2058 FcCharSetDestroy -- Destroy a character set 2059 2060Synopsis 2061 2062#include <fontconfig.h> 2063 2064 void FcCharSetDestroy(FcCharSet *fcs); 2065 2066Description 2067 2068 FcCharSetDestroy decrements the reference count fcs. If the 2069 reference count becomes zero, all memory referenced is freed. 2070 2071Version 2072 2073 Fontconfig version 2.6.0 2074 2075FcCharSetAddChar 2076 2077Name 2078 2079 FcCharSetAddChar -- Add a character to a charset 2080 2081Synopsis 2082 2083#include <fontconfig.h> 2084 2085 FcBool FcCharSetAddChar(FcCharSet *fcs, FcChar32 ucs4); 2086 2087Description 2088 2089 FcCharSetAddChar adds a single unicode char to the set, 2090 returning FcFalse on failure, either as a result of a constant 2091 set or from running out of memory. 2092 2093Version 2094 2095 Fontconfig version 2.6.0 2096 2097FcCharSetCopy 2098 2099Name 2100 2101 FcCharSetCopy -- Copy a charset 2102 2103Synopsis 2104 2105#include <fontconfig.h> 2106 2107 FcCharSet * FcCharSetCopy(FcCharSet *src); 2108 2109Description 2110 2111 Makes a copy of src; note that this may not actually do 2112 anything more than increment the reference count on src. 2113 2114Version 2115 2116 Fontconfig version 2.6.0 2117 2118FcCharSetEqual 2119 2120Name 2121 2122 FcCharSetEqual -- Compare two charsets 2123 2124Synopsis 2125 2126#include <fontconfig.h> 2127 2128 FcBool FcCharSetEqual(const FcCharSet *a, const FcCharSet *b); 2129 2130Description 2131 2132 Returns whether a and b contain the same set of unicode chars. 2133 2134Version 2135 2136 Fontconfig version 2.6.0 2137 2138FcCharSetIntersect 2139 2140Name 2141 2142 FcCharSetIntersect -- Intersect charsets 2143 2144Synopsis 2145 2146#include <fontconfig.h> 2147 2148 FcCharSet * FcCharSetIntersect(const FcCharSet *a, const 2149 FcCharSet *b); 2150 2151Description 2152 2153 Returns a set including only those chars found in both a and b. 2154 2155Version 2156 2157 Fontconfig version 2.6.0 2158 2159FcCharSetUnion 2160 2161Name 2162 2163 FcCharSetUnion -- Add charsets 2164 2165Synopsis 2166 2167#include <fontconfig.h> 2168 2169 FcCharSet * FcCharSetUnion(const FcCharSet *a, const FcCharSet 2170 *b); 2171 2172Description 2173 2174 Returns a set including only those chars found in either a or 2175 b. 2176 2177Version 2178 2179 Fontconfig version 2.6.0 2180 2181FcCharSetSubtract 2182 2183Name 2184 2185 FcCharSetSubtract -- Subtract charsets 2186 2187Synopsis 2188 2189#include <fontconfig.h> 2190 2191 FcCharSet * FcCharSetSubtract(const FcCharSet *a, const 2192 FcCharSet *b); 2193 2194Description 2195 2196 Returns a set including only those chars found in a but not b. 2197 2198Version 2199 2200 Fontconfig version 2.6.0 2201 2202FcCharSetHasChar 2203 2204Name 2205 2206 FcCharSetHasChar -- Check a charset for a char 2207 2208Synopsis 2209 2210#include <fontconfig.h> 2211 2212 FcBool FcCharSetHasChar(const FcCharSet *fcs, FcChar32 ucs4); 2213 2214Description 2215 2216 Returns whether fcs contains the char ucs4. 2217 2218Version 2219 2220 Fontconfig version 2.6.0 2221 2222FcCharSetCount 2223 2224Name 2225 2226 FcCharSetCount -- Count entries in a charset 2227 2228Synopsis 2229 2230#include <fontconfig.h> 2231 2232 FcChar32 FcCharSetCount(const FcCharSet *a); 2233 2234Description 2235 2236 Returns the total number of unicode chars in a. 2237 2238Version 2239 2240 Fontconfig version 2.6.0 2241 2242FcCharSetIntersectCount 2243 2244Name 2245 2246 FcCharSetIntersectCount -- Intersect and count charsets 2247 2248Synopsis 2249 2250#include <fontconfig.h> 2251 2252 FcChar32 FcCharSetIntersectCount(const FcCharSet *a, const 2253 FcCharSet *b); 2254 2255Description 2256 2257 Returns the number of chars that are in both a and b. 2258 2259Version 2260 2261 Fontconfig version 2.6.0 2262 2263FcCharSetSubtractCount 2264 2265Name 2266 2267 FcCharSetSubtractCount -- Subtract and count charsets 2268 2269Synopsis 2270 2271#include <fontconfig.h> 2272 2273 FcChar32 FcCharSetSubtractCount(const FcCharSet *a, const 2274 FcCharSet *b); 2275 2276Description 2277 2278 Returns the number of chars that are in a but not in b. 2279 2280Version 2281 2282 Fontconfig version 2.6.0 2283 2284FcCharSetIsSubset 2285 2286Name 2287 2288 FcCharSetIsSubset -- Test for charset inclusion 2289 2290Synopsis 2291 2292#include <fontconfig.h> 2293 2294 FcBool FcCharSetIsSubset(const FcCharSet *a, const FcCharSet 2295 *b); 2296 2297Description 2298 2299 Returns whether a is a subset of b. 2300 2301Version 2302 2303 Fontconfig version 2.6.0 2304 2305FcCharSetFirstPage 2306 2307Name 2308 2309 FcCharSetFirstPage -- Start enumerating charset contents 2310 2311Synopsis 2312 2313#include <fontconfig.h> 2314 2315 FcChar32 FcCharSetFirstPage(const FcCharSet *a, 2316 FcChar32[FC_CHARSET_MAP_SIZE] map, FcChar32 *next); 2317 2318Description 2319 2320 Builds an array of bits marking the first page of Unicode 2321 coverage of a. Returns the base of the array. next contains the 2322 next page in the font. 2323 2324Version 2325 2326 Fontconfig version 2.6.0 2327 2328FcCharSetNextPage 2329 2330Name 2331 2332 FcCharSetNextPage -- Continue enumerating charset contents 2333 2334Synopsis 2335 2336#include <fontconfig.h> 2337 2338 FcChar32 FcCharSetNextPage(const FcCharSet *a, 2339 FcChar32[FC_CHARSET_MAP_SIZE] map, FcChar32 *next); 2340 2341Description 2342 2343 Builds an array of bits marking the Unicode coverage of a for 2344 page *next. Returns the base of the array. next contains the 2345 next page in the font. 2346 2347Version 2348 2349 Fontconfig version 2.6.0 2350 2351FcCharSetCoverage 2352 2353Name 2354 2355 FcCharSetCoverage -- DEPRECATED return coverage for a Unicode 2356 page 2357 2358Synopsis 2359 2360#include <fontconfig.h> 2361 2362 FcChar32 FcCharSetCoverage(const FcCharSet *a, FcChar32page, 2363 FcChar32[8]result); 2364 2365Description 2366 2367 DEPRECATED This function returns a bitmask in result which 2368 indicates which code points in page are included in a. 2369 FcCharSetCoverage returns the next page in the charset which 2370 has any coverage. 2371 2372Version 2373 2374 Fontconfig version 2.6.0 2375 2376FcCharSetNew 2377 2378Name 2379 2380 FcCharSetNew -- DEPRECATED alias for FcCharSetCreate 2381 2382Synopsis 2383 2384#include <fontconfig.h> 2385 2386 FcCharSet * FcCharSetNew(void); 2387 2388Description 2389 2390 FcCharSetNew is a DEPRECATED alias for FcCharSetCreate. 2391 2392Version 2393 2394 Fontconfig version 2.6.0 2395 __________________________________________________________ 2396 23974.8. FcLangSet 2398 2399 Table of Contents 2400 FcLangSetCreate -- create a langset object 2401 FcLangSetDestroy -- destroy a langset object 2402 FcLangSetCopy -- copy a langset object 2403 FcLangSetAdd -- add a language to a langset 2404 FcLangSetCompare -- compare language sets 2405 FcLangSetContains -- check langset subset relation 2406 FcLangSetEqual -- test for matching langsets 2407 FcLangSetHash -- return a hash value for a langset 2408 FcLangSetHasLang -- test langset for language support 2409 FcGetLangs -- Get list of languages 2410 FcLangGetCharSet -- Get character map for a language 2411 2412 An FcLangSet is a set of language names (each of which include 2413 language and an optional territory). They are used when 2414 selecting fonts to indicate which languages the fonts need to 2415 support. Each font is marked, using language orthography 2416 information built into fontconfig, with the set of supported 2417 languages. 2418 2419FcLangSetCreate 2420 2421Name 2422 2423 FcLangSetCreate -- create a langset object 2424 2425Synopsis 2426 2427#include <fontconfig.h> 2428 2429 FcLangSet * FcLangSetCreate(void); 2430 2431Description 2432 2433 FcLangSetCreate creates a new FcLangSet object. 2434 2435Version 2436 2437 Fontconfig version 2.6.0 2438 2439FcLangSetDestroy 2440 2441Name 2442 2443 FcLangSetDestroy -- destroy a langset object 2444 2445Synopsis 2446 2447#include <fontconfig.h> 2448 2449 void FcLangSetDestroy(FcLangSet *ls); 2450 2451Description 2452 2453 FcLangSetDestroy destroys a FcLangSet object, freeing all 2454 memory associated with it. 2455 2456Version 2457 2458 Fontconfig version 2.6.0 2459 2460FcLangSetCopy 2461 2462Name 2463 2464 FcLangSetCopy -- copy a langset object 2465 2466Synopsis 2467 2468#include <fontconfig.h> 2469 2470 FcLangSet * FcLangSetCopy(const FcLangSet *ls); 2471 2472Description 2473 2474 FcLangSetCopy creates a new FcLangSet object and populates it 2475 with the contents of ls. 2476 2477Version 2478 2479 Fontconfig version 2.6.0 2480 2481FcLangSetAdd 2482 2483Name 2484 2485 FcLangSetAdd -- add a language to a langset 2486 2487Synopsis 2488 2489#include <fontconfig.h> 2490 2491 FcBool FcLangSetAdd(FcLangSet *ls, const FcChar8 *lang); 2492 2493Description 2494 2495 lang is added to ls. lang should be of the form Ll-Tt where Ll 2496 is a two or three letter language from ISO 639 and Tt is a 2497 territory from ISO 3166. 2498 2499Version 2500 2501 Fontconfig version 2.6.0 2502 2503FcLangSetCompare 2504 2505Name 2506 2507 FcLangSetCompare -- compare language sets 2508 2509Synopsis 2510 2511#include <fontconfig.h> 2512 2513 FcLangResult FcLangSetCompare(const FcLangSet *ls_a, const 2514 FcLangSet *ls_b); 2515 2516Description 2517 2518 FcLangSetCompare compares language coverage for ls_a and ls_b. 2519 If they share any language and territory pair, this function 2520 returns FcLangEqual. If they share a language but differ in 2521 which territory that language is for, this function returns 2522 FcLangDiffentTerritory. If they share no languages in common, 2523 this function returns FcLangDifferentLang. 2524 2525Version 2526 2527 Fontconfig version 2.6.0 2528 2529FcLangSetContains 2530 2531Name 2532 2533 FcLangSetContains -- check langset subset relation 2534 2535Synopsis 2536 2537#include <fontconfig.h> 2538 2539 FcBool FcLangSetContains(const FcLangSet *ls_a, const FcLangSet 2540 *ls_b); 2541 2542Description 2543 2544 FcLangSetContains returns FcTrue if ls_a contains every 2545 language in ls_b. ls_a will 'contain' a language from ls_b if 2546 ls_a has exactly the language, or either the language or ls_a 2547 has no territory. 2548 2549Version 2550 2551 Fontconfig version 2.6.0 2552 2553FcLangSetEqual 2554 2555Name 2556 2557 FcLangSetEqual -- test for matching langsets 2558 2559Synopsis 2560 2561#include <fontconfig.h> 2562 2563 FcBool FcLangSetEqual(const FcLangSet *ls_a, const FcLangSet 2564 *ls_b); 2565 2566Description 2567 2568 Returns FcTrue if and only if ls_a supports precisely the same 2569 language and territory combinations as ls_b. 2570 2571Version 2572 2573 Fontconfig version 2.6.0 2574 2575FcLangSetHash 2576 2577Name 2578 2579 FcLangSetHash -- return a hash value for a langset 2580 2581Synopsis 2582 2583#include <fontconfig.h> 2584 2585 FcChar32 FcLangSetHash(const FcLangSet *ls); 2586 2587Description 2588 2589 This function returns a value which depends solely on the 2590 languages supported by ls. Any language which equals ls will 2591 have the same result from FcLangSetHash. However, two langsets 2592 with the same hash value may not be equal. 2593 2594Version 2595 2596 Fontconfig version 2.6.0 2597 2598FcLangSetHasLang 2599 2600Name 2601 2602 FcLangSetHasLang -- test langset for language support 2603 2604Synopsis 2605 2606#include <fontconfig.h> 2607 2608 FcLangResult FcLangSetHasLang(const FcLangSet *ls, const 2609 FcChar8 *lang); 2610 2611Description 2612 2613 FcLangSetHasLang checks whether ls supports lang. If ls has a 2614 matching language and territory pair, this function returns 2615 FcLangEqual. If ls has a matching language but differs in which 2616 territory that language is for, this function returns 2617 FcLangDiffentTerritory. If ls has no matching language, this 2618 function returns FcLangDifferentLang. 2619 2620Version 2621 2622 Fontconfig version 2.6.0 2623 2624FcGetLangs 2625 2626Name 2627 2628 FcGetLangs -- Get list of languages 2629 2630Synopsis 2631 2632#include <fontconfig.h> 2633 2634 FcStrSet * FcGetLangs(void); 2635 2636Description 2637 2638 Returns a string set of all known languages. 2639 2640Version 2641 2642 Fontconfig version 2.6.0 2643 2644FcLangGetCharSet 2645 2646Name 2647 2648 FcLangGetCharSet -- Get character map for a language 2649 2650Synopsis 2651 2652#include <fontconfig.h> 2653 2654 const FcCharSet * FcLangGetCharSet(const FcChar8 *lang); 2655 2656Description 2657 2658 Returns the FcCharMap for a language. 2659 2660Version 2661 2662 Fontconfig version 2.6.0 2663 __________________________________________________________ 2664 26654.9. FcMatrix 2666 2667 Table of Contents 2668 FcMatrixInit -- initialize an FcMatrix structure 2669 FcMatrixCopy -- Copy a matrix 2670 FcMatrixEqual -- Compare two matrices 2671 FcMatrixMultiply -- Multiply matrices 2672 FcMatrixRotate -- Rotate a matrix 2673 FcMatrixScale -- Scale a matrix 2674 FcMatrixShear -- Shear a matrix 2675 2676 FcMatrix structures hold an affine transformation in matrix 2677 form. 2678 2679FcMatrixInit 2680 2681Name 2682 2683 FcMatrixInit -- initialize an FcMatrix structure 2684 2685Synopsis 2686 2687#include <fontconfig.h> 2688 2689 void FcMatrixInit(FcMatrix *matrix); 2690 2691Description 2692 2693 FcMatrixInit initializes matrix to the identity matrix. 2694 2695Version 2696 2697 Fontconfig version 2.6.0 2698 2699FcMatrixCopy 2700 2701Name 2702 2703 FcMatrixCopy -- Copy a matrix 2704 2705Synopsis 2706 2707#include <fontconfig.h> 2708 2709 void FcMatrixCopy(const FcMatrix *matrix); 2710 2711Description 2712 2713 FcMatrixCopy allocates a new FcMatrix and copies mat into it. 2714 2715Version 2716 2717 Fontconfig version 2.6.0 2718 2719FcMatrixEqual 2720 2721Name 2722 2723 FcMatrixEqual -- Compare two matrices 2724 2725Synopsis 2726 2727#include <fontconfig.h> 2728 2729 void FcMatrixEqual(const FcMatrix *matrix1, const FcMatrix 2730 *matrix2); 2731 2732Description 2733 2734 FcMatrixEqual compares matrix1 and matrix2 returning FcTrue 2735 when they are equal and FcFalse when they are not. 2736 2737Version 2738 2739 Fontconfig version 2.6.0 2740 2741FcMatrixMultiply 2742 2743Name 2744 2745 FcMatrixMultiply -- Multiply matrices 2746 2747Synopsis 2748 2749#include <fontconfig.h> 2750 2751 void FcMatrixMultiply(FcMatrix *result, const FcMatrix 2752 *matrix1, const FcMatrix *matrix2); 2753 2754Description 2755 2756 FcMatrixMultiply multiplies matrix1 and matrix2 storing the 2757 result in result. 2758 2759Version 2760 2761 Fontconfig version 2.6.0 2762 2763FcMatrixRotate 2764 2765Name 2766 2767 FcMatrixRotate -- Rotate a matrix 2768 2769Synopsis 2770 2771#include <fontconfig.h> 2772 2773 void FcMatrixRotate(FcMatrix *matrix, double cos, double sin); 2774 2775Description 2776 2777 FcMatrixRotate rotates matrix by the angle who's sine is sin 2778 and cosine is cos. This is done by multiplying by the matrix: 2779 cos -sin 2780 sin cos 2781 2782Version 2783 2784 Fontconfig version 2.6.0 2785 2786FcMatrixScale 2787 2788Name 2789 2790 FcMatrixScale -- Scale a matrix 2791 2792Synopsis 2793 2794#include <fontconfig.h> 2795 2796 void FcMatrixScale(FcMatrix *matrix, double sx, double dy); 2797 2798Description 2799 2800 FcMatrixScale multiplies matrix x values by sx and y values by 2801 sy. This is done by multiplying by the matrix: 2802 sx 0 2803 0 sy 2804 2805Version 2806 2807 Fontconfig version 2.6.0 2808 2809FcMatrixShear 2810 2811Name 2812 2813 FcMatrixShear -- Shear a matrix 2814 2815Synopsis 2816 2817#include <fontconfig.h> 2818 2819 void FcMatrixShear(FcMatrix *matrix, double sh, double sv); 2820 2821Description 2822 2823 FcMatrixShare shears matrix horizontally by sh and vertically 2824 by sv. This is done by multiplying by the matrix: 2825 1 sh 2826 sv 1 2827 2828Version 2829 2830 Fontconfig version 2.6.0 2831 __________________________________________________________ 2832 28334.10. FcConfig 2834 2835 Table of Contents 2836 FcConfigCreate -- Create a configuration 2837 FcConfigDestroy -- Destroy a configuration 2838 FcConfigSetCurrent -- Set configuration as default 2839 FcConfigGetCurrent -- Return current configuration 2840 FcConfigUptoDate -- Check timestamps on config files 2841 FcConfigHome -- return the current home directory. 2842 FcConfigEnableHome -- controls use of the home directory. 2843 FcConfigBuildFonts -- Build font database 2844 FcConfigGetConfigDirs -- Get config directories 2845 FcConfigGetFontDirs -- Get font directories 2846 FcConfigGetConfigFiles -- Get config files 2847 FcConfigGetCache -- DEPRECATED used to return per-user cache 2848 filename 2849 2850 FcConfigGetCacheDirs -- return the list of directories searched 2851 for cache files 2852 2853 FcConfigGetFonts -- Get config font set 2854 FcConfigGetBlanks -- Get config blanks 2855 FcConfigGetRescanInterval -- Get config rescan interval 2856 FcConfigSetRescanInterval -- Set config rescan interval 2857 FcConfigAppFontAddFile -- Add font file to font database 2858 FcConfigAppFontAddDir -- Add fonts from directory to font 2859 database 2860 2861 FcConfigAppFontClear -- Remove all app fonts from font database 2862 FcConfigSubstituteWithPat -- Execute substitutions 2863 FcConfigSubstitute -- Execute substitutions 2864 FcFontMatch -- Return best font 2865 FcFontSort -- Return list of matching fonts 2866 FcFontRenderPrepare -- Prepare pattern for loading font file 2867 FcFontList -- List fonts 2868 FcConfigFilename -- Find a config file 2869 FcConfigParseAndLoad -- load a configuration file 2870 2871 An FcConfig object holds the internal representation of a 2872 configuration. There is a default configuration which 2873 applications may use by passing 0 to any function using the 2874 data within an FcConfig. 2875 2876FcConfigCreate 2877 2878Name 2879 2880 FcConfigCreate -- Create a configuration 2881 2882Synopsis 2883 2884#include <fontconfig.h> 2885 2886 FcConfig * FcConfigCreate(void); 2887 2888Description 2889 2890 Creates an empty configuration. 2891 2892Version 2893 2894 Fontconfig version 2.6.0 2895 2896FcConfigDestroy 2897 2898Name 2899 2900 FcConfigDestroy -- Destroy a configuration 2901 2902Synopsis 2903 2904#include <fontconfig.h> 2905 2906 void FcConfigDestroy(FcConfig *config); 2907 2908Description 2909 2910 Destroys a configuration and any data associated with it. Note 2911 that calling this function with the return from 2912 FcConfigGetCurrent will place the library in an indeterminate 2913 state. 2914 2915Version 2916 2917 Fontconfig version 2.6.0 2918 2919FcConfigSetCurrent 2920 2921Name 2922 2923 FcConfigSetCurrent -- Set configuration as default 2924 2925Synopsis 2926 2927#include <fontconfig.h> 2928 2929 FcBool FcConfigSetCurrent(FcConfig *config); 2930 2931Description 2932 2933 Sets the current default configuration to config. Implicitly 2934 calls FcConfigBuildFonts if necessary, returning FcFalse if 2935 that call fails. 2936 2937Version 2938 2939 Fontconfig version 2.6.0 2940 2941FcConfigGetCurrent 2942 2943Name 2944 2945 FcConfigGetCurrent -- Return current configuration 2946 2947Synopsis 2948 2949#include <fontconfig.h> 2950 2951 FcConfig * FcConfigGetCurrent(void); 2952 2953Description 2954 2955 Returns the current default configuration. 2956 2957Version 2958 2959 Fontconfig version 2.6.0 2960 2961FcConfigUptoDate 2962 2963Name 2964 2965 FcConfigUptoDate -- Check timestamps on config files 2966 2967Synopsis 2968 2969#include <fontconfig.h> 2970 2971 FcBool FcConfigUptoDate(FcConfig *config); 2972 2973Description 2974 2975 Checks all of the files related to config and returns whether 2976 any of them has been modified since the configuration was 2977 created. 2978 2979Version 2980 2981 Fontconfig version 2.6.0 2982 2983FcConfigHome 2984 2985Name 2986 2987 FcConfigHome -- return the current home directory. 2988 2989Synopsis 2990 2991#include <fontconfig.h> 2992 2993 FcBool FcConfigHome(void); 2994 2995Description 2996 2997 Return the current user's home directory, if it is available, 2998 and if using it is enabled. See also FcConfigEnableHome). 2999 3000Version 3001 3002 Fontconfig version 2.6.0 3003 3004FcConfigEnableHome 3005 3006Name 3007 3008 FcConfigEnableHome -- controls use of the home directory. 3009 3010Synopsis 3011 3012#include <fontconfig.h> 3013 3014 FcBol FcConfigEnableHome(FcBool enable); 3015 3016Description 3017 3018 If enable is FcTrue, then Fontconfig will use various files 3019 which are specified relative to the user's home directory 3020 (using the ~ notation in the configuration). When enable is 3021 FcFalse, then all use of the home directory in these contexts 3022 will be disabled. The previous setting of the value is 3023 returned. 3024 3025Version 3026 3027 Fontconfig version 2.6.0 3028 3029FcConfigBuildFonts 3030 3031Name 3032 3033 FcConfigBuildFonts -- Build font database 3034 3035Synopsis 3036 3037#include <fontconfig.h> 3038 3039 FcBool FcConfigBuildFonts(FcConfig *config); 3040 3041Description 3042 3043 Builds the set of available fonts for the given configuration. 3044 Note that any changes to the configuration after this call have 3045 indeterminate effects. Returns FcFalse if this operation runs 3046 out of memory. 3047 3048Version 3049 3050 Fontconfig version 2.6.0 3051 3052FcConfigGetConfigDirs 3053 3054Name 3055 3056 FcConfigGetConfigDirs -- Get config directories 3057 3058Synopsis 3059 3060#include <fontconfig.h> 3061 3062 FcStrList * FcConfigGetConfigDirs(FcConfig *config); 3063 3064Description 3065 3066 Returns the list of font directories specified in the 3067 configuration files for config. Does not include any 3068 subdirectories. 3069 3070Version 3071 3072 Fontconfig version 2.6.0 3073 3074FcConfigGetFontDirs 3075 3076Name 3077 3078 FcConfigGetFontDirs -- Get font directories 3079 3080Synopsis 3081 3082#include <fontconfig.h> 3083 3084 FcStrList * FcConfigGetFontDirs(FcConfig *config); 3085 3086Description 3087 3088 Returns the list of font directories in config. This includes 3089 the configured font directories along with any directories 3090 below those in the filesystem. 3091 3092Version 3093 3094 Fontconfig version 2.6.0 3095 3096FcConfigGetConfigFiles 3097 3098Name 3099 3100 FcConfigGetConfigFiles -- Get config files 3101 3102Synopsis 3103 3104#include <fontconfig.h> 3105 3106 FcStrList * FcConfigGetConfigFiles(FcConfig *config); 3107 3108Description 3109 3110 Returns the list of known configuration files used to generate 3111 config. 3112 3113Version 3114 3115 Fontconfig version 2.6.0 3116 3117FcConfigGetCache 3118 3119Name 3120 3121 FcConfigGetCache -- DEPRECATED used to return per-user cache 3122 filename 3123 3124Synopsis 3125 3126#include <fontconfig.h> 3127 3128 FcChar8 * FcConfigGetCache(FcConfig *config); 3129 3130Description 3131 3132 With fontconfig no longer using per-user cache files, this 3133 function now simply returns NULL to indicate that no per-user 3134 file exists. 3135 3136Version 3137 3138 Fontconfig version 2.6.0 3139 3140FcConfigGetCacheDirs 3141 3142Name 3143 3144 FcConfigGetCacheDirs -- return the list of directories searched 3145 for cache files 3146 3147Synopsis 3148 3149#include <fontconfig.h> 3150 3151 FcStrList * FcConfigGetCacheDirs(FcConfig *config); 3152 3153Description 3154 3155 FcConfigGetCacheDirs returns a string list containing all of 3156 the directories that fontconfig will search when attempting to 3157 load a cache file for a font directory. 3158 3159Version 3160 3161 Fontconfig version 2.6.0 3162 3163FcConfigGetFonts 3164 3165Name 3166 3167 FcConfigGetFonts -- Get config font set 3168 3169Synopsis 3170 3171#include <fontconfig.h> 3172 3173 FcFontSet * FcConfigGetFonts(FcConfig *config, FcSetName set); 3174 3175Description 3176 3177 Returns one of the two sets of fonts from the configuration as 3178 specified by set. This font set is owned by the library and 3179 must not be freed. 3180 3181Version 3182 3183 Fontconfig version 2.6.0 3184 3185FcConfigGetBlanks 3186 3187Name 3188 3189 FcConfigGetBlanks -- Get config blanks 3190 3191Synopsis 3192 3193#include <fontconfig.h> 3194 3195 FcBlanks * FcConfigGetBlanks(FcConfig *config); 3196 3197Description 3198 3199 Returns the FcBlanks object associated with the given 3200 configuration, if no blanks were present in the configuration, 3201 this function will return 0. 3202 3203Version 3204 3205 Fontconfig version 2.6.0 3206 3207FcConfigGetRescanInterval 3208 3209Name 3210 3211 FcConfigGetRescanInterval -- Get config rescan interval 3212 3213Synopsis 3214 3215#include <fontconfig.h> 3216 3217 int FcConfigGetRescanInterval(FcConfig *config); 3218 3219Description 3220 3221 Returns the interval between automatic checks of the 3222 configuration (in seconds) specified in config. The 3223 configuration is checked during a call to FcFontList when this 3224 interval has passed since the last check. 3225 3226Version 3227 3228 Fontconfig version 2.6.0 3229 3230FcConfigSetRescanInterval 3231 3232Name 3233 3234 FcConfigSetRescanInterval -- Set config rescan interval 3235 3236Synopsis 3237 3238#include <fontconfig.h> 3239 3240 FcBool FcConfigSetRescanInterval(FcConfig *config, int 3241 rescanInterval); 3242 3243Description 3244 3245 Sets the rescan interval. Returns FcFalse if the interval 3246 cannot be set (due to allocation failure). Otherwise returns 3247 FcTrue. 3248 3249Version 3250 3251 Fontconfig version 2.6.0 3252 3253FcConfigAppFontAddFile 3254 3255Name 3256 3257 FcConfigAppFontAddFile -- Add font file to font database 3258 3259Synopsis 3260 3261#include <fontconfig.h> 3262 3263 FcBool FcConfigAppFontAddFile(FcConfig *config, const FcChar8 3264 *file); 3265 3266Description 3267 3268 Adds an application-specific font to the configuration. Returns 3269 FcFalse if the fonts cannot be added (due to allocation 3270 failure). Otherwise returns FcTrue. 3271 3272Version 3273 3274 Fontconfig version 2.6.0 3275 3276FcConfigAppFontAddDir 3277 3278Name 3279 3280 FcConfigAppFontAddDir -- Add fonts from directory to font 3281 database 3282 3283Synopsis 3284 3285#include <fontconfig.h> 3286 3287 FcBool FcConfigAppFontAddDir(FcConfig *config, const FcChar8 3288 *dir); 3289 3290Description 3291 3292 Scans the specified directory for fonts, adding each one found 3293 to the application-specific set of fonts. Returns FcFalse if 3294 the fonts cannot be added (due to allocation failure). 3295 Otherwise returns FcTrue. 3296 3297Version 3298 3299 Fontconfig version 2.6.0 3300 3301FcConfigAppFontClear 3302 3303Name 3304 3305 FcConfigAppFontClear -- Remove all app fonts from font database 3306 3307Synopsis 3308 3309#include <fontconfig.h> 3310 3311 void FcConfigAppFontClear(FcConfig *config); 3312 3313Description 3314 3315 Clears the set of application-specific fonts. 3316 3317Version 3318 3319 Fontconfig version 2.6.0 3320 3321FcConfigSubstituteWithPat 3322 3323Name 3324 3325 FcConfigSubstituteWithPat -- Execute substitutions 3326 3327Synopsis 3328 3329#include <fontconfig.h> 3330 3331 FcBool FcConfigSubstituteWithPat(FcConfig *config, FcPattern 3332 *p, FcPattern *p_pat, FcMatchKind kind); 3333 3334Description 3335 3336 Performs the sequence of pattern modification operations, if 3337 kind is FcMatchPattern, then those tagged as pattern operations 3338 are applied, else if kind is FcMatchFont, those tagged as font 3339 operations are applied and p_pat is used for <test> elements 3340 with target=pattern. Returns FcFalse if the substitution cannot 3341 be performed (due to allocation failure). Otherwise returns 3342 FcTrue. 3343 3344Version 3345 3346 Fontconfig version 2.6.0 3347 3348FcConfigSubstitute 3349 3350Name 3351 3352 FcConfigSubstitute -- Execute substitutions 3353 3354Synopsis 3355 3356#include <fontconfig.h> 3357 3358 FcBool FcConfigSubstitute(FcConfig *config, FcPattern *p, 3359 FcMatchKind kind); 3360 3361Description 3362 3363 Calls FcConfigSubstituteWithPat setting p_pat to NULL. Returns 3364 FcFalse if the substitution cannot be performed (due to 3365 allocation failure). Otherwise returns FcTrue. 3366 3367Version 3368 3369 Fontconfig version 2.6.0 3370 3371FcFontMatch 3372 3373Name 3374 3375 FcFontMatch -- Return best font 3376 3377Synopsis 3378 3379#include <fontconfig.h> 3380 3381 FcPattern * FcFontMatch(FcConfig *config, FcPattern *p, 3382 FcResult *result); 3383 3384Description 3385 3386 Finds the font in sets most closely matching pattern and 3387 returns the result of FcFontRenderPrepare for that font and the 3388 provided pattern. This function should be called only after 3389 FcConfigSubstitute and FcDefaultSubstitute have been called for 3390 p; otherwise the results will not be correct. 3391 3392Version 3393 3394 Fontconfig version 2.6.0 3395 3396FcFontSort 3397 3398Name 3399 3400 FcFontSort -- Return list of matching fonts 3401 3402Synopsis 3403 3404#include <fontconfig.h> 3405 3406 FcFontSet * FcFontSort(FcConfig *config, FcPattern *p, FcBool 3407 trim, FcCharSet **csp, FcResult *result); 3408 3409Description 3410 3411 Returns the list of fonts sorted by closeness to p. If trim is 3412 FcTrue, elements in the list which don't include Unicode 3413 coverage not provided by earlier elements in the list are 3414 elided. The union of Unicode coverage of all of the fonts is 3415 returned in csp, if csp is not NULL. This function should be 3416 called only after FcConfigSubstitute and FcDefaultSubstitute 3417 have been called for p; otherwise the results will not be 3418 correct. 3419 3420 The returned FcFontSet references FcPattern structures which 3421 may be shared by the return value from multiple FcFontSort 3422 calls, applications must not modify these patterns. Instead, 3423 they should be passed, along with p to FcFontRenderPrepare 3424 which combines them into a complete pattern. 3425 3426 The FcFontSet returned by FcFontSort is destroyed by caling 3427 FcFontSetDestroy. 3428 3429Version 3430 3431 Fontconfig version 2.6.0 3432 3433FcFontRenderPrepare 3434 3435Name 3436 3437 FcFontRenderPrepare -- Prepare pattern for loading font file 3438 3439Synopsis 3440 3441#include <fontconfig.h> 3442 3443 FcPattern * FcFontRenderPrepare(FcConfig *config, FcPattern 3444 *pat, FcPattern *font); 3445 3446Description 3447 3448 Creates a new pattern consisting of elements of font not 3449 appearing in pat, elements of pat not appearing in font and the 3450 best matching value from pat for elements appearing in both. 3451 The result is passed to FcConfigSubstitute with kind 3452 FcMatchFont and then returned. 3453 3454Version 3455 3456 Fontconfig version 2.6.0 3457 3458FcFontList 3459 3460Name 3461 3462 FcFontList -- List fonts 3463 3464Synopsis 3465 3466#include <fontconfig.h> 3467 3468 FcFontSet * FcFontList(FcConfig *config, FcPattern *p, 3469 FcObjectSet *os); 3470 3471Description 3472 3473 Selects fonts matching p, creates patterns from those fonts 3474 containing only the objects in os and returns the set of unique 3475 such patterns. 3476 3477Version 3478 3479 Fontconfig version 2.6.0 3480 3481FcConfigFilename 3482 3483Name 3484 3485 FcConfigFilename -- Find a config file 3486 3487Synopsis 3488 3489#include <fontconfig.h> 3490 3491 FcChar8 * FcConfigFilename(const FcChar8 *name); 3492 3493Description 3494 3495 Given the specified external entity name, return the associated 3496 filename. This provides applications a way to convert various 3497 configuration file references into filename form. 3498 3499 A null or empty name indicates that the default configuration 3500 file should be used; which file this references can be 3501 overridden with the FC_CONFIG_FILE environment variable. Next, 3502 if the name starts with ~, it refers to a file in the current 3503 users home directory. Otherwise if the name doesn't start with 3504 '/', it refers to a file in the default configuration 3505 directory; the built-in default directory can be overridden 3506 with the FC_CONFIG_DIR environment variable. 3507 3508Version 3509 3510 Fontconfig version 2.6.0 3511 3512FcConfigParseAndLoad 3513 3514Name 3515 3516 FcConfigParseAndLoad -- load a configuration file 3517 3518Synopsis 3519 3520#include <fontconfig.h> 3521 3522 FcBool FcConfigParseAndLoad(FcConfig *config, const FcChar8 3523 *file, FcBool complain); 3524 3525Description 3526 3527 Walks the configuration in 'file' and constructs the internal 3528 representation in 'config'. Any include files referenced from 3529 within 'file' will be loaded and parsed. If 'complain' is 3530 FcFalse, no warning will be displayed if 'file' does not exist. 3531 Error and warning messages will be output to stderr. Returns 3532 FcFalse if some error occurred while loading the file, either a 3533 parse error, semantic error or allocation failure. Otherwise 3534 returns FcTrue. 3535 3536Version 3537 3538 Fontconfig version 2.6.0 3539 __________________________________________________________ 3540 35414.11. FcObjectType 3542 3543 Table of Contents 3544 FcNameRegisterObjectTypes -- Register object types 3545 FcNameUnregisterObjectTypes -- Unregister object types 3546 FcNameGetObjectType -- Lookup an object type 3547 3548 Provides for applcation-specified font name object types so 3549 that new pattern elements can be generated from font names. 3550 3551FcNameRegisterObjectTypes 3552 3553Name 3554 3555 FcNameRegisterObjectTypes -- Register object types 3556 3557Synopsis 3558 3559#include <fontconfig.h> 3560 3561 FcBool FcNameRegisterObjectTypes(const FcObjectType *types, int 3562 ntype); 3563 3564Description 3565 3566 Register ntype new object types. Returns FcFalse if some of the 3567 names cannot be registered (due to allocation failure). 3568 Otherwise returns FcTrue. 3569 3570Version 3571 3572 Fontconfig version 2.6.0 3573 3574FcNameUnregisterObjectTypes 3575 3576Name 3577 3578 FcNameUnregisterObjectTypes -- Unregister object types 3579 3580Synopsis 3581 3582#include <fontconfig.h> 3583 3584 FcBool FcNameUnregisterObjectTypes(const FcObjectType *types, 3585 int ntype); 3586 3587Description 3588 3589 Unregister ntype object types. Returns FcTrue. 3590 3591Version 3592 3593 Fontconfig version 2.6.0 3594 3595FcNameGetObjectType 3596 3597Name 3598 3599 FcNameGetObjectType -- Lookup an object type 3600 3601Synopsis 3602 3603#include <fontconfig.h> 3604 3605 const FcObjectType * FcNameGetObjectType(const char *object); 3606 3607Description 3608 3609 Return the object type for the pattern element named object. 3610 3611Version 3612 3613 Fontconfig version 2.6.0 3614 __________________________________________________________ 3615 36164.12. FcConstant 3617 3618 Table of Contents 3619 FcNameRegisterConstants -- Register symbolic constants 3620 FcNameUnregisterConstants -- Unregister symbolic constants 3621 FcNameGetConstant -- Lookup symbolic constant 3622 FcNameConstant -- Get the value for a symbolic constant 3623 3624 Provides for application-specified symbolic constants for font 3625 names. 3626 3627FcNameRegisterConstants 3628 3629Name 3630 3631 FcNameRegisterConstants -- Register symbolic constants 3632 3633Synopsis 3634 3635#include <fontconfig.h> 3636 3637 FcBool FcNameRegisterConstants(const FcConstant *consts, int 3638 nconsts); 3639 3640Description 3641 3642 Register nconsts new symbolic constants. Returns FcFalse if the 3643 constants cannot be registered (due to allocation failure). 3644 Otherwise returns FcTrue. 3645 3646Version 3647 3648 Fontconfig version 2.6.0 3649 3650FcNameUnregisterConstants 3651 3652Name 3653 3654 FcNameUnregisterConstants -- Unregister symbolic constants 3655 3656Synopsis 3657 3658#include <fontconfig.h> 3659 3660 FcBool FcNameUnregisterConstants(const FcConstant *consts, int 3661 nconsts); 3662 3663Description 3664 3665 Unregister nconsts symbolic constants. Returns FcFalse if the 3666 specified constants were not registered. Otherwise returns 3667 FcTrue. 3668 3669Version 3670 3671 Fontconfig version 2.6.0 3672 3673FcNameGetConstant 3674 3675Name 3676 3677 FcNameGetConstant -- Lookup symbolic constant 3678 3679Synopsis 3680 3681#include <fontconfig.h> 3682 3683 const FcConstant * FcNameGetConstant(FcChar8 *string); 3684 3685Description 3686 3687 Return the FcConstant structure related to symbolic constant 3688 string. 3689 3690Version 3691 3692 Fontconfig version 2.6.0 3693 3694FcNameConstant 3695 3696Name 3697 3698 FcNameConstant -- Get the value for a symbolic constant 3699 3700Synopsis 3701 3702#include <fontconfig.h> 3703 3704 FcBool FcNameConstant(FcChar8 *string, int *result); 3705 3706Description 3707 3708 Returns whether a symbolic constant with name string is 3709 registered, placing the value of the constant in result if 3710 present. 3711 3712Version 3713 3714 Fontconfig version 2.6.0 3715 __________________________________________________________ 3716 37174.13. FcBlanks 3718 3719 Table of Contents 3720 FcBlanksCreate -- Create an FcBlanks 3721 FcBlanksDestroy -- Destroy and FcBlanks 3722 FcBlanksAdd -- Add a character to an FcBlanks 3723 FcBlanksIsMember -- Query membership in an FcBlanks 3724 3725 An FcBlanks object holds a list of Unicode chars which are 3726 expected to be blank when drawn. When scanning new fonts, any 3727 glyphs which are empty and not in this list will be assumed to 3728 be broken and not placed in the FcCharSet associated with the 3729 font. This provides a significantly more accurate CharSet for 3730 applications. 3731 3732FcBlanksCreate 3733 3734Name 3735 3736 FcBlanksCreate -- Create an FcBlanks 3737 3738Synopsis 3739 3740#include <fontconfig.h> 3741 3742 FcBlanks * FcBlanksCreate(void); 3743 3744Description 3745 3746 Creates an empty FcBlanks object. 3747 3748Version 3749 3750 Fontconfig version 2.6.0 3751 3752FcBlanksDestroy 3753 3754Name 3755 3756 FcBlanksDestroy -- Destroy and FcBlanks 3757 3758Synopsis 3759 3760#include <fontconfig.h> 3761 3762 void FcBlanksDestroy(FcBlanks *b); 3763 3764Description 3765 3766 Destroys an FcBlanks object, freeing any associated memory. 3767 3768Version 3769 3770 Fontconfig version 2.6.0 3771 3772FcBlanksAdd 3773 3774Name 3775 3776 FcBlanksAdd -- Add a character to an FcBlanks 3777 3778Synopsis 3779 3780#include <fontconfig.h> 3781 3782 FcBool FcBlanksAdd(FcBlanks *b, FcChar32 ucs4); 3783 3784Description 3785 3786 Adds a single character to an FcBlanks object, returning 3787 FcFalse if this process ran out of memory. 3788 3789Version 3790 3791 Fontconfig version 2.6.0 3792 3793FcBlanksIsMember 3794 3795Name 3796 3797 FcBlanksIsMember -- Query membership in an FcBlanks 3798 3799Synopsis 3800 3801#include <fontconfig.h> 3802 3803 FcBool FcBlanksIsMember(FcBlanks *b, FcChar32 ucs4); 3804 3805Description 3806 3807 Returns whether the specified FcBlanks object contains the 3808 indicated Unicode value. 3809 3810Version 3811 3812 Fontconfig version 2.6.0 3813 __________________________________________________________ 3814 38154.14. FcAtomic 3816 3817 Table of Contents 3818 FcAtomicCreate -- create an FcAtomic object 3819 FcAtomicLock -- lock a file 3820 FcAtomicNewFile -- return new temporary file name 3821 FcAtomicOrigFile -- return original file name 3822 FcAtomicReplaceOrig -- replace original with new 3823 FcAtomicDeleteNew -- delete new file 3824 FcAtomicUnlock -- unlock a file 3825 FcAtomicDestroy -- destroy an FcAtomic object 3826 3827 These functions provide a safe way to update config files, 3828 allowing ongoing reading of the old config file while locked 3829 for writing and ensuring that a consistent and complete version 3830 of the config file is always available. 3831 3832FcAtomicCreate 3833 3834Name 3835 3836 FcAtomicCreate -- create an FcAtomic object 3837 3838Synopsis 3839 3840#include <fontconfig.h> 3841 3842 FcAtomic * FcAtomicCreate(const FcChar8 *file); 3843 3844Description 3845 3846 Creates a data structure containing data needed to control 3847 access to file. Writing is done to a separate file. Once that 3848 file is complete, the original configuration file is atomically 3849 replaced so that reading process always see a consistent and 3850 complete file without the need to lock for reading. 3851 3852Version 3853 3854 Fontconfig version 2.6.0 3855 3856FcAtomicLock 3857 3858Name 3859 3860 FcAtomicLock -- lock a file 3861 3862Synopsis 3863 3864#include <fontconfig.h> 3865 3866 FcBool FcAtomicLock(FcAtomic *atomic); 3867 3868Description 3869 3870 Attempts to lock the file referenced by atomic. Returns FcFalse 3871 if the file is already locked, else returns FcTrue and leaves 3872 the file locked. 3873 3874Version 3875 3876 Fontconfig version 2.6.0 3877 3878FcAtomicNewFile 3879 3880Name 3881 3882 FcAtomicNewFile -- return new temporary file name 3883 3884Synopsis 3885 3886#include <fontconfig.h> 3887 3888 FcChar8 * FcAtomicNewFile(FcAtomic *atomic); 3889 3890Description 3891 3892 Returns the filename for writing a new version of the file 3893 referenced by atomic. 3894 3895Version 3896 3897 Fontconfig version 2.6.0 3898 3899FcAtomicOrigFile 3900 3901Name 3902 3903 FcAtomicOrigFile -- return original file name 3904 3905Synopsis 3906 3907#include <fontconfig.h> 3908 3909 FcChar8 * FcAtomicOrigFile(FcAtomic *atomic); 3910 3911Description 3912 3913 Returns the file refernced by atomic. 3914 3915Version 3916 3917 Fontconfig version 2.6.0 3918 3919FcAtomicReplaceOrig 3920 3921Name 3922 3923 FcAtomicReplaceOrig -- replace original with new 3924 3925Synopsis 3926 3927#include <fontconfig.h> 3928 3929 FcBool FcAtomicReplaceOrig(FcAtomic *atomic); 3930 3931Description 3932 3933 Replaces the original file referenced by atomic with the new 3934 file. Returns FcFalse if the file cannot be replaced due to 3935 permission issues in the filesystem. Otherwise returns FcTrue. 3936 3937Version 3938 3939 Fontconfig version 2.6.0 3940 3941FcAtomicDeleteNew 3942 3943Name 3944 3945 FcAtomicDeleteNew -- delete new file 3946 3947Synopsis 3948 3949#include <fontconfig.h> 3950 3951 void FcAtomicDeleteNew(FcAtomic *atomic); 3952 3953Description 3954 3955 Deletes the new file. Used in error recovery to back out 3956 changes. 3957 3958Version 3959 3960 Fontconfig version 2.6.0 3961 3962FcAtomicUnlock 3963 3964Name 3965 3966 FcAtomicUnlock -- unlock a file 3967 3968Synopsis 3969 3970#include <fontconfig.h> 3971 3972 void FcAtomicUnlock(FcAtomic *atomic); 3973 3974Description 3975 3976 Unlocks the file. 3977 3978Version 3979 3980 Fontconfig version 2.6.0 3981 3982FcAtomicDestroy 3983 3984Name 3985 3986 FcAtomicDestroy -- destroy an FcAtomic object 3987 3988Synopsis 3989 3990#include <fontconfig.h> 3991 3992 void FcAtomicDestroy(FcAtomic *atomic); 3993 3994Description 3995 3996 Destroys atomic. 3997 3998Version 3999 4000 Fontconfig version 2.6.0 4001 __________________________________________________________ 4002 40034.15. File and Directory routines 4004 4005 Table of Contents 4006 FcFileScan -- scan a font file 4007 FcFileIsDir -- check whether a file is a directory 4008 FcDirScan -- DEPRECATED: formerly used to scan a font directory 4009 FcDirSave -- DEPRECATED: formerly used to save a directory 4010 cache 4011 4012 FcDirCacheUnlink -- Remove all caches related to dir 4013 FcDirCacheValid -- check directory cache 4014 FcDirCacheLoad -- load a directory cache 4015 FcDirCacheRead -- read or construct a directory cache 4016 FcDirCacheLoadFile -- load a cache file 4017 FcDirCacheUnload -- unload a cache file 4018 4019 These routines work with font files and directories, including 4020 font directory cache files. 4021 4022FcFileScan 4023 4024Name 4025 4026 FcFileScan -- scan a font file 4027 4028Synopsis 4029 4030#include <fontconfig.h> 4031 4032 FcBool FcFileScan(FcFontSet *set, FcStrSet *dirs, FcFileCache 4033 *cache, FcBlanks *blanks, const FcChar8 *file, FcBool force); 4034 4035Description 4036 4037 Scans a single file and adds all fonts found to set. If force 4038 is FcTrue, then the file is scanned even if associated 4039 information is found in cache. If file is a directory, it is 4040 added to dirs. Whether fonts are found depends on fontconfig 4041 policy as well as the current configuration. Internally, 4042 fontconfig will ignore BDF and PCF fonts which are not in 4043 Unicode (or the effectively equivalent ISO Latin-1) encoding as 4044 those are not usable by Unicode-based applications. The 4045 configuration can ignore fonts based on filename or contents of 4046 the font file itself. Returns FcFalse if any of the fonts 4047 cannot be added (due to allocation failure). Otherwise returns 4048 FcTrue. 4049 4050Version 4051 4052 Fontconfig version 2.6.0 4053 4054FcFileIsDir 4055 4056Name 4057 4058 FcFileIsDir -- check whether a file is a directory 4059 4060Synopsis 4061 4062#include <fontconfig.h> 4063 4064 FcBool FcFileIsDir(const FcChar8 *file); 4065 4066Description 4067 4068 Returns FcTrue if file is a directory, otherwise returns 4069 FcFalse. 4070 4071Version 4072 4073 Fontconfig version 2.6.0 4074 4075FcDirScan 4076 4077Name 4078 4079 FcDirScan -- DEPRECATED: formerly used to scan a font directory 4080 4081Synopsis 4082 4083#include <fontconfig.h> 4084 4085 FcBool FcDirScan(FcFontSet *set, FcStrSet *dirs, FcFileCache 4086 *cache, FcBlanks *blanks, const FcChar8 *dir, FcBool force); 4087 4088Description 4089 4090 This function does nothing aside from returning FcFalse. It 4091 used to scan an entire directory and add all fonts found to 4092 set. If force was FcTrue, then the directory and all files 4093 within it were scanned even if information was present in the 4094 per-directory cache file or cache. Any subdirectories found 4095 were added to dirs. 4096 4097Version 4098 4099 Fontconfig version 2.6.0 4100 4101FcDirSave 4102 4103Name 4104 4105 FcDirSave -- DEPRECATED: formerly used to save a directory 4106 cache 4107 4108Synopsis 4109 4110#include <fontconfig.h> 4111 4112 FcBool FcDirSave(FcFontSet *set, FcStrSet *dirs, const FcChar8 4113 *dir); 4114 4115Description 4116 4117 This function now does nothing aside from returning FcFalse. It 4118 used to creates the per-directory cache file for dir and 4119 populates it with the fonts in set and subdirectories in dirs. 4120 All of this functionality is now automatically managed by 4121 FcDirCacheLoad and FcDirCacheRead. 4122 4123Version 4124 4125 Fontconfig version 2.6.0 4126 4127FcDirCacheUnlink 4128 4129Name 4130 4131 FcDirCacheUnlink -- Remove all caches related to dir 4132 4133Synopsis 4134 4135#include <fontconfig.h> 4136 4137 FcBool FcDirCacheUnlink(const FcChar8 *dir, FcConfig *config); 4138 4139Description 4140 4141 Scans the cache directories in config, removing any instances 4142 of the cache file for dir. Returns FcFalse when some internal 4143 error occurs (out of memory, etc). Errors actually unlinking 4144 any files are ignored. 4145 4146Version 4147 4148 Fontconfig version 2.6.0 4149 4150FcDirCacheValid 4151 4152Name 4153 4154 FcDirCacheValid -- check directory cache 4155 4156Synopsis 4157 4158#include <fontconfig.h> 4159 4160 FcBool FcDirCacheValid(const FcChar8 *dir); 4161 4162Description 4163 4164 Returns FcTrue if dir has an associated valid cache file, else 4165 returns FcFalse 4166 4167Version 4168 4169 Fontconfig version 2.6.0 4170 4171FcDirCacheLoad 4172 4173Name 4174 4175 FcDirCacheLoad -- load a directory cache 4176 4177Synopsis 4178 4179#include <fontconfig.h> 4180 4181 FcCache * FcDirCacheLoad(const FcChar8 *dir, FcConfig *config, 4182 FcChar8 **cache_file); 4183 4184Description 4185 4186 Loads the cache related to dir. If no cache file exists, 4187 returns NULL. The name of the cache file is returned in 4188 cache_file, unless that is NULL. See also FcDirCacheRead. 4189 4190Version 4191 4192 Fontconfig version 2.6.0 4193 4194FcDirCacheRead 4195 4196Name 4197 4198 FcDirCacheRead -- read or construct a directory cache 4199 4200Synopsis 4201 4202#include <fontconfig.h> 4203 4204 FcCache * FcDirCacheRead(const FcChar8 *dir, FcBool force, 4205 FcConfig *config); 4206 4207Description 4208 4209 This returns a cache for dir. If force is FcFalse, then an 4210 existing, valid cache file will be used. Otherwise, a new cache 4211 will be created by scanning the directory and that returned. 4212 4213Version 4214 4215 Fontconfig version 2.6.0 4216 4217FcDirCacheLoadFile 4218 4219Name 4220 4221 FcDirCacheLoadFile -- load a cache file 4222 4223Synopsis 4224 4225#include <fontconfig.h> 4226 4227 FcCache * FcDirCacheLoadFile(const FcChar8 *cache_file, struct 4228 stat *file_stat); 4229 4230Description 4231 4232 This function loads a directory cache from cache_file. If 4233 file_stat is non-NULL, it will be filled with the results of 4234 stat(2) on the cache file. 4235 4236Version 4237 4238 Fontconfig version 2.6.0 4239 4240FcDirCacheUnload 4241 4242Name 4243 4244 FcDirCacheUnload -- unload a cache file 4245 4246Synopsis 4247 4248#include <fontconfig.h> 4249 4250 void FcDirCacheUnload(FcCache *cache); 4251 4252Description 4253 4254 This function dereferences cache. When no other references to 4255 it remain, all memory associated with the cache will be freed. 4256 4257Version 4258 4259 Fontconfig version 2.6.0 4260 __________________________________________________________ 4261 42624.16. FcCache routines 4263 4264 Table of Contents 4265 FcCacheDir -- Return directory of cache 4266 FcCacheCopySet -- Returns a copy of the fontset from cache 4267 FcCacheSubdir -- Return the i'th subdirectory. 4268 FcCacheNumSubdir -- Return the number of subdirectories in 4269 cache. 4270 4271 FcCacheNumFont -- Returns the number of fonts in cache. 4272 4273 These routines work with font directory caches, accessing their 4274 contents in limited ways. It is not expected that normal 4275 applications will need to use these functions. 4276 4277FcCacheDir 4278 4279Name 4280 4281 FcCacheDir -- Return directory of cache 4282 4283Synopsis 4284 4285#include <fontconfig.h> 4286 4287 const FcChar8 * FcCacheDir(const FcCache *cache); 4288 4289Description 4290 4291 This function returns the directory from which the cache was 4292 constructed. 4293 4294Version 4295 4296 Fontconfig version 2.6.0 4297 4298FcCacheCopySet 4299 4300Name 4301 4302 FcCacheCopySet -- Returns a copy of the fontset from cache 4303 4304Synopsis 4305 4306#include <fontconfig.h> 4307 4308 FcFontSet * FcCacheCopySet(const FcCache *cache); 4309 4310Description 4311 4312 The returned fontset contains each of the font patterns from 4313 cache. This fontset may be modified, but the patterns from the 4314 cache are read-only. 4315 4316Version 4317 4318 Fontconfig version 2.6.0 4319 4320FcCacheSubdir 4321 4322Name 4323 4324 FcCacheSubdir -- Return the i'th subdirectory. 4325 4326Synopsis 4327 4328#include <fontconfig.h> 4329 4330 const FcChar8 * FcCacheSubdir(const FcCache *cache, inti); 4331 4332Description 4333 4334 The set of subdirectories stored in a cache file are indexed by 4335 this function, i should range from 0 to n-1, where n is the 4336 return value from FcCacheNumSubdir. 4337 4338Version 4339 4340 Fontconfig version 2.6.0 4341 4342FcCacheNumSubdir 4343 4344Name 4345 4346 FcCacheNumSubdir -- Return the number of subdirectories in 4347 cache. 4348 4349Synopsis 4350 4351#include <fontconfig.h> 4352 4353 int FcCacheNumSubdir(const FcCache *cache); 4354 4355Description 4356 4357 This returns the total number of subdirectories in the cache. 4358 4359Version 4360 4361 Fontconfig version 2.6.0 4362 4363FcCacheNumFont 4364 4365Name 4366 4367 FcCacheNumFont -- Returns the number of fonts in cache. 4368 4369Synopsis 4370 4371#include <fontconfig.h> 4372 4373 int FcCacheNumFont(const FcCache *cache); 4374 4375Description 4376 4377 This returns the number of fonts which would be included in the 4378 return from FcCacheCopySet. 4379 4380Version 4381 4382 Fontconfig version 2.6.0 4383 __________________________________________________________ 4384 43854.17. FcStrSet and FcStrList 4386 4387 Table of Contents 4388 FcStrSetCreate -- create a string set 4389 FcStrSetMember -- check set for membership 4390 FcStrSetEqual -- check sets for equality 4391 FcStrSetAdd -- add to a string set 4392 FcStrSetAddFilename -- add a filename to a string set 4393 FcStrSetDel -- delete from a string set 4394 FcStrSetDestroy -- destroy a string set 4395 FcStrListCreate -- create a string iterator 4396 FcStrListNext -- get next string in iteration 4397 FcStrListDone -- destroy a string iterator 4398 4399 A data structure for enumerating strings, used to list 4400 directories while scanning the configuration as directories are 4401 added while scanning. 4402 4403FcStrSetCreate 4404 4405Name 4406 4407 FcStrSetCreate -- create a string set 4408 4409Synopsis 4410 4411#include <fontconfig.h> 4412 4413 FcStrSet * FcStrSetCreate(void); 4414 4415Description 4416 4417 Create an empty set. 4418 4419Version 4420 4421 Fontconfig version 2.6.0 4422 4423FcStrSetMember 4424 4425Name 4426 4427 FcStrSetMember -- check set for membership 4428 4429Synopsis 4430 4431#include <fontconfig.h> 4432 4433 FcBool FcStrSetMember(FcStrSet *set, const FcChar8 *s); 4434 4435Description 4436 4437 Returns whether s is a member of set. 4438 4439Version 4440 4441 Fontconfig version 2.6.0 4442 4443FcStrSetEqual 4444 4445Name 4446 4447 FcStrSetEqual -- check sets for equality 4448 4449Synopsis 4450 4451#include <fontconfig.h> 4452 4453 FcBool FcStrSetEqual(FcStrSet *set_a, FcStrSet *set_b); 4454 4455Description 4456 4457 Returns whether set_a contains precisely the same strings as 4458 set_b. Ordering of strings within the two sets is not 4459 considered. 4460 4461Version 4462 4463 Fontconfig version 2.6.0 4464 4465FcStrSetAdd 4466 4467Name 4468 4469 FcStrSetAdd -- add to a string set 4470 4471Synopsis 4472 4473#include <fontconfig.h> 4474 4475 FcBool FcStrSetAdd(FcStrSet *set, const FcChar8 *s); 4476 4477Description 4478 4479 Adds a copy of s to set. 4480 4481Version 4482 4483 Fontconfig version 2.6.0 4484 4485FcStrSetAddFilename 4486 4487Name 4488 4489 FcStrSetAddFilename -- add a filename to a string set 4490 4491Synopsis 4492 4493#include <fontconfig.h> 4494 4495 FcBool FcStrSetAddFilename(FcStrSet *set, const FcChar8 *s); 4496 4497Description 4498 4499 Adds a copy s to set, The copy is created with 4500 FcStrCopyFilename so that leading '~' values are replaced with 4501 the value of the HOME environment variable. 4502 4503Version 4504 4505 Fontconfig version 2.6.0 4506 4507FcStrSetDel 4508 4509Name 4510 4511 FcStrSetDel -- delete from a string set 4512 4513Synopsis 4514 4515#include <fontconfig.h> 4516 4517 FcBool FcStrSetDel(FcStrSet *set, const FcChar8 *s); 4518 4519Description 4520 4521 Removes s from set, returning FcTrue if s was a member else 4522 FcFalse. 4523 4524Version 4525 4526 Fontconfig version 2.6.0 4527 4528FcStrSetDestroy 4529 4530Name 4531 4532 FcStrSetDestroy -- destroy a string set 4533 4534Synopsis 4535 4536#include <fontconfig.h> 4537 4538 void FcStrSetDestroy(FcStrSet *set); 4539 4540Description 4541 4542 Destroys set. 4543 4544Version 4545 4546 Fontconfig version 2.6.0 4547 4548FcStrListCreate 4549 4550Name 4551 4552 FcStrListCreate -- create a string iterator 4553 4554Synopsis 4555 4556#include <fontconfig.h> 4557 4558 FcStrList * FcStrListCreate(FcStrSet *set); 4559 4560Description 4561 4562 Creates an iterator to list the strings in set. 4563 4564Version 4565 4566 Fontconfig version 2.6.0 4567 4568FcStrListNext 4569 4570Name 4571 4572 FcStrListNext -- get next string in iteration 4573 4574Synopsis 4575 4576#include <fontconfig.h> 4577 4578 FcChar8 * FcStrListNext(FcStrList *list); 4579 4580Description 4581 4582 Returns the next string in set. 4583 4584Version 4585 4586 Fontconfig version 2.6.0 4587 4588FcStrListDone 4589 4590Name 4591 4592 FcStrListDone -- destroy a string iterator 4593 4594Synopsis 4595 4596#include <fontconfig.h> 4597 4598 void FcStrListDone(FcStrList *list); 4599 4600Description 4601 4602 Destroys the enumerator list. 4603 4604Version 4605 4606 Fontconfig version 2.6.0 4607 __________________________________________________________ 4608 46094.18. String utilities 4610 4611 Table of Contents 4612 FcUtf8ToUcs4 -- convert UTF-8 to UCS4 4613 FcUcs4ToUtf8 -- convert UCS4 to UTF-8 4614 FcUtf8Len -- count UTF-8 encoded chars 4615 FcUtf16ToUcs4 -- convert UTF-16 to UCS4 4616 FcUtf16Len -- count UTF-16 encoded chars 4617 FcIsLower -- check for lower case ASCII character 4618 FcIsUpper -- check for upper case ASCII character 4619 FcToLower -- convert upper case ASCII to lower case 4620 FcStrCopy -- duplicate a string 4621 FcStrDowncase -- create a lower case translation of a string 4622 FcStrCopyFilename -- create a complete path from a filename 4623 FcStrCmp -- compare UTF-8 strings 4624 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case 4625 FcStrStr -- locate UTF-8 substring 4626 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII 4627 case 4628 4629 FcStrPlus -- concatenate two strings 4630 FcStrFree -- free a string 4631 FcStrDirname -- directory part of filename 4632 FcStrBasename -- last component of filename 4633 4634 Fontconfig manipulates many UTF-8 strings represented with the 4635 FcChar8 type. These functions are exposed to help applications 4636 deal with these UTF-8 strings in a locale-insensitive manner. 4637 4638FcUtf8ToUcs4 4639 4640Name 4641 4642 FcUtf8ToUcs4 -- convert UTF-8 to UCS4 4643 4644Synopsis 4645 4646#include <fontconfig.h> 4647 4648 int FcUtf8ToUcs4(FcChar8 *src, FcChar32 *dst, int len); 4649 4650Description 4651 4652 Converts the next Unicode char from src into dst and returns 4653 the number of bytes containing the char. src must be at least 4654 len bytes long. 4655 4656Version 4657 4658 Fontconfig version 2.6.0 4659 4660FcUcs4ToUtf8 4661 4662Name 4663 4664 FcUcs4ToUtf8 -- convert UCS4 to UTF-8 4665 4666Synopsis 4667 4668#include <fontconfig.h> 4669 4670 int FcUcs4ToUtf8(FcChar32 src, FcChar8 dst[FC_UTF8_MAX_LEN]); 4671 4672Description 4673 4674 Converts the Unicode char from src into dst and returns the 4675 number of bytes needed to encode the char. 4676 4677Version 4678 4679 Fontconfig version 2.6.0 4680 4681FcUtf8Len 4682 4683Name 4684 4685 FcUtf8Len -- count UTF-8 encoded chars 4686 4687Synopsis 4688 4689#include <fontconfig.h> 4690 4691 FcBool FcUtf8Len(FcChar8 *src, int len, int *nchar, int 4692 *wchar); 4693 4694Description 4695 4696 Counts the number of Unicode chars in len bytes of src. Places 4697 that count in nchar. wchar contains 1, 2 or 4 depending on the 4698 number of bytes needed to hold the largest unicode char 4699 counted. The return value indicates whether src is a 4700 well-formed UTF8 string. 4701 4702Version 4703 4704 Fontconfig version 2.6.0 4705 4706FcUtf16ToUcs4 4707 4708Name 4709 4710 FcUtf16ToUcs4 -- convert UTF-16 to UCS4 4711 4712Synopsis 4713 4714#include <fontconfig.h> 4715 4716 int FcUtf16ToUcs4(FcChar8 *src, FcEndian endian, FcChar32 *dst, 4717 int len); 4718 4719Description 4720 4721 Converts the next Unicode char from src into dst and returns 4722 the number of bytes containing the char. src must be at least 4723 len bytes long. Bytes of src are combined into 16-bit units 4724 according to endian. 4725 4726Version 4727 4728 Fontconfig version 2.6.0 4729 4730FcUtf16Len 4731 4732Name 4733 4734 FcUtf16Len -- count UTF-16 encoded chars 4735 4736Synopsis 4737 4738#include <fontconfig.h> 4739 4740 FcBool FcUtf16Len(FcChar8 *src, FcEndian endian, int len, int 4741 *nchar, int *wchar); 4742 4743Description 4744 4745 Counts the number of Unicode chars in len bytes of src. Bytes 4746 of src are combined into 16-bit units according to endian. 4747 Places that count in nchar. wchar contains 1, 2 or 4 depending 4748 on the number of bytes needed to hold the largest unicode char 4749 counted. The return value indicates whether string is a 4750 well-formed UTF16 string. 4751 4752Version 4753 4754 Fontconfig version 2.6.0 4755 4756FcIsLower 4757 4758Name 4759 4760 FcIsLower -- check for lower case ASCII character 4761 4762Synopsis 4763 4764#include <fontconfig.h> 4765 4766 FcBool FcIsLower(FcChar8c); 4767 4768Description 4769 4770 This macro checks whether c is an lower case ASCII letter. 4771 4772Version 4773 4774 Fontconfig version 2.6.0 4775 4776FcIsUpper 4777 4778Name 4779 4780 FcIsUpper -- check for upper case ASCII character 4781 4782Synopsis 4783 4784#include <fontconfig.h> 4785 4786 FcBool FcIsUpper(FcChar8c); 4787 4788Description 4789 4790 This macro checks whether c is a upper case ASCII letter. 4791 4792Version 4793 4794 Fontconfig version 2.6.0 4795 4796FcToLower 4797 4798Name 4799 4800 FcToLower -- convert upper case ASCII to lower case 4801 4802Synopsis 4803 4804#include <fontconfig.h> 4805 4806 FcChar8 FcToLower(FcChar8c); 4807 4808Description 4809 4810 This macro converts upper case ASCII c to the equivalent lower 4811 case letter. 4812 4813Version 4814 4815 Fontconfig version 2.6.0 4816 4817FcStrCopy 4818 4819Name 4820 4821 FcStrCopy -- duplicate a string 4822 4823Synopsis 4824 4825#include <fontconfig.h> 4826 4827 FcChar8 * FcStrCopy(const FcChar8 *s); 4828 4829Description 4830 4831 Allocates memory, copies s and returns the resulting buffer. 4832 Yes, this is strdup, but that function isn't available on every 4833 platform. 4834 4835Version 4836 4837 Fontconfig version 2.6.0 4838 4839FcStrDowncase 4840 4841Name 4842 4843 FcStrDowncase -- create a lower case translation of a string 4844 4845Synopsis 4846 4847#include <fontconfig.h> 4848 4849 FcChar8 * FcStrDowncase(const FcChar8 *s); 4850 4851Description 4852 4853 Allocates memory, copies s, converting upper case letters to 4854 lower case and returns the allocated buffer. 4855 4856Version 4857 4858 Fontconfig version 2.6.0 4859 4860FcStrCopyFilename 4861 4862Name 4863 4864 FcStrCopyFilename -- create a complete path from a filename 4865 4866Synopsis 4867 4868#include <fontconfig.h> 4869 4870 FcChar8 * FcStrCopyFilename(const FcChar8 *s); 4871 4872Description 4873 4874 FcStrCopyFilename constructs an absolute pathname from s. It 4875 converts any leading '~' characters in to the value of the HOME 4876 environment variable, and any relative paths are converted to 4877 absolute paths using the current working directory. Sequences 4878 of '/' characters are converted to a single '/', and names 4879 containing the current directory '.' or parent directory '..' 4880 are correctly reconstructed. Returns NULL if '~' is the leading 4881 character and HOME is unset or disabled (see 4882 FcConfigEnableHome). 4883 4884Version 4885 4886 Fontconfig version 2.6.0 4887 4888FcStrCmp 4889 4890Name 4891 4892 FcStrCmp -- compare UTF-8 strings 4893 4894Synopsis 4895 4896#include <fontconfig.h> 4897 4898 int FcStrCmp(const FcChar8 *s1, const FcChar8 *s2); 4899 4900Description 4901 4902 Returns the usual <0, 0, >0 result of comparing s1 and s2. 4903 4904Version 4905 4906 Fontconfig version 2.6.0 4907 4908FcStrCmpIgnoreCase 4909 4910Name 4911 4912 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case 4913 4914Synopsis 4915 4916#include <fontconfig.h> 4917 4918 int FcStrCmpIgnoreCase(const FcChar8 *s1, const FcChar8 *s2); 4919 4920Description 4921 4922 Returns the usual <0, 0, >0 result of comparing s1 and s2. This 4923 test is case-insensitive for all proper UTF-8 encoded strings. 4924 4925Version 4926 4927 Fontconfig version 2.6.0 4928 4929FcStrStr 4930 4931Name 4932 4933 FcStrStr -- locate UTF-8 substring 4934 4935Synopsis 4936 4937#include <fontconfig.h> 4938 4939 FcChar8 * FcStrStr(const FcChar8 *s1, const FcChar8 *s2); 4940 4941Description 4942 4943 Returns the location of s2 in s1. Returns NULL if s2 is not 4944 present in s1. This test will operate properly with UTF8 4945 encoded strings. 4946 4947Version 4948 4949 Fontconfig version 2.6.0 4950 4951FcStrStrIgnoreCase 4952 4953Name 4954 4955 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII 4956 case 4957 4958Synopsis 4959 4960#include <fontconfig.h> 4961 4962 FcChar8 * FcStrStrIgnoreCase(const FcChar8 *s1, const FcChar8 4963 *s2); 4964 4965Description 4966 4967 Returns the location of s2 in s1, ignoring case. Returns NULL 4968 if s2 is not present in s1. This test is case-insensitive for 4969 all proper UTF-8 encoded strings. 4970 4971Version 4972 4973 Fontconfig version 2.6.0 4974 4975FcStrPlus 4976 4977Name 4978 4979 FcStrPlus -- concatenate two strings 4980 4981Synopsis 4982 4983#include <fontconfig.h> 4984 4985 FcChar8 * FcStrPlus(const FcChar8 *s1, const FcChar8 *s2); 4986 4987Description 4988 4989 This function allocates new storage and places the 4990 concatenation of s1 and s2 there, returning the new string. 4991 4992Version 4993 4994 Fontconfig version 2.6.0 4995 4996FcStrFree 4997 4998Name 4999 5000 FcStrFree -- free a string 5001 5002Synopsis 5003 5004#include <fontconfig.h> 5005 5006 void FcStrFree(FcChar8 *s); 5007 5008Description 5009 5010 This is just a wrapper around free(3) which helps track memory 5011 usage of strings within the fontconfig library. 5012 5013Version 5014 5015 Fontconfig version 2.6.0 5016 5017FcStrDirname 5018 5019Name 5020 5021 FcStrDirname -- directory part of filename 5022 5023Synopsis 5024 5025#include <fontconfig.h> 5026 5027 FcChar8 * FcStrDirname(const FcChar8 *file); 5028 5029Description 5030 5031 Returns the directory containing file. This is returned in 5032 newly allocated storage which should be freed when no longer 5033 needed. 5034 5035Version 5036 5037 Fontconfig version 2.6.0 5038 5039FcStrBasename 5040 5041Name 5042 5043 FcStrBasename -- last component of filename 5044 5045Synopsis 5046 5047#include <fontconfig.h> 5048 5049 FcChar8 * FcStrBasename(const FcChar8 *file); 5050 5051Description 5052 5053 Returns the filename of file stripped of any leading directory 5054 names. This is returned in newly allocated storage which should 5055 be freed when no longer needed. 5056 5057Version 5058 5059 Fontconfig version 2.6.0 5060