fontconfig-devel.txt revision eceda581
1Fontconfig Developers Reference, Version 2.14.1 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 -- Add a character to 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 -- Add a character to 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 have 3315 indeterminate effects. Returns FcFalse if this operation runs 3316 out of memory. If config is NULL, the current configuration is 3317 used. 3318 3319FcConfigGetConfigDirs 3320 3321Name 3322 3323 FcConfigGetConfigDirs -- Get config directories 3324 3325Synopsis 3326 3327#include <fontconfig/fontconfig.h> 3328 3329 FcStrList * FcConfigGetConfigDirs(FcConfig *config); 3330 3331Description 3332 3333 Returns the list of font directories specified in the 3334 configuration files for config. Does not include any 3335 subdirectories. If config is NULL, the current configuration is 3336 used. 3337 3338FcConfigGetFontDirs 3339 3340Name 3341 3342 FcConfigGetFontDirs -- Get font directories 3343 3344Synopsis 3345 3346#include <fontconfig/fontconfig.h> 3347 3348 FcStrList * FcConfigGetFontDirs(FcConfig *config); 3349 3350Description 3351 3352 Returns the list of font directories in config. This includes 3353 the configured font directories along with any directories 3354 below those in the filesystem. If config is NULL, the current 3355 configuration is used. 3356 3357FcConfigGetConfigFiles 3358 3359Name 3360 3361 FcConfigGetConfigFiles -- Get config files 3362 3363Synopsis 3364 3365#include <fontconfig/fontconfig.h> 3366 3367 FcStrList * FcConfigGetConfigFiles(FcConfig *config); 3368 3369Description 3370 3371 Returns the list of known configuration files used to generate 3372 config. If config is NULL, the current configuration is used. 3373 3374FcConfigGetCache 3375 3376Name 3377 3378 FcConfigGetCache -- DEPRECATED used to return per-user cache 3379 filename 3380 3381Synopsis 3382 3383#include <fontconfig/fontconfig.h> 3384 3385 FcChar8 * FcConfigGetCache(FcConfig *config); 3386 3387Description 3388 3389 With fontconfig no longer using per-user cache files, this 3390 function now simply returns NULL to indicate that no per-user 3391 file exists. 3392 3393FcConfigGetCacheDirs 3394 3395Name 3396 3397 FcConfigGetCacheDirs -- return the list of directories searched 3398 for cache files 3399 3400Synopsis 3401 3402#include <fontconfig/fontconfig.h> 3403 3404 FcStrList * FcConfigGetCacheDirs(const FcConfig *config); 3405 3406Description 3407 3408 FcConfigGetCacheDirs returns a string list containing all of 3409 the directories that fontconfig will search when attempting to 3410 load a cache file for a font directory. If config is NULL, the 3411 current configuration is used. 3412 3413FcConfigGetFonts 3414 3415Name 3416 3417 FcConfigGetFonts -- Get config font set 3418 3419Synopsis 3420 3421#include <fontconfig/fontconfig.h> 3422 3423 FcFontSet * FcConfigGetFonts(FcConfig *config, FcSetName set); 3424 3425Description 3426 3427 Returns one of the two sets of fonts from the configuration as 3428 specified by set. This font set is owned by the library and 3429 must not be modified or freed. If config is NULL, the current 3430 configuration is used. 3431 3432 This function isn't MT-safe. FcConfigReference must be called 3433 before using this and then FcConfigDestroy when the return 3434 value is no longer referenced. 3435 3436FcConfigGetBlanks 3437 3438Name 3439 3440 FcConfigGetBlanks -- Get config blanks 3441 3442Synopsis 3443 3444#include <fontconfig/fontconfig.h> 3445 3446 FcBlanks * FcConfigGetBlanks(FcConfig *config); 3447 3448Description 3449 3450 FcBlanks is deprecated. This function always returns NULL. 3451 3452FcConfigGetRescanInterval 3453 3454Name 3455 3456 FcConfigGetRescanInterval -- Get config rescan interval 3457 3458Synopsis 3459 3460#include <fontconfig/fontconfig.h> 3461 3462 int FcConfigGetRescanInterval(FcConfig *config); 3463 3464Description 3465 3466 Returns the interval between automatic checks of the 3467 configuration (in seconds) specified in config. The 3468 configuration is checked during a call to FcFontList when this 3469 interval has passed since the last check. An interval setting 3470 of zero disables automatic checks. If config is NULL, the 3471 current configuration is used. 3472 3473FcConfigSetRescanInterval 3474 3475Name 3476 3477 FcConfigSetRescanInterval -- Set config rescan interval 3478 3479Synopsis 3480 3481#include <fontconfig/fontconfig.h> 3482 3483 FcBool FcConfigSetRescanInterval(FcConfig *config, int 3484 rescanInterval); 3485 3486Description 3487 3488 Sets the rescan interval. Returns FcFalse if the interval 3489 cannot be set (due to allocation failure). Otherwise returns 3490 FcTrue. An interval setting of zero disables automatic checks. 3491 If config is NULL, the current configuration is used. 3492 3493FcConfigAppFontAddFile 3494 3495Name 3496 3497 FcConfigAppFontAddFile -- Add font file to font database 3498 3499Synopsis 3500 3501#include <fontconfig/fontconfig.h> 3502 3503 FcBool FcConfigAppFontAddFile(FcConfig *config, const FcChar8 3504 *file); 3505 3506Description 3507 3508 Adds an application-specific font to the configuration. Returns 3509 FcFalse if the fonts cannot be added (due to allocation failure 3510 or no fonts found). Otherwise returns FcTrue. If config is 3511 NULL, the current configuration is used. 3512 3513FcConfigAppFontAddDir 3514 3515Name 3516 3517 FcConfigAppFontAddDir -- Add fonts from directory to font 3518 database 3519 3520Synopsis 3521 3522#include <fontconfig/fontconfig.h> 3523 3524 FcBool FcConfigAppFontAddDir(FcConfig *config, const FcChar8 3525 *dir); 3526 3527Description 3528 3529 Scans the specified directory for fonts, adding each one found 3530 to the application-specific set of fonts. Returns FcFalse if 3531 the fonts cannot be added (due to allocation failure). 3532 Otherwise returns FcTrue. If config is NULL, the current 3533 configuration is used. 3534 3535FcConfigAppFontClear 3536 3537Name 3538 3539 FcConfigAppFontClear -- Remove all app fonts from font database 3540 3541Synopsis 3542 3543#include <fontconfig/fontconfig.h> 3544 3545 void FcConfigAppFontClear(FcConfig *config); 3546 3547Description 3548 3549 Clears the set of application-specific fonts. If config is 3550 NULL, the current configuration is used. 3551 3552FcConfigSubstituteWithPat 3553 3554Name 3555 3556 FcConfigSubstituteWithPat -- Execute substitutions 3557 3558Synopsis 3559 3560#include <fontconfig/fontconfig.h> 3561 3562 FcBool FcConfigSubstituteWithPat(FcConfig *config, FcPattern 3563 *p, FcPattern *p_pat, FcMatchKind kind); 3564 3565Description 3566 3567 Performs the sequence of pattern modification operations, if 3568 kind is FcMatchPattern, then those tagged as pattern operations 3569 are applied, else if kind is FcMatchFont, those tagged as font 3570 operations are applied and p_pat is used for <test> elements 3571 with target=pattern. Returns FcFalse if the substitution cannot 3572 be performed (due to allocation failure). Otherwise returns 3573 FcTrue. If config is NULL, the current configuration is used. 3574 3575FcConfigSubstitute 3576 3577Name 3578 3579 FcConfigSubstitute -- Execute substitutions 3580 3581Synopsis 3582 3583#include <fontconfig/fontconfig.h> 3584 3585 FcBool FcConfigSubstitute(FcConfig *config, FcPattern *p, 3586 FcMatchKind kind); 3587 3588Description 3589 3590 Calls FcConfigSubstituteWithPat setting p_pat to NULL. Returns 3591 FcFalse if the substitution cannot be performed (due to 3592 allocation failure). Otherwise returns FcTrue. If config is 3593 NULL, the current configuration is used. 3594 3595FcFontMatch 3596 3597Name 3598 3599 FcFontMatch -- Return best font 3600 3601Synopsis 3602 3603#include <fontconfig/fontconfig.h> 3604 3605 FcPattern * FcFontMatch(FcConfig *config, FcPattern *p, 3606 FcResult *result); 3607 3608Description 3609 3610 Finds the font in sets most closely matching pattern and 3611 returns the result of FcFontRenderPrepare for that font and the 3612 provided pattern. This function should be called only after 3613 FcConfigSubstitute and FcDefaultSubstitute have been called for 3614 p; otherwise the results will not be correct. If config is 3615 NULL, the current configuration is used. 3616 3617FcFontSort 3618 3619Name 3620 3621 FcFontSort -- Return list of matching fonts 3622 3623Synopsis 3624 3625#include <fontconfig/fontconfig.h> 3626 3627 FcFontSet * FcFontSort(FcConfig *config, FcPattern *p, FcBool 3628 trim, FcCharSet **csp, FcResult *result); 3629 3630Description 3631 3632 Returns the list of fonts sorted by closeness to p. If trim is 3633 FcTrue, elements in the list which don't include Unicode 3634 coverage not provided by earlier elements in the list are 3635 elided. The union of Unicode coverage of all of the fonts is 3636 returned in csp, if csp is not NULL. This function should be 3637 called only after FcConfigSubstitute and FcDefaultSubstitute 3638 have been called for p; otherwise the results will not be 3639 correct. 3640 3641 The returned FcFontSet references FcPattern structures which 3642 may be shared by the return value from multiple FcFontSort 3643 calls, applications must not modify these patterns. Instead, 3644 they should be passed, along with p to FcFontRenderPrepare 3645 which combines them into a complete pattern. 3646 3647 The FcFontSet returned by FcFontSort is destroyed by calling 3648 FcFontSetDestroy. If config is NULL, the current configuration 3649 is used. 3650 3651FcFontRenderPrepare 3652 3653Name 3654 3655 FcFontRenderPrepare -- Prepare pattern for loading font file 3656 3657Synopsis 3658 3659#include <fontconfig/fontconfig.h> 3660 3661 FcPattern * FcFontRenderPrepare(FcConfig *config, FcPattern 3662 *pat, FcPattern *font); 3663 3664Description 3665 3666 Creates a new pattern consisting of elements of font not 3667 appearing in pat, elements of pat not appearing in font and the 3668 best matching value from pat for elements appearing in both. 3669 The result is passed to FcConfigSubstituteWithPat with kind 3670 FcMatchFont and then returned. 3671 3672FcFontList 3673 3674Name 3675 3676 FcFontList -- List fonts 3677 3678Synopsis 3679 3680#include <fontconfig/fontconfig.h> 3681 3682 FcFontSet * FcFontList(FcConfig *config, FcPattern *p, 3683 FcObjectSet *os); 3684 3685Description 3686 3687 Selects fonts matching p, creates patterns from those fonts 3688 containing only the objects in os and returns the set of unique 3689 such patterns. If config is NULL, the default configuration is 3690 checked to be up to date, and used. 3691 3692FcConfigFilename 3693 3694Name 3695 3696 FcConfigFilename -- Find a config file 3697 3698Synopsis 3699 3700#include <fontconfig/fontconfig.h> 3701 3702 FcChar8 * FcConfigFilename(const FcChar8 *name); 3703 3704Description 3705 3706 This function is deprecated and is replaced by 3707 FcConfigGetFilename. 3708 3709FcConfigGetFilename 3710 3711Name 3712 3713 FcConfigGetFilename -- Find a config file 3714 3715Synopsis 3716 3717#include <fontconfig/fontconfig.h> 3718 3719 FcChar8 * FcConfigGetFilename(FcConfig *config, const FcChar8 3720 *name); 3721 3722Description 3723 3724 Given the specified external entity name, return the associated 3725 filename. This provides applications a way to convert various 3726 configuration file references into filename form. 3727 3728 A null or empty name indicates that the default configuration 3729 file should be used; which file this references can be 3730 overridden with the FONTCONFIG_FILE environment variable. Next, 3731 if the name starts with ~, it refers to a file in the current 3732 users home directory. Otherwise if the name doesn't start with 3733 '/', it refers to a file in the default configuration 3734 directory; the built-in default directory can be overridden 3735 with the FONTCONFIG_PATH environment variable. 3736 3737 The result of this function is affected by the 3738 FONTCONFIG_SYSROOT environment variable or equivalent 3739 functionality. 3740 3741FcConfigParseAndLoad 3742 3743Name 3744 3745 FcConfigParseAndLoad -- load a configuration file 3746 3747Synopsis 3748 3749#include <fontconfig/fontconfig.h> 3750 3751 FcBool FcConfigParseAndLoad(FcConfig *config, const FcChar8 3752 *file, FcBool complain); 3753 3754Description 3755 3756 Walks the configuration in 'file' and constructs the internal 3757 representation in 'config'. Any include files referenced from 3758 within 'file' will be loaded and parsed. If 'complain' is 3759 FcFalse, no warning will be displayed if 'file' does not exist. 3760 Error and warning messages will be output to stderr. Returns 3761 FcFalse if some error occurred while loading the file, either a 3762 parse error, semantic error or allocation failure. Otherwise 3763 returns FcTrue. 3764 3765FcConfigParseAndLoadFromMemory 3766 3767Name 3768 3769 FcConfigParseAndLoadFromMemory -- load a configuration from 3770 memory 3771 3772Synopsis 3773 3774#include <fontconfig/fontconfig.h> 3775 3776 FcBool FcConfigParseAndLoadFromMemory(FcConfig *config, const 3777 FcChar8 *buffer, FcBool complain); 3778 3779Description 3780 3781 Walks the configuration in 'memory' and constructs the internal 3782 representation in 'config'. Any includes files referenced from 3783 within 'memory' will be loaded and dparsed. If 'complain' is 3784 FcFalse, no warning will be displayed if 'file' does not exist. 3785 Error and warning messages will be output to stderr. Returns 3786 FcFalse if fsome error occurred while loading the file, either 3787 a parse error, semantic error or allocation failure. Otherwise 3788 returns FcTrue. 3789 3790Since 3791 3792 version 2.12.5 3793 3794FcConfigGetSysRoot 3795 3796Name 3797 3798 FcConfigGetSysRoot -- Obtain the system root directory 3799 3800Synopsis 3801 3802#include <fontconfig/fontconfig.h> 3803 3804 const FcChar8 * FcConfigGetSysRoot(const FcConfig *config); 3805 3806Description 3807 3808 Obtains the system root directory in 'config' if available. All 3809 files (including file properties in patterns) obtained from 3810 this 'config' are relative to this system root directory. 3811 3812 This function isn't MT-safe. FcConfigReference must be called 3813 before using this and then FcConfigDestroy when the return 3814 value is no longer referenced. 3815 3816Since 3817 3818 version 2.10.92 3819 3820FcConfigSetSysRoot 3821 3822Name 3823 3824 FcConfigSetSysRoot -- Set the system root directory 3825 3826Synopsis 3827 3828#include <fontconfig/fontconfig.h> 3829 3830 void FcConfigSetSysRoot(FcConfig *config, const FcChar8 3831 *sysroot); 3832 3833Description 3834 3835 Set 'sysroot' as the system root directory. All file paths used 3836 or created with this 'config' (including file properties in 3837 patterns) will be considered or made relative to this 3838 'sysroot'. This allows a host to generate caches for targets at 3839 build time. This also allows a cache to be re-targeted to a 3840 different base directory if 'FcConfigGetSysRoot' is used to 3841 resolve file paths. When setting this on the current config 3842 this causes changing current config (calls 3843 FcConfigSetCurrent()). 3844 3845Since 3846 3847 version 2.10.92 3848 3849FcConfigFileInfoIterInit 3850 3851Name 3852 3853 FcConfigFileInfoIterInit -- Initialize the iterator 3854 3855Synopsis 3856 3857#include <fontconfig/fontconfig.h> 3858 3859 void FcConfigFileInfoIterInit(FcConfig *config, 3860 FcConfigFileInfoIter *iter); 3861 3862Description 3863 3864 Initialize 'iter' with the first iterator in the config file 3865 information list. 3866 3867 The config file information list is stored in numerical order 3868 for filenames i.e. how fontconfig actually read them. 3869 3870 This function isn't MT-safe. FcConfigReference must be called 3871 before using this and then FcConfigDestroy when the relevant 3872 values are no longer referenced. 3873 3874Since 3875 3876 version 2.12.91 3877 3878FcConfigFileInfoIterNext 3879 3880Name 3881 3882 FcConfigFileInfoIterNext -- Set the iterator to point to the 3883 next list 3884 3885Synopsis 3886 3887#include <fontconfig/fontconfig.h> 3888 3889 FcBool FcConfigFileInfoIterNext(FcConfig *config, 3890 FcConfigFileInfoIter *iter); 3891 3892Description 3893 3894 Set 'iter' to point to the next node in the config file 3895 information list. If there is no next node, FcFalse is 3896 returned. 3897 3898 This function isn't MT-safe. FcConfigReference must be called 3899 before using FcConfigFileInfoIterInit and then FcConfigDestroy 3900 when the relevant values are no longer referenced. 3901 3902Since 3903 3904 version 2.12.91 3905 3906FcConfigFileInfoIterGet 3907 3908Name 3909 3910 FcConfigFileInfoIterGet -- Obtain the configuration file 3911 information 3912 3913Synopsis 3914 3915#include <fontconfig/fontconfig.h> 3916 3917 FcBool FcConfigFileInfoIterGet(FcConfig *config, 3918 FcConfigFileInfoIter *iter, FcChar8 **name, FcChar8 3919 **description, FcBool *enabled); 3920 3921Description 3922 3923 Obtain the filename, the description and the flag whether it is 3924 enabled or not for 'iter' where points to current configuration 3925 file information. If the iterator is invalid, FcFalse is 3926 returned. 3927 3928 This function isn't MT-safe. FcConfigReference must be called 3929 before using FcConfigFileInfoIterInit and then FcConfigDestroy 3930 when the relevant values are no longer referenced. 3931 3932Since 3933 3934 version 2.12.91 3935 __________________________________________________________ 3936 3937FcObjectType 3938 3939 Table of Contents 3940 FcNameRegisterObjectTypes -- Register object types 3941 FcNameUnregisterObjectTypes -- Unregister object types 3942 FcNameGetObjectType -- Lookup an object type 3943 3944 Provides for application-specified font name object types so 3945 that new pattern elements can be generated from font names. 3946 3947FcNameRegisterObjectTypes 3948 3949Name 3950 3951 FcNameRegisterObjectTypes -- Register object types 3952 3953Synopsis 3954 3955#include <fontconfig/fontconfig.h> 3956 3957 FcBool FcNameRegisterObjectTypes(const FcObjectType *types, int 3958 ntype); 3959 3960Description 3961 3962 Deprecated. Does nothing. Returns FcFalse. 3963 3964FcNameUnregisterObjectTypes 3965 3966Name 3967 3968 FcNameUnregisterObjectTypes -- Unregister object types 3969 3970Synopsis 3971 3972#include <fontconfig/fontconfig.h> 3973 3974 FcBool FcNameUnregisterObjectTypes(const FcObjectType *types, 3975 int ntype); 3976 3977Description 3978 3979 Deprecated. Does nothing. Returns FcFalse. 3980 3981FcNameGetObjectType 3982 3983Name 3984 3985 FcNameGetObjectType -- Lookup an object type 3986 3987Synopsis 3988 3989#include <fontconfig/fontconfig.h> 3990 3991 const FcObjectType * FcNameGetObjectType(const char *object); 3992 3993Description 3994 3995 Return the object type for the pattern element named object. 3996 __________________________________________________________ 3997 3998FcConstant 3999 4000 Table of Contents 4001 FcNameRegisterConstants -- Register symbolic constants 4002 FcNameUnregisterConstants -- Unregister symbolic constants 4003 FcNameGetConstant -- Lookup symbolic constant 4004 FcNameConstant -- Get the value for a symbolic constant 4005 4006 Provides for application-specified symbolic constants for font 4007 names. 4008 4009FcNameRegisterConstants 4010 4011Name 4012 4013 FcNameRegisterConstants -- Register symbolic constants 4014 4015Synopsis 4016 4017#include <fontconfig/fontconfig.h> 4018 4019 FcBool FcNameRegisterConstants(const FcConstant *consts, int 4020 nconsts); 4021 4022Description 4023 4024 Deprecated. Does nothing. Returns FcFalse. 4025 4026FcNameUnregisterConstants 4027 4028Name 4029 4030 FcNameUnregisterConstants -- Unregister symbolic constants 4031 4032Synopsis 4033 4034#include <fontconfig/fontconfig.h> 4035 4036 FcBool FcNameUnregisterConstants(const FcConstant *consts, int 4037 nconsts); 4038 4039Description 4040 4041 Deprecated. Does nothing. Returns FcFalse. 4042 4043FcNameGetConstant 4044 4045Name 4046 4047 FcNameGetConstant -- Lookup symbolic constant 4048 4049Synopsis 4050 4051#include <fontconfig/fontconfig.h> 4052 4053 const FcConstant * FcNameGetConstant(FcChar8 *string); 4054 4055Description 4056 4057 Return the FcConstant structure related to symbolic constant 4058 string. 4059 4060FcNameConstant 4061 4062Name 4063 4064 FcNameConstant -- Get the value for a symbolic constant 4065 4066Synopsis 4067 4068#include <fontconfig/fontconfig.h> 4069 4070 FcBool FcNameConstant(FcChar8 *string, int *result); 4071 4072Description 4073 4074 Returns whether a symbolic constant with name string is 4075 registered, placing the value of the constant in result if 4076 present. 4077 __________________________________________________________ 4078 4079FcWeight 4080 4081 Table of Contents 4082 FcWeightFromOpenTypeDouble -- Convert from OpenType weight 4083 values to fontconfig ones 4084 4085 FcWeightToOpenTypeDouble -- Convert from fontconfig weight 4086 values to OpenType ones 4087 4088 FcWeightFromOpenType -- Convert from OpenType weight values to 4089 fontconfig ones 4090 4091 FcWeightToOpenType -- Convert from fontconfig weight values to 4092 OpenType ones 4093 4094 Maps weights to and from OpenType weights. 4095 4096FcWeightFromOpenTypeDouble 4097 4098Name 4099 4100 FcWeightFromOpenTypeDouble -- Convert from OpenType weight 4101 values to fontconfig ones 4102 4103Synopsis 4104 4105#include <fontconfig/fontconfig.h> 4106 4107 double FcWeightFromOpenTypeDouble(doubleot_weight); 4108 4109Description 4110 4111 FcWeightFromOpenTypeDouble returns an double value to use with 4112 FC_WEIGHT, from an double in the 1..1000 range, resembling the 4113 numbers from OpenType specification's OS/2 usWeight numbers, 4114 which are also similar to CSS font-weight numbers. If input is 4115 negative, zero, or greater than 1000, returns -1. This function 4116 linearly interpolates between various FC_WEIGHT_* constants. As 4117 such, the returned value does not necessarily match any of the 4118 predefined constants. 4119 4120Since 4121 4122 version 2.12.92 4123 4124FcWeightToOpenTypeDouble 4125 4126Name 4127 4128 FcWeightToOpenTypeDouble -- Convert from fontconfig weight 4129 values to OpenType ones 4130 4131Synopsis 4132 4133#include <fontconfig/fontconfig.h> 4134 4135 double FcWeightToOpenTypeDouble(doubleot_weight); 4136 4137Description 4138 4139 FcWeightToOpenTypeDouble is the inverse of 4140 FcWeightFromOpenType. If the input is less than FC_WEIGHT_THIN 4141 or greater than FC_WEIGHT_EXTRABLACK, returns -1. Otherwise 4142 returns a number in the range 1 to 1000. 4143 4144Since 4145 4146 version 2.12.92 4147 4148FcWeightFromOpenType 4149 4150Name 4151 4152 FcWeightFromOpenType -- Convert from OpenType weight values to 4153 fontconfig ones 4154 4155Synopsis 4156 4157#include <fontconfig/fontconfig.h> 4158 4159 int FcWeightFromOpenType(intot_weight); 4160 4161Description 4162 4163 FcWeightFromOpenType is like FcWeightFromOpenTypeDouble but 4164 with integer arguments. Use the other function instead. 4165 4166Since 4167 4168 version 2.11.91 4169 4170FcWeightToOpenType 4171 4172Name 4173 4174 FcWeightToOpenType -- Convert from fontconfig weight values to 4175 OpenType ones 4176 4177Synopsis 4178 4179#include <fontconfig/fontconfig.h> 4180 4181 int FcWeightToOpenType(intot_weight); 4182 4183Description 4184 4185 FcWeightToOpenType is like FcWeightToOpenTypeDouble but with 4186 integer arguments. Use the other function instead. 4187 4188Since 4189 4190 version 2.11.91 4191 __________________________________________________________ 4192 4193FcBlanks 4194 4195 Table of Contents 4196 FcBlanksCreate -- Create an FcBlanks 4197 FcBlanksDestroy -- Destroy and FcBlanks 4198 FcBlanksAdd -- Add a character to an FcBlanks 4199 FcBlanksIsMember -- Query membership in an FcBlanks 4200 4201 An FcBlanks object holds a list of Unicode chars which are 4202 expected to be blank when drawn. When scanning new fonts, any 4203 glyphs which are empty and not in this list will be assumed to 4204 be broken and not placed in the FcCharSet associated with the 4205 font. This provides a significantly more accurate CharSet for 4206 applications. 4207 4208 FcBlanks is deprecated and should not be used in newly written 4209 code. It is still accepted by some functions for compatibility 4210 with older code but will be removed in the future. 4211 4212FcBlanksCreate 4213 4214Name 4215 4216 FcBlanksCreate -- Create an FcBlanks 4217 4218Synopsis 4219 4220#include <fontconfig/fontconfig.h> 4221 4222 FcBlanks * FcBlanksCreate(void); 4223 4224Description 4225 4226 FcBlanks is deprecated. This function always returns NULL. 4227 4228FcBlanksDestroy 4229 4230Name 4231 4232 FcBlanksDestroy -- Destroy and FcBlanks 4233 4234Synopsis 4235 4236#include <fontconfig/fontconfig.h> 4237 4238 void FcBlanksDestroy(FcBlanks *b); 4239 4240Description 4241 4242 FcBlanks is deprecated. This function does nothing. 4243 4244FcBlanksAdd 4245 4246Name 4247 4248 FcBlanksAdd -- Add a character to an FcBlanks 4249 4250Synopsis 4251 4252#include <fontconfig/fontconfig.h> 4253 4254 FcBool FcBlanksAdd(FcBlanks *b, FcChar32 ucs4); 4255 4256Description 4257 4258 FcBlanks is deprecated. This function always returns FALSE. 4259 4260FcBlanksIsMember 4261 4262Name 4263 4264 FcBlanksIsMember -- Query membership in an FcBlanks 4265 4266Synopsis 4267 4268#include <fontconfig/fontconfig.h> 4269 4270 FcBool FcBlanksIsMember(FcBlanks *b, FcChar32 ucs4); 4271 4272Description 4273 4274 FcBlanks is deprecated. This function always returns FALSE. 4275 __________________________________________________________ 4276 4277FcAtomic 4278 4279 Table of Contents 4280 FcAtomicCreate -- create an FcAtomic object 4281 FcAtomicLock -- lock a file 4282 FcAtomicNewFile -- return new temporary file name 4283 FcAtomicOrigFile -- return original file name 4284 FcAtomicReplaceOrig -- replace original with new 4285 FcAtomicDeleteNew -- delete new file 4286 FcAtomicUnlock -- unlock a file 4287 FcAtomicDestroy -- destroy an FcAtomic object 4288 4289 These functions provide a safe way to update configuration 4290 files, allowing ongoing reading of the old configuration file 4291 while locked for writing and ensuring that a consistent and 4292 complete version of the configuration file is always available. 4293 4294FcAtomicCreate 4295 4296Name 4297 4298 FcAtomicCreate -- create an FcAtomic object 4299 4300Synopsis 4301 4302#include <fontconfig/fontconfig.h> 4303 4304 FcAtomic * FcAtomicCreate(const FcChar8 *file); 4305 4306Description 4307 4308 Creates a data structure containing data needed to control 4309 access to file. Writing is done to a separate file. Once that 4310 file is complete, the original configuration file is atomically 4311 replaced so that reading process always see a consistent and 4312 complete file without the need to lock for reading. 4313 4314FcAtomicLock 4315 4316Name 4317 4318 FcAtomicLock -- lock a file 4319 4320Synopsis 4321 4322#include <fontconfig/fontconfig.h> 4323 4324 FcBool FcAtomicLock(FcAtomic *atomic); 4325 4326Description 4327 4328 Attempts to lock the file referenced by atomic. Returns FcFalse 4329 if the file is already locked, else returns FcTrue and leaves 4330 the file locked. 4331 4332FcAtomicNewFile 4333 4334Name 4335 4336 FcAtomicNewFile -- return new temporary file name 4337 4338Synopsis 4339 4340#include <fontconfig/fontconfig.h> 4341 4342 FcChar8 * FcAtomicNewFile(FcAtomic *atomic); 4343 4344Description 4345 4346 Returns the filename for writing a new version of the file 4347 referenced by atomic. 4348 4349FcAtomicOrigFile 4350 4351Name 4352 4353 FcAtomicOrigFile -- return original file name 4354 4355Synopsis 4356 4357#include <fontconfig/fontconfig.h> 4358 4359 FcChar8 * FcAtomicOrigFile(FcAtomic *atomic); 4360 4361Description 4362 4363 Returns the file referenced by atomic. 4364 4365FcAtomicReplaceOrig 4366 4367Name 4368 4369 FcAtomicReplaceOrig -- replace original with new 4370 4371Synopsis 4372 4373#include <fontconfig/fontconfig.h> 4374 4375 FcBool FcAtomicReplaceOrig(FcAtomic *atomic); 4376 4377Description 4378 4379 Replaces the original file referenced by atomic with the new 4380 file. Returns FcFalse if the file cannot be replaced due to 4381 permission issues in the filesystem. Otherwise returns FcTrue. 4382 4383FcAtomicDeleteNew 4384 4385Name 4386 4387 FcAtomicDeleteNew -- delete new file 4388 4389Synopsis 4390 4391#include <fontconfig/fontconfig.h> 4392 4393 void FcAtomicDeleteNew(FcAtomic *atomic); 4394 4395Description 4396 4397 Deletes the new file. Used in error recovery to back out 4398 changes. 4399 4400FcAtomicUnlock 4401 4402Name 4403 4404 FcAtomicUnlock -- unlock a file 4405 4406Synopsis 4407 4408#include <fontconfig/fontconfig.h> 4409 4410 void FcAtomicUnlock(FcAtomic *atomic); 4411 4412Description 4413 4414 Unlocks the file. 4415 4416FcAtomicDestroy 4417 4418Name 4419 4420 FcAtomicDestroy -- destroy an FcAtomic object 4421 4422Synopsis 4423 4424#include <fontconfig/fontconfig.h> 4425 4426 void FcAtomicDestroy(FcAtomic *atomic); 4427 4428Description 4429 4430 Destroys atomic. 4431 __________________________________________________________ 4432 4433File and Directory routines 4434 4435 Table of Contents 4436 FcFileScan -- scan a font file 4437 FcFileIsDir -- check whether a file is a directory 4438 FcDirScan -- scan a font directory without caching it 4439 FcDirSave -- DEPRECATED: formerly used to save a directory 4440 cache 4441 4442 FcDirCacheUnlink -- Remove all caches related to dir 4443 FcDirCacheValid -- check directory cache 4444 FcDirCacheLoad -- load a directory cache 4445 FcDirCacheRescan -- Re-scan a directory cache 4446 FcDirCacheRead -- read or construct a directory cache 4447 FcDirCacheLoadFile -- load a cache file 4448 FcDirCacheUnload -- unload a cache file 4449 4450 These routines work with font files and directories, including 4451 font directory cache files. 4452 4453FcFileScan 4454 4455Name 4456 4457 FcFileScan -- scan a font file 4458 4459Synopsis 4460 4461#include <fontconfig/fontconfig.h> 4462 4463 FcBool FcFileScan(FcFontSet *set, FcStrSet *dirs, FcFileCache 4464 *cache, FcBlanks *blanks, const FcChar8 *file, FcBool force); 4465 4466Description 4467 4468 Scans a single file and adds all fonts found to set. If force 4469 is FcTrue, then the file is scanned even if associated 4470 information is found in cache. If file is a directory, it is 4471 added to dirs. Whether fonts are found depends on fontconfig 4472 policy as well as the current configuration. Internally, 4473 fontconfig will ignore BDF and PCF fonts which are not in 4474 Unicode (or the effectively equivalent ISO Latin-1) encoding as 4475 those are not usable by Unicode-based applications. The 4476 configuration can ignore fonts based on filename or contents of 4477 the font file itself. Returns FcFalse if any of the fonts 4478 cannot be added (due to allocation failure). Otherwise returns 4479 FcTrue. 4480 4481FcFileIsDir 4482 4483Name 4484 4485 FcFileIsDir -- check whether a file is a directory 4486 4487Synopsis 4488 4489#include <fontconfig/fontconfig.h> 4490 4491 FcBool FcFileIsDir(const FcChar8 *file); 4492 4493Description 4494 4495 Returns FcTrue if file is a directory, otherwise returns 4496 FcFalse. 4497 4498FcDirScan 4499 4500Name 4501 4502 FcDirScan -- scan a font directory without caching it 4503 4504Synopsis 4505 4506#include <fontconfig/fontconfig.h> 4507 4508 FcBool FcDirScan(FcFontSet *set, FcStrSet *dirs, FcFileCache 4509 *cache, FcBlanks *blanks, const FcChar8 *dir, FcBool force); 4510 4511Description 4512 4513 If cache is not zero or if force is FcFalse, this function 4514 currently returns FcFalse. Otherwise, it scans an entire 4515 directory and adds all fonts found to set. Any subdirectories 4516 found are added to dirs. Calling this function does not create 4517 any cache files. Use FcDirCacheRead() if caching is desired. 4518 4519FcDirSave 4520 4521Name 4522 4523 FcDirSave -- DEPRECATED: formerly used to save a directory 4524 cache 4525 4526Synopsis 4527 4528#include <fontconfig/fontconfig.h> 4529 4530 FcBool FcDirSave(FcFontSet *set, FcStrSet *dirs, const FcChar8 4531 *dir); 4532 4533Description 4534 4535 This function now does nothing aside from returning FcFalse. It 4536 used to creates the per-directory cache file for dir and 4537 populates it with the fonts in set and subdirectories in dirs. 4538 All of this functionality is now automatically managed by 4539 FcDirCacheLoad and FcDirCacheRead. 4540 4541FcDirCacheUnlink 4542 4543Name 4544 4545 FcDirCacheUnlink -- Remove all caches related to dir 4546 4547Synopsis 4548 4549#include <fontconfig/fontconfig.h> 4550 4551 FcBool FcDirCacheUnlink(const FcChar8 *dir, FcConfig *config); 4552 4553Description 4554 4555 Scans the cache directories in config, removing any instances 4556 of the cache file for dir. Returns FcFalse when some internal 4557 error occurs (out of memory, etc). Errors actually unlinking 4558 any files are ignored. 4559 4560FcDirCacheValid 4561 4562Name 4563 4564 FcDirCacheValid -- check directory cache 4565 4566Synopsis 4567 4568#include <fontconfig/fontconfig.h> 4569 4570 FcBool FcDirCacheValid(const FcChar8 *dir); 4571 4572Description 4573 4574 Returns FcTrue if dir has an associated valid cache file, else 4575 returns FcFalse 4576 4577FcDirCacheLoad 4578 4579Name 4580 4581 FcDirCacheLoad -- load a directory cache 4582 4583Synopsis 4584 4585#include <fontconfig/fontconfig.h> 4586 4587 FcCache * FcDirCacheLoad(const FcChar8 *dir, FcConfig *config, 4588 FcChar8 **cache_file); 4589 4590Description 4591 4592 Loads the cache related to dir. If no cache file exists, 4593 returns NULL. The name of the cache file is returned in 4594 cache_file, unless that is NULL. See also FcDirCacheRead. 4595 4596FcDirCacheRescan 4597 4598Name 4599 4600 FcDirCacheRescan -- Re-scan a directory cache 4601 4602Synopsis 4603 4604#include <fontconfig/fontconfig.h> 4605 4606 FcCache * FcDirCacheRescan(const FcChar8 *dir, FcConfig 4607 *config); 4608 4609Description 4610 4611 Re-scan directories only at dir and update the cache. returns 4612 NULL if failed. 4613 4614Since 4615 4616 version 2.11.1 4617 4618FcDirCacheRead 4619 4620Name 4621 4622 FcDirCacheRead -- read or construct a directory cache 4623 4624Synopsis 4625 4626#include <fontconfig/fontconfig.h> 4627 4628 FcCache * FcDirCacheRead(const FcChar8 *dir, FcBool force, 4629 FcConfig *config); 4630 4631Description 4632 4633 This returns a cache for dir. If force is FcFalse, then an 4634 existing, valid cache file will be used. Otherwise, a new cache 4635 will be created by scanning the directory and that returned. 4636 4637FcDirCacheLoadFile 4638 4639Name 4640 4641 FcDirCacheLoadFile -- load a cache file 4642 4643Synopsis 4644 4645#include <fontconfig/fontconfig.h> 4646 4647 FcCache * FcDirCacheLoadFile(const FcChar8 *cache_file, struct 4648 stat *file_stat); 4649 4650Description 4651 4652 This function loads a directory cache from cache_file. If 4653 file_stat is non-NULL, it will be filled with the results of 4654 stat(2) on the cache file. 4655 4656FcDirCacheUnload 4657 4658Name 4659 4660 FcDirCacheUnload -- unload a cache file 4661 4662Synopsis 4663 4664#include <fontconfig/fontconfig.h> 4665 4666 void FcDirCacheUnload(FcCache *cache); 4667 4668Description 4669 4670 This function dereferences cache. When no other references to 4671 it remain, all memory associated with the cache will be freed. 4672 __________________________________________________________ 4673 4674FcCache routines 4675 4676 Table of Contents 4677 FcCacheDir -- Return directory of cache 4678 FcCacheCopySet -- Returns a copy of the fontset from cache 4679 FcCacheSubdir -- Return the i'th subdirectory. 4680 FcCacheNumSubdir -- Return the number of subdirectories in 4681 cache. 4682 4683 FcCacheNumFont -- Returns the number of fonts in cache. 4684 FcDirCacheClean -- Clean up a cache directory 4685 FcCacheCreateTagFile -- Create CACHEDIR.TAG at cache directory. 4686 FcDirCacheCreateUUID -- Create .uuid file at a directory 4687 FcDirCacheDeleteUUID -- Delete .uuid file 4688 4689 These routines work with font directory caches, accessing their 4690 contents in limited ways. It is not expected that normal 4691 applications will need to use these functions. 4692 4693FcCacheDir 4694 4695Name 4696 4697 FcCacheDir -- Return directory of cache 4698 4699Synopsis 4700 4701#include <fontconfig/fontconfig.h> 4702 4703 const FcChar8 * FcCacheDir(const FcCache *cache); 4704 4705Description 4706 4707 This function returns the directory from which the cache was 4708 constructed. 4709 4710FcCacheCopySet 4711 4712Name 4713 4714 FcCacheCopySet -- Returns a copy of the fontset from cache 4715 4716Synopsis 4717 4718#include <fontconfig/fontconfig.h> 4719 4720 FcFontSet * FcCacheCopySet(const FcCache *cache); 4721 4722Description 4723 4724 The returned fontset contains each of the font patterns from 4725 cache. This fontset may be modified, but the patterns from the 4726 cache are read-only. 4727 4728FcCacheSubdir 4729 4730Name 4731 4732 FcCacheSubdir -- Return the i'th subdirectory. 4733 4734Synopsis 4735 4736#include <fontconfig/fontconfig.h> 4737 4738 const FcChar8 * FcCacheSubdir(const FcCache *cache, inti); 4739 4740Description 4741 4742 The set of subdirectories stored in a cache file are indexed by 4743 this function, i should range from 0 to n-1, where n is the 4744 return value from FcCacheNumSubdir. 4745 4746FcCacheNumSubdir 4747 4748Name 4749 4750 FcCacheNumSubdir -- Return the number of subdirectories in 4751 cache. 4752 4753Synopsis 4754 4755#include <fontconfig/fontconfig.h> 4756 4757 int FcCacheNumSubdir(const FcCache *cache); 4758 4759Description 4760 4761 This returns the total number of subdirectories in the cache. 4762 4763FcCacheNumFont 4764 4765Name 4766 4767 FcCacheNumFont -- Returns the number of fonts in cache. 4768 4769Synopsis 4770 4771#include <fontconfig/fontconfig.h> 4772 4773 int FcCacheNumFont(const FcCache *cache); 4774 4775Description 4776 4777 This returns the number of fonts which would be included in the 4778 return from FcCacheCopySet. 4779 4780FcDirCacheClean 4781 4782Name 4783 4784 FcDirCacheClean -- Clean up a cache directory 4785 4786Synopsis 4787 4788#include <fontconfig/fontconfig.h> 4789 4790 FcBool FcDirCacheClean(const FcChar8 *cache_dir, 4791 FcBoolverbose); 4792 4793Description 4794 4795 This tries to clean up the cache directory of cache_dir. This 4796 returns FcTrue if the operation is successfully complete. 4797 otherwise FcFalse. 4798 4799Since 4800 4801 version 2.9.91 4802 4803FcCacheCreateTagFile 4804 4805Name 4806 4807 FcCacheCreateTagFile -- Create CACHEDIR.TAG at cache directory. 4808 4809Synopsis 4810 4811#include <fontconfig/fontconfig.h> 4812 4813 void FcCacheCreateTagFile(const FcConfig *config); 4814 4815Description 4816 4817 This tries to create CACHEDIR.TAG file at the cache directory 4818 registered to config. 4819 4820Since 4821 4822 version 2.9.91 4823 4824FcDirCacheCreateUUID 4825 4826Name 4827 4828 FcDirCacheCreateUUID -- Create .uuid file at a directory 4829 4830Synopsis 4831 4832#include <fontconfig/fontconfig.h> 4833 4834 FcBool FcDirCacheCreateUUID(FcChar8 *dir, FcBoolforce, FcConfig 4835 *config); 4836 4837Description 4838 4839 This function is deprecated. it doesn't take any effects. 4840 4841Since 4842 4843 version 2.12.92 4844 4845FcDirCacheDeleteUUID 4846 4847Name 4848 4849 FcDirCacheDeleteUUID -- Delete .uuid file 4850 4851Synopsis 4852 4853#include <fontconfig/fontconfig.h> 4854 4855 FcBool FcDirCacheDeleteUUID(const FcChar8 *dir, FcConfig 4856 *config); 4857 4858Description 4859 4860 This is to delete .uuid file containing an UUID at a font 4861 directory of dir. 4862 4863Since 4864 4865 version 2.13.1 4866 __________________________________________________________ 4867 4868FcStrSet and FcStrList 4869 4870 Table of Contents 4871 FcStrSetCreate -- create a string set 4872 FcStrSetMember -- check set for membership 4873 FcStrSetEqual -- check sets for equality 4874 FcStrSetAdd -- add to a string set 4875 FcStrSetAddFilename -- add a filename to a string set 4876 FcStrSetDel -- delete from a string set 4877 FcStrSetDestroy -- destroy a string set 4878 FcStrListCreate -- create a string iterator 4879 FcStrListFirst -- get first string in iteration 4880 FcStrListNext -- get next string in iteration 4881 FcStrListDone -- destroy a string iterator 4882 4883 A data structure for enumerating strings, used to list 4884 directories while scanning the configuration as directories are 4885 added while scanning. 4886 4887FcStrSetCreate 4888 4889Name 4890 4891 FcStrSetCreate -- create a string set 4892 4893Synopsis 4894 4895#include <fontconfig/fontconfig.h> 4896 4897 FcStrSet * FcStrSetCreate(void); 4898 4899Description 4900 4901 Create an empty set. 4902 4903FcStrSetMember 4904 4905Name 4906 4907 FcStrSetMember -- check set for membership 4908 4909Synopsis 4910 4911#include <fontconfig/fontconfig.h> 4912 4913 FcBool FcStrSetMember(FcStrSet *set, const FcChar8 *s); 4914 4915Description 4916 4917 Returns whether s is a member of set. 4918 4919FcStrSetEqual 4920 4921Name 4922 4923 FcStrSetEqual -- check sets for equality 4924 4925Synopsis 4926 4927#include <fontconfig/fontconfig.h> 4928 4929 FcBool FcStrSetEqual(FcStrSet *set_a, FcStrSet *set_b); 4930 4931Description 4932 4933 Returns whether set_a contains precisely the same strings as 4934 set_b. Ordering of strings within the two sets is not 4935 considered. 4936 4937FcStrSetAdd 4938 4939Name 4940 4941 FcStrSetAdd -- add to a string set 4942 4943Synopsis 4944 4945#include <fontconfig/fontconfig.h> 4946 4947 FcBool FcStrSetAdd(FcStrSet *set, const FcChar8 *s); 4948 4949Description 4950 4951 Adds a copy of s to set. 4952 4953FcStrSetAddFilename 4954 4955Name 4956 4957 FcStrSetAddFilename -- add a filename to a string set 4958 4959Synopsis 4960 4961#include <fontconfig/fontconfig.h> 4962 4963 FcBool FcStrSetAddFilename(FcStrSet *set, const FcChar8 *s); 4964 4965Description 4966 4967 Adds a copy s to set, The copy is created with 4968 FcStrCopyFilename so that leading '~' values are replaced with 4969 the value of the HOME environment variable. 4970 4971FcStrSetDel 4972 4973Name 4974 4975 FcStrSetDel -- delete from a string set 4976 4977Synopsis 4978 4979#include <fontconfig/fontconfig.h> 4980 4981 FcBool FcStrSetDel(FcStrSet *set, const FcChar8 *s); 4982 4983Description 4984 4985 Removes s from set, returning FcTrue if s was a member else 4986 FcFalse. 4987 4988FcStrSetDestroy 4989 4990Name 4991 4992 FcStrSetDestroy -- destroy a string set 4993 4994Synopsis 4995 4996#include <fontconfig/fontconfig.h> 4997 4998 void FcStrSetDestroy(FcStrSet *set); 4999 5000Description 5001 5002 Destroys set. 5003 5004FcStrListCreate 5005 5006Name 5007 5008 FcStrListCreate -- create a string iterator 5009 5010Synopsis 5011 5012#include <fontconfig/fontconfig.h> 5013 5014 FcStrList * FcStrListCreate(FcStrSet *set); 5015 5016Description 5017 5018 Creates an iterator to list the strings in set. 5019 5020FcStrListFirst 5021 5022Name 5023 5024 FcStrListFirst -- get first string in iteration 5025 5026Synopsis 5027 5028#include <fontconfig/fontconfig.h> 5029 5030 void FcStrListFirst(FcStrList *list); 5031 5032Description 5033 5034 Returns the first string in list. 5035 5036Since 5037 5038 version 2.11.0 5039 5040FcStrListNext 5041 5042Name 5043 5044 FcStrListNext -- get next string in iteration 5045 5046Synopsis 5047 5048#include <fontconfig/fontconfig.h> 5049 5050 FcChar8 * FcStrListNext(FcStrList *list); 5051 5052Description 5053 5054 Returns the next string in list. 5055 5056FcStrListDone 5057 5058Name 5059 5060 FcStrListDone -- destroy a string iterator 5061 5062Synopsis 5063 5064#include <fontconfig/fontconfig.h> 5065 5066 void FcStrListDone(FcStrList *list); 5067 5068Description 5069 5070 Destroys the enumerator list. 5071 __________________________________________________________ 5072 5073String utilities 5074 5075 Table of Contents 5076 FcUtf8ToUcs4 -- convert UTF-8 to UCS4 5077 FcUcs4ToUtf8 -- convert UCS4 to UTF-8 5078 FcUtf8Len -- count UTF-8 encoded chars 5079 FcUtf16ToUcs4 -- convert UTF-16 to UCS4 5080 FcUtf16Len -- count UTF-16 encoded chars 5081 FcIsLower -- check for lower case ASCII character 5082 FcIsUpper -- check for upper case ASCII character 5083 FcToLower -- convert upper case ASCII to lower case 5084 FcStrCopy -- duplicate a string 5085 FcStrDowncase -- create a lower case translation of a string 5086 FcStrCopyFilename -- create a complete path from a filename 5087 FcStrCmp -- compare UTF-8 strings 5088 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case 5089 FcStrStr -- locate UTF-8 substring 5090 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring case 5091 FcStrPlus -- concatenate two strings 5092 FcStrFree -- free a string 5093 FcStrBuildFilename -- Concatenate strings as a file path 5094 FcStrDirname -- directory part of filename 5095 FcStrBasename -- last component of filename 5096 5097 Fontconfig manipulates many UTF-8 strings represented with the 5098 FcChar8 type. These functions are exposed to help applications 5099 deal with these UTF-8 strings in a locale-insensitive manner. 5100 5101FcUtf8ToUcs4 5102 5103Name 5104 5105 FcUtf8ToUcs4 -- convert UTF-8 to UCS4 5106 5107Synopsis 5108 5109#include <fontconfig/fontconfig.h> 5110 5111 int FcUtf8ToUcs4(FcChar8 *src, FcChar32 *dst, int len); 5112 5113Description 5114 5115 Converts the next Unicode char from src into dst and returns 5116 the number of bytes containing the char. src must be at least 5117 len bytes long. 5118 5119FcUcs4ToUtf8 5120 5121Name 5122 5123 FcUcs4ToUtf8 -- convert UCS4 to UTF-8 5124 5125Synopsis 5126 5127#include <fontconfig/fontconfig.h> 5128 5129 int FcUcs4ToUtf8(FcChar32 src, FcChar8 dst[FC_UTF8_MAX_LEN]); 5130 5131Description 5132 5133 Converts the Unicode char from src into dst and returns the 5134 number of bytes needed to encode the char. 5135 5136FcUtf8Len 5137 5138Name 5139 5140 FcUtf8Len -- count UTF-8 encoded chars 5141 5142Synopsis 5143 5144#include <fontconfig/fontconfig.h> 5145 5146 FcBool FcUtf8Len(FcChar8 *src, int len, int *nchar, int 5147 *wchar); 5148 5149Description 5150 5151 Counts the number of Unicode chars in len bytes of src. Places 5152 that count in nchar. wchar contains 1, 2 or 4 depending on the 5153 number of bytes needed to hold the largest Unicode char 5154 counted. The return value indicates whether src is a 5155 well-formed UTF8 string. 5156 5157FcUtf16ToUcs4 5158 5159Name 5160 5161 FcUtf16ToUcs4 -- convert UTF-16 to UCS4 5162 5163Synopsis 5164 5165#include <fontconfig/fontconfig.h> 5166 5167 int FcUtf16ToUcs4(FcChar8 *src, FcEndian endian, FcChar32 *dst, 5168 int len); 5169 5170Description 5171 5172 Converts the next Unicode char from src into dst and returns 5173 the number of bytes containing the char. src must be at least 5174 len bytes long. Bytes of src are combined into 16-bit units 5175 according to endian. 5176 5177FcUtf16Len 5178 5179Name 5180 5181 FcUtf16Len -- count UTF-16 encoded chars 5182 5183Synopsis 5184 5185#include <fontconfig/fontconfig.h> 5186 5187 FcBool FcUtf16Len(FcChar8 *src, FcEndian endian, int len, int 5188 *nchar, int *wchar); 5189 5190Description 5191 5192 Counts the number of Unicode chars in len bytes of src. Bytes 5193 of src are combined into 16-bit units according to endian. 5194 Places that count in nchar. wchar contains 1, 2 or 4 depending 5195 on the number of bytes needed to hold the largest Unicode char 5196 counted. The return value indicates whether string is a 5197 well-formed UTF16 string. 5198 5199FcIsLower 5200 5201Name 5202 5203 FcIsLower -- check for lower case ASCII character 5204 5205Synopsis 5206 5207#include <fontconfig/fontconfig.h> 5208 5209 FcBool FcIsLower(FcChar8c); 5210 5211Description 5212 5213 This macro checks whether c is an lower case ASCII letter. 5214 5215FcIsUpper 5216 5217Name 5218 5219 FcIsUpper -- check for upper case ASCII character 5220 5221Synopsis 5222 5223#include <fontconfig/fontconfig.h> 5224 5225 FcBool FcIsUpper(FcChar8c); 5226 5227Description 5228 5229 This macro checks whether c is a upper case ASCII letter. 5230 5231FcToLower 5232 5233Name 5234 5235 FcToLower -- convert upper case ASCII to lower case 5236 5237Synopsis 5238 5239#include <fontconfig/fontconfig.h> 5240 5241 FcChar8 FcToLower(FcChar8c); 5242 5243Description 5244 5245 This macro converts upper case ASCII c to the equivalent lower 5246 case letter. 5247 5248FcStrCopy 5249 5250Name 5251 5252 FcStrCopy -- duplicate a string 5253 5254Synopsis 5255 5256#include <fontconfig/fontconfig.h> 5257 5258 FcChar8 * FcStrCopy(const FcChar8 *s); 5259 5260Description 5261 5262 Allocates memory, copies s and returns the resulting buffer. 5263 Yes, this is strdup, but that function isn't available on every 5264 platform. 5265 5266FcStrDowncase 5267 5268Name 5269 5270 FcStrDowncase -- create a lower case translation of a string 5271 5272Synopsis 5273 5274#include <fontconfig/fontconfig.h> 5275 5276 FcChar8 * FcStrDowncase(const FcChar8 *s); 5277 5278Description 5279 5280 Allocates memory, copies s, converting upper case letters to 5281 lower case and returns the allocated buffer. 5282 5283FcStrCopyFilename 5284 5285Name 5286 5287 FcStrCopyFilename -- create a complete path from a filename 5288 5289Synopsis 5290 5291#include <fontconfig/fontconfig.h> 5292 5293 FcChar8 * FcStrCopyFilename(const FcChar8 *s); 5294 5295Description 5296 5297 FcStrCopyFilename constructs an absolute pathname from s. It 5298 converts any leading '~' characters in to the value of the HOME 5299 environment variable, and any relative paths are converted to 5300 absolute paths using the current working directory. Sequences 5301 of '/' characters are converted to a single '/', and names 5302 containing the current directory '.' or parent directory '..' 5303 are correctly reconstructed. Returns NULL if '~' is the leading 5304 character and HOME is unset or disabled (see 5305 FcConfigEnableHome). 5306 5307FcStrCmp 5308 5309Name 5310 5311 FcStrCmp -- compare UTF-8 strings 5312 5313Synopsis 5314 5315#include <fontconfig/fontconfig.h> 5316 5317 int FcStrCmp(const FcChar8 *s1, const FcChar8 *s2); 5318 5319Description 5320 5321 Returns the usual <0, 0, >0 result of comparing s1 and s2. 5322 5323FcStrCmpIgnoreCase 5324 5325Name 5326 5327 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case 5328 5329Synopsis 5330 5331#include <fontconfig/fontconfig.h> 5332 5333 int FcStrCmpIgnoreCase(const FcChar8 *s1, const FcChar8 *s2); 5334 5335Description 5336 5337 Returns the usual <0, 0, >0 result of comparing s1 and s2. This 5338 test is case-insensitive for all proper UTF-8 encoded strings. 5339 5340FcStrStr 5341 5342Name 5343 5344 FcStrStr -- locate UTF-8 substring 5345 5346Synopsis 5347 5348#include <fontconfig/fontconfig.h> 5349 5350 FcChar8 * FcStrStr(const FcChar8 *s1, const FcChar8 *s2); 5351 5352Description 5353 5354 Returns the location of s2 in s1. Returns NULL if s2 is not 5355 present in s1. This test will operate properly with UTF8 5356 encoded strings. 5357 5358FcStrStrIgnoreCase 5359 5360Name 5361 5362 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring case 5363 5364Synopsis 5365 5366#include <fontconfig/fontconfig.h> 5367 5368 FcChar8 * FcStrStrIgnoreCase(const FcChar8 *s1, const FcChar8 5369 *s2); 5370 5371Description 5372 5373 Returns the location of s2 in s1, ignoring case. Returns NULL 5374 if s2 is not present in s1. This test is case-insensitive for 5375 all proper UTF-8 encoded strings. 5376 5377FcStrPlus 5378 5379Name 5380 5381 FcStrPlus -- concatenate two strings 5382 5383Synopsis 5384 5385#include <fontconfig/fontconfig.h> 5386 5387 FcChar8 * FcStrPlus(const FcChar8 *s1, const FcChar8 *s2); 5388 5389Description 5390 5391 This function allocates new storage and places the 5392 concatenation of s1 and s2 there, returning the new string. 5393 5394FcStrFree 5395 5396Name 5397 5398 FcStrFree -- free a string 5399 5400Synopsis 5401 5402#include <fontconfig/fontconfig.h> 5403 5404 void FcStrFree(FcChar8 *s); 5405 5406Description 5407 5408 This is just a wrapper around free(3) which helps track memory 5409 usage of strings within the fontconfig library. 5410 5411FcStrBuildFilename 5412 5413Name 5414 5415 FcStrBuildFilename -- Concatenate strings as a file path 5416 5417Synopsis 5418 5419#include <fontconfig/fontconfig.h> 5420 5421 FcChar8 * FcStrBuildFilename(const FcChar8 *path, ...); 5422 5423Description 5424 5425 Creates a filename from the given elements of strings as file 5426 paths and concatenate them with the appropriate file separator. 5427 Arguments must be null-terminated. This returns a 5428 newly-allocated memory which should be freed when no longer 5429 needed. 5430 5431FcStrDirname 5432 5433Name 5434 5435 FcStrDirname -- directory part of filename 5436 5437Synopsis 5438 5439#include <fontconfig/fontconfig.h> 5440 5441 FcChar8 * FcStrDirname(const FcChar8 *file); 5442 5443Description 5444 5445 Returns the directory containing file. This is returned in 5446 newly allocated storage which should be freed when no longer 5447 needed. 5448 5449FcStrBasename 5450 5451Name 5452 5453 FcStrBasename -- last component of filename 5454 5455Synopsis 5456 5457#include <fontconfig/fontconfig.h> 5458 5459 FcChar8 * FcStrBasename(const FcChar8 *file); 5460 5461Description 5462 5463 Returns the filename of file stripped of any leading directory 5464 names. This is returned in newly allocated storage which should 5465 be freed when no longer needed. 5466