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