fontconfig-devel.txt revision a6844aab
1a6844aabSmrgFontconfig Developers Reference, Version 2.8.0 22c393a42Smrg 3a6844aabSmrgCopyright © 2002 Keith Packard 42c393a42Smrg 5a6844aabSmrgPermission to use, copy, modify, distribute, and sell this software and its 6a6844aabSmrgdocumentation for any purpose is hereby granted without fee, provided that the 7a6844aabSmrgabove copyright notice appear in all copies and that both that copyright notice 8a6844aabSmrgand this permission notice appear in supporting documentation, and that the 9a6844aabSmrgname of Keith Packard not be used in advertising or publicity pertaining to 10a6844aabSmrgdistribution of the software without specific, written prior permission. Keith 11a6844aabSmrgPackard makes no representations about the suitability of this software for any 12a6844aabSmrgpurpose. It is provided "as is" without express or implied warranty. 132c393a42Smrg 14a6844aabSmrgTHE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 15a6844aabSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE 16a6844aabSmrgAUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 17a6844aabSmrgDAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 18a6844aabSmrgACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 19a6844aabSmrgCONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 202c393a42Smrg 21a6844aabSmrg ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 222c393a42Smrg 23a6844aabSmrgTable of Contents 24a6844aabSmrgDESCRIPTION 25a6844aabSmrgFUNCTIONAL OVERVIEW 26a6844aabSmrgDatatypes 27a6844aabSmrgFUNCTIONS 282c393a42Smrg 29a6844aabSmrgDESCRIPTION 302c393a42Smrg 31a6844aabSmrgFontconfig is a library designed to provide system-wide font configuration, 32a6844aabSmrgcustomization and application access. 332c393a42Smrg 34a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 352c393a42Smrg 36a6844aabSmrgFUNCTIONAL OVERVIEW 37a6844aabSmrg 38a6844aabSmrgFontconfig contains two essential modules, the configuration module which 39a6844aabSmrgbuilds an internal configuration from XML files and the matching module which 40a6844aabSmrgaccepts font patterns and returns the nearest matching font. 41a6844aabSmrg 42a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43a6844aabSmrg 44a6844aabSmrgFONT CONFIGURATION 45a6844aabSmrg 46a6844aabSmrgThe configuration module consists of the FcConfig datatype, libexpat and 47a6844aabSmrgFcConfigParse which walks over an XML tree and ammends a configuration with 48a6844aabSmrgdata found within. From an external perspective, configuration of the library 49a6844aabSmrgconsists of generating a valid XML tree and feeding that to FcConfigParse. The 50a6844aabSmrgonly other mechanism provided to applications for changing the running 51a6844aabSmrgconfiguration is to add fonts and directories to the list of 52a6844aabSmrgapplication-provided font files. 53a6844aabSmrg 54a6844aabSmrgThe intent is to make font configurations relatively static, and shared by as 55a6844aabSmrgmany applications as possible. It is hoped that this will lead to more stable 56a6844aabSmrgfont selection when passing names from one application to another. XML was 57a6844aabSmrgchosen as a configuration file format because it provides a format which is 58a6844aabSmrgeasy for external agents to edit while retaining the correct structure and 59a6844aabSmrgsyntax. 60a6844aabSmrg 61a6844aabSmrgFont configuration is separate from font matching; applications needing to do 62a6844aabSmrgtheir own matching can access the available fonts from the library and perform 63a6844aabSmrgprivate matching. The intent is to permit applications to pick and choose 64a6844aabSmrgappropriate functionality from the library instead of forcing them to choose 65a6844aabSmrgbetween this library and a private configuration mechanism. The hope is that 66a6844aabSmrgthis will ensure that configuration of fonts for all applications can be 67a6844aabSmrgcentralized in one place. Centralizing font configuration will simplify and 68a6844aabSmrgregularize font installation and customization. 69a6844aabSmrg 70a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71a6844aabSmrg 72a6844aabSmrgFONT PROPERTIES 73a6844aabSmrg 74a6844aabSmrgWhile font patterns may contain essentially any properties, there are some well 75a6844aabSmrgknown properties with associated types. Fontconfig uses some of these 76a6844aabSmrgproperties for font matching and font completion. Others are provided as a 77a6844aabSmrgconvenience for the applications rendering mechanism. 782c393a42Smrg 792c393a42Smrg Property Definitions 802c393a42Smrg 812c393a42Smrg Property CPP Symbol Type Description 822c393a42Smrg ---------------------------------------------------- 832c393a42Smrg family FC_FAMILY String Font family names 84a6844aabSmrg familylang FC_FAMILYLANG String Language cooresponding to 852c393a42Smrg each family name 86a6844aabSmrg style FC_STYLE String Font style. Overrides weight 872c393a42Smrg and slant 88a6844aabSmrg stylelang FC_STYLELANG String Language cooresponding to 892c393a42Smrg each style name 90a6844aabSmrg fullname FC_FULLNAME String Font face full name where 91a6844aabSmrg different from family and 922c393a42Smrg family + style 93a6844aabSmrg fullnamelang FC_FULLNAMELANG String Language cooresponding to 942c393a42Smrg each fullname 952c393a42Smrg slant FC_SLANT Int Italic, oblique or roman 962c393a42Smrg weight FC_WEIGHT Int Light, medium, demibold, 972c393a42Smrg bold or black 982c393a42Smrg size FC_SIZE Double Point size 99a6844aabSmrg width FC_WIDTH Int Condensed, normal or expanded 100a6844aabSmrg aspect FC_ASPECT Double Stretches glyphs horizontally 1012c393a42Smrg before hinting 1022c393a42Smrg pixelsize FC_PIXEL_SIZE Double Pixel size 103a6844aabSmrg spacing FC_SPACING Int Proportional, dual-width, 1042c393a42Smrg monospace or charcell 1052c393a42Smrg foundry FC_FOUNDRY String Font foundry name 1062c393a42Smrg antialias FC_ANTIALIAS Bool Whether glyphs can be 1072c393a42Smrg antialiased 108a6844aabSmrg hinting FC_HINTING Bool Whether the rasterizer should 1092c393a42Smrg use hinting 1102c393a42Smrg hintstyle FC_HINT_STYLE Int Automatic hinting style 1112c393a42Smrg verticallayout FC_VERTICAL_LAYOUT Bool Use vertical layout 112a6844aabSmrg autohint FC_AUTOHINT Bool Use autohinter instead of 1132c393a42Smrg normal hinter 114a6844aabSmrg globaladvance FC_GLOBAL_ADVANCE Bool Use font global advance data 115a6844aabSmrg file FC_FILE String The filename holding the font 116a6844aabSmrg index FC_INDEX Int The index of the font within 1172c393a42Smrg the file 118a6844aabSmrg ftface FC_FT_FACE FT_Face Use the specified FreeType 1192c393a42Smrg face object 120a6844aabSmrg rasterizer FC_RASTERIZER String Which rasterizer is in use 121a6844aabSmrg outline FC_OUTLINE Bool Whether the glyphs are outlines 122a6844aabSmrg scalable FC_SCALABLE Bool Whether glyphs can be scaled 123a6844aabSmrg scale FC_SCALE Double Scale factor for point->pixel 1242c393a42Smrg conversions 1252c393a42Smrg dpi FC_DPI Double Target dots per inch 1262c393a42Smrg rgba FC_RGBA Int unknown, rgb, bgr, vrgb, 127a6844aabSmrg vbgr, none - subpixel geometry 1282c393a42Smrg lcdfilter FC_LCD_FILTER Int Type of LCD filter 129a6844aabSmrg minspace FC_MINSPACE Bool Eliminate leading from line 1302c393a42Smrg spacing 1312c393a42Smrg charset FC_CHARSET CharSet Unicode chars encoded by 1322c393a42Smrg the font 1332c393a42Smrg lang FC_LANG LangSet Set of RFC-3066-style 134a6844aabSmrg languages this font supports 135a6844aabSmrg fontversion FC_FONTVERSION Int Version number of the font 136a6844aabSmrg capability FC_CAPABILITY String List of layout capabilities in 1372c393a42Smrg the font 1382c393a42Smrg embolden FC_EMBOLDEN Bool Rasterizer should 139a6844aabSmrg synthetically embolden the font 140a6844aabSmrg 141a6844aabSmrg 142a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143a6844aabSmrg 144a6844aabSmrgDatatypes 1452c393a42Smrg 146a6844aabSmrgFontconfig uses abstract datatypes to hide internal implementation details for 147a6844aabSmrgmost data structures. A few structures are exposed where appropriate. 1482c393a42Smrg 149a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1502c393a42Smrg 151a6844aabSmrgFcChar8, FcChar16, FcChar32, FcBool 1522c393a42Smrg 153a6844aabSmrgThese are primitive datatypes; the FcChar* types hold precisely the number of 154a6844aabSmrgbits stated (if supported by the C implementation). FcBool holds one of two CPP 155a6844aabSmrgsymbols: FcFalse or FcTrue. 1562c393a42Smrg 157a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158a6844aabSmrg 159a6844aabSmrgFcMatrix 160a6844aabSmrg 161a6844aabSmrgAn FcMatrix holds an affine transformation, usually used to reshape glyphs. A 162a6844aabSmrgsmall set of matrix operations are provided to manipulate these. 1632c393a42Smrg 1642c393a42Smrg typedef struct _FcMatrix { 1652c393a42Smrg double xx, xy, yx, yy; 1662c393a42Smrg } FcMatrix; 1672c393a42Smrg 1682c393a42Smrg 169a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 170a6844aabSmrg 171a6844aabSmrgFcCharSet 172a6844aabSmrg 173a6844aabSmrgAn FcCharSet is an abstract type that holds the set of encoded unicode chars in 174a6844aabSmrga font. Operations to build and compare these sets are provided. 175a6844aabSmrg 176a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 177a6844aabSmrg 178a6844aabSmrgFcLangSet 1792c393a42Smrg 180a6844aabSmrgAn FcLangSet is an abstract type that holds the set of languages supported by a 181a6844aabSmrgfont. Operations to build and compare these sets are provided. These are 182a6844aabSmrgcomputed for a font based on orthographic information built into the fontconfig 183a6844aabSmrglibrary. Fontconfig has orthographies for all of the ISO 639-1 languages except 184a6844aabSmrgfor MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA. If you have orthographic 185a6844aabSmrginformation for any of these languages, please submit them. 1862c393a42Smrg 187a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1882c393a42Smrg 189a6844aabSmrgFcLangResult 1902c393a42Smrg 191a6844aabSmrgAn FcLangResult is an enumeration used to return the results of comparing two 192a6844aabSmrglanguage strings or FcLangSet objects. FcLangEqual means the objects match 193a6844aabSmrglanguage and territory. FcLangDifferentTerritory means the objects match in 194a6844aabSmrglanguage but differ in territory. FcLangDifferentLang means the objects differ 195a6844aabSmrgin language. 1962c393a42Smrg 197a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1982c393a42Smrg 199a6844aabSmrgFcType 2002c393a42Smrg 201a6844aabSmrgTags the kind of data stored in an FcValue. 202a6844aabSmrg 203a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 204a6844aabSmrg 205a6844aabSmrgFcValue 206a6844aabSmrg 207a6844aabSmrgAn FcValue object holds a single value with one of a number of different types. 208a6844aabSmrgThe 'type' tag indicates which member is valid. 2092c393a42Smrg 2102c393a42Smrg typedef struct _FcValue { 2112c393a42Smrg FcType type; 2122c393a42Smrg union { 2132c393a42Smrg const FcChar8 *s; 2142c393a42Smrg int i; 2152c393a42Smrg FcBool b; 2162c393a42Smrg double d; 2172c393a42Smrg const FcMatrix *m; 2182c393a42Smrg const FcCharSet *c; 2192c393a42Smrg void *f; 2202c393a42Smrg const FcLangSet *l; 2212c393a42Smrg } u; 2222c393a42Smrg } FcValue; 2232c393a42Smrg 224a6844aabSmrg 2252c393a42Smrg FcValue Members 2262c393a42Smrg 2272c393a42Smrg Type Union member Datatype 2282c393a42Smrg -------------------------------- 2292c393a42Smrg FcTypeVoid (none) (none) 2302c393a42Smrg FcTypeInteger i int 2312c393a42Smrg FcTypeDouble d double 2322c393a42Smrg FcTypeString s FcChar8 * 2332c393a42Smrg FcTypeBool b b 2342c393a42Smrg FcTypeMatrix m FcMatrix * 2352c393a42Smrg FcTypeCharSet c FcCharSet * 2362c393a42Smrg FcTypeFTFace f void * (FT_Face) 2372c393a42Smrg FcTypeLangSet l FcLangSet * 2382c393a42Smrg 2392c393a42Smrg 240a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 241a6844aabSmrg 242a6844aabSmrgFcPattern 2432c393a42Smrg 244a6844aabSmrgholds a set of names with associated value lists; each name refers to a 245a6844aabSmrgproperty of a font. FcPatterns are used as inputs to the matching code as well 246a6844aabSmrgas holding information about specific fonts. Each property can hold one or more 247a6844aabSmrgvalues; conventionally all of the same type, although the interface doesn't 248a6844aabSmrgdemand that. 249a6844aabSmrg 250a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 251a6844aabSmrg 252a6844aabSmrgFcFontSet 2532c393a42Smrg 2542c393a42Smrg typedef struct _FcFontSet { 2552c393a42Smrg int nfont; 2562c393a42Smrg int sfont; 2572c393a42Smrg FcPattern **fonts; 2582c393a42Smrg } FcFontSet; 2592c393a42Smrg 2602c393a42Smrg 261a6844aabSmrgAn FcFontSet contains a list of FcPatterns. Internally fontconfig uses this 262a6844aabSmrgdata structure to hold sets of fonts. Externally, fontconfig returns the 263a6844aabSmrgresults of listing fonts in this format. 'nfont' holds the number of patterns 264a6844aabSmrgin the 'fonts' array; 'sfont' is used to indicate the size of that array. 265a6844aabSmrg 266a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2672c393a42Smrg 268a6844aabSmrgFcStrSet, FcStrList 2692c393a42Smrg 270a6844aabSmrgFcStrSet holds a list of strings that can be appended to and enumerated. Its 271a6844aabSmrgunique characteristic is that the enumeration works even while strings are 272a6844aabSmrgappended during enumeration. FcStrList is used during enumeration to safely and 273a6844aabSmrgcorrectly walk the list of strings even while that list is edited in the middle 274a6844aabSmrgof enumeration. 275a6844aabSmrg 276a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 277a6844aabSmrg 278a6844aabSmrgFcObjectSet 2792c393a42Smrg 2802c393a42Smrg typedef struct _FcObjectSet { 2812c393a42Smrg int nobject; 2822c393a42Smrg int sobject; 2832c393a42Smrg const char **objects; 2842c393a42Smrg } FcObjectSet; 2852c393a42Smrg 2862c393a42Smrg 287a6844aabSmrgholds a set of names and is used to specify which fields from fonts are placed 288a6844aabSmrgin the the list of returned patterns when listing fonts. 289a6844aabSmrg 290a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 291a6844aabSmrg 292a6844aabSmrgFcObjectType 2932c393a42Smrg 2942c393a42Smrg typedef struct _FcObjectType { 2952c393a42Smrg const char *object; 2962c393a42Smrg FcType type; 2972c393a42Smrg } FcObjectType; 2982c393a42Smrg 2992c393a42Smrg 300a6844aabSmrgmarks the type of a pattern element generated when parsing font names. 301a6844aabSmrgApplications can add new object types so that font names may contain the new 302a6844aabSmrgelements. 303a6844aabSmrg 304a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 305a6844aabSmrg 306a6844aabSmrgFcConstant 3072c393a42Smrg 3082c393a42Smrg typedef struct _FcConstant { 3092c393a42Smrg const FcChar8 *name; 3102c393a42Smrg const char *object; 3112c393a42Smrg int value; 3122c393a42Smrg } FcConstant; 3132c393a42Smrg 3142c393a42Smrg 315a6844aabSmrgProvides for symbolic constants for new pattern elements. When 'name' is seen 316a6844aabSmrgin a font name, an 'object' element is created with value 'value'. 317a6844aabSmrg 318a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 319a6844aabSmrg 320a6844aabSmrgFcBlanks 321a6844aabSmrg 322a6844aabSmrgholds a list of Unicode chars which are expected to be blank; unexpectedly 323a6844aabSmrgblank chars are assumed to be invalid and are elided from the charset 324a6844aabSmrgassociated with the font. 3252c393a42Smrg 326a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3272c393a42Smrg 328a6844aabSmrgFcFileCache 3292c393a42Smrg 330a6844aabSmrgholds the per-user cache information for use while loading the font database. 331a6844aabSmrgThis is built automatically for the current configuration when that is loaded. 332a6844aabSmrgApplications must always pass '0' when one is requested. 3332c393a42Smrg 334a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3352c393a42Smrg 336a6844aabSmrgFcConfig 3372c393a42Smrg 338a6844aabSmrgholds a complete configuration of the library; there is one default 339a6844aabSmrgconfiguration, other can be constructed from XML data structures. All public 340a6844aabSmrgentry points that need global data can take an optional FcConfig* argument; 341a6844aabSmrgpassing 0 uses the default configuration. FcConfig objects hold two sets of 342a6844aabSmrgfonts, the first contains those specified by the configuration, the second set 343a6844aabSmrgholds those added by the application at run-time. Interfaces that need to 344a6844aabSmrgreference a particulat set use one of the FcSetName enumerated values. 3452c393a42Smrg 346a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3472c393a42Smrg 348a6844aabSmrgFcSetName 349a6844aabSmrg 350a6844aabSmrgSpecifies one of the two sets of fonts available in a configuration; 351a6844aabSmrgFcSetSystem for those fonts specified in the configuration and FcSetApplication 352a6844aabSmrgwhich holds fonts provided by the application. 353a6844aabSmrg 354a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 355a6844aabSmrg 356a6844aabSmrgFcResult 357a6844aabSmrg 358a6844aabSmrgUsed as a return type for functions manipulating FcPattern objects. 3592c393a42Smrg 3602c393a42Smrg FcResult Values 3612c393a42Smrg Result Code Meaning 3622c393a42Smrg ----------------------------------------------------------- 3632c393a42Smrg FcResultMatch Object exists with the specified ID 3642c393a42Smrg FcResultNoMatch Object doesn't exist at all 365a6844aabSmrg FcResultTypeMismatch Object exists, but the type doesn't match 3662c393a42Smrg FcResultNoId Object exists, but has fewer values 3672c393a42Smrg than specified 3682c393a42Smrg FcResultOutOfMemory Malloc failed 3692c393a42Smrg 3702c393a42Smrg 371a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 372a6844aabSmrg 373a6844aabSmrgFcAtomic 374a6844aabSmrg 375a6844aabSmrgUsed for locking access to config files. Provides a safe way to update 376a6844aabSmrgconfiguration files. 3772c393a42Smrg 378a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3792c393a42Smrg 380a6844aabSmrgFcCache 3812c393a42Smrg 382a6844aabSmrgHolds information about the fonts contained in a single directory. Normal 383a6844aabSmrgapplications need not worry about this as caches for font access are 384a6844aabSmrgautomatically managed by the library. Applications dealing with cache 385a6844aabSmrgmanagement may want to use some of these objects in their work, however the 386a6844aabSmrgincluded 'fc-cache' program generally suffices for all of that. 3872c393a42Smrg 388a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3892c393a42Smrg 390a6844aabSmrgFUNCTIONS 3912c393a42Smrg 392a6844aabSmrgThese are grouped by functionality, often using the main datatype being 393a6844aabSmrgmanipulated. 3942c393a42Smrg 395a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 396a6844aabSmrg 397a6844aabSmrgInitialization 398a6844aabSmrg 399a6844aabSmrgTable of Contents 400a6844aabSmrgFcInitLoadConfig -- load configuration 401a6844aabSmrgFcInitLoadConfigAndFonts -- load configuration and font data 402a6844aabSmrgFcInit -- initialize fontconfig library 403a6844aabSmrgFcFini -- finalize fonconfig library 404a6844aabSmrgFcGetVersion -- library version number 405a6844aabSmrgFcInitReinitialize -- re-initialize library 406a6844aabSmrgFcInitBringUptoDate -- reload configuration files if needed 407a6844aabSmrg 408a6844aabSmrgThese functions provide some control over how the library is initialized. 4092c393a42Smrg 4102c393a42SmrgFcInitLoadConfig 4112c393a42Smrg 4122c393a42SmrgName 4132c393a42Smrg 414a6844aabSmrgFcInitLoadConfig -- load configuration 4152c393a42Smrg 4162c393a42SmrgSynopsis 4172c393a42Smrg 4182c393a42Smrg#include <fontconfig.h> 4192c393a42Smrg 420a6844aabSmrg 421a6844aabSmrgFcConfig * FcInitLoadConfig(void); 4222c393a42Smrg 4232c393a42SmrgDescription 4242c393a42Smrg 425a6844aabSmrgLoads the default configuration file and returns the resulting configuration. 426a6844aabSmrgDoes not load any font information. 4272c393a42Smrg 4282c393a42SmrgVersion 4292c393a42Smrg 430a6844aabSmrgFontconfig version 2.8.0 4312c393a42Smrg 4322c393a42SmrgFcInitLoadConfigAndFonts 4332c393a42Smrg 4342c393a42SmrgName 4352c393a42Smrg 436a6844aabSmrgFcInitLoadConfigAndFonts -- load configuration and font data 4372c393a42Smrg 4382c393a42SmrgSynopsis 4392c393a42Smrg 4402c393a42Smrg#include <fontconfig.h> 4412c393a42Smrg 442a6844aabSmrg 443a6844aabSmrgFcConfig * FcInitLoadConfigAndFonts(void); 4442c393a42Smrg 4452c393a42SmrgDescription 4462c393a42Smrg 447a6844aabSmrgLoads the default configuration file and builds information about the available 448a6844aabSmrgfonts. Returns the resulting configuration. 4492c393a42Smrg 4502c393a42SmrgVersion 4512c393a42Smrg 452a6844aabSmrgFontconfig version 2.8.0 4532c393a42Smrg 4542c393a42SmrgFcInit 4552c393a42Smrg 4562c393a42SmrgName 4572c393a42Smrg 458a6844aabSmrgFcInit -- initialize fontconfig library 4592c393a42Smrg 4602c393a42SmrgSynopsis 4612c393a42Smrg 4622c393a42Smrg#include <fontconfig.h> 4632c393a42Smrg 464a6844aabSmrg 465a6844aabSmrgFcBool FcInit(void); 4662c393a42Smrg 4672c393a42SmrgDescription 4682c393a42Smrg 469a6844aabSmrgLoads the default configuration file and the fonts referenced therein and sets 470a6844aabSmrgthe default configuration to that result. Returns whether this process 471a6844aabSmrgsucceeded or not. If the default configuration has already been loaded, this 472a6844aabSmrgroutine does nothing and returns FcTrue. 4732c393a42Smrg 4742c393a42SmrgVersion 4752c393a42Smrg 476a6844aabSmrgFontconfig version 2.8.0 4772c393a42Smrg 4782c393a42SmrgFcFini 4792c393a42Smrg 4802c393a42SmrgName 4812c393a42Smrg 482a6844aabSmrgFcFini -- finalize fonconfig library 4832c393a42Smrg 4842c393a42SmrgSynopsis 4852c393a42Smrg 4862c393a42Smrg#include <fontconfig.h> 4872c393a42Smrg 488a6844aabSmrg 489a6844aabSmrgvoid FcFini(void); 4902c393a42Smrg 4912c393a42SmrgDescription 4922c393a42Smrg 493a6844aabSmrgFrees all data structures allocated by previous calls to fontconfig functions. 494a6844aabSmrgFontconfig returns to an uninitialized state, requiring a new call to one of 495a6844aabSmrgthe FcInit functions before any other fontconfig function may be called. 4962c393a42Smrg 4972c393a42SmrgVersion 4982c393a42Smrg 499a6844aabSmrgFontconfig version 2.8.0 5002c393a42Smrg 5012c393a42SmrgFcGetVersion 5022c393a42Smrg 5032c393a42SmrgName 5042c393a42Smrg 505a6844aabSmrgFcGetVersion -- library version number 5062c393a42Smrg 5072c393a42SmrgSynopsis 5082c393a42Smrg 5092c393a42Smrg#include <fontconfig.h> 5102c393a42Smrg 511a6844aabSmrg 512a6844aabSmrgint FcGetVersion(void); 5132c393a42Smrg 5142c393a42SmrgDescription 5152c393a42Smrg 516a6844aabSmrgReturns the version number of the library. 5172c393a42Smrg 5182c393a42SmrgVersion 5192c393a42Smrg 520a6844aabSmrgFontconfig version 2.8.0 5212c393a42Smrg 5222c393a42SmrgFcInitReinitialize 5232c393a42Smrg 5242c393a42SmrgName 5252c393a42Smrg 526a6844aabSmrgFcInitReinitialize -- re-initialize library 5272c393a42Smrg 5282c393a42SmrgSynopsis 5292c393a42Smrg 5302c393a42Smrg#include <fontconfig.h> 5312c393a42Smrg 532a6844aabSmrg 533a6844aabSmrgFcBool FcInitReinitialize(void); 5342c393a42Smrg 5352c393a42SmrgDescription 5362c393a42Smrg 537a6844aabSmrgForces the default configuration file to be reloaded and resets the default 538a6844aabSmrgconfiguration. Returns FcFalse if the configuration cannot be reloaded (due to 539a6844aabSmrgconfig file errors, allocation failures or other issues) and leaves the 540a6844aabSmrgexisting configuration unchanged. Otherwise returns FcTrue. 5412c393a42Smrg 5422c393a42SmrgVersion 5432c393a42Smrg 544a6844aabSmrgFontconfig version 2.8.0 5452c393a42Smrg 5462c393a42SmrgFcInitBringUptoDate 5472c393a42Smrg 5482c393a42SmrgName 5492c393a42Smrg 550a6844aabSmrgFcInitBringUptoDate -- reload configuration files if needed 5512c393a42Smrg 5522c393a42SmrgSynopsis 5532c393a42Smrg 5542c393a42Smrg#include <fontconfig.h> 5552c393a42Smrg 556a6844aabSmrg 557a6844aabSmrgFcBool FcInitBringUptoDate(void); 5582c393a42Smrg 5592c393a42SmrgDescription 5602c393a42Smrg 561a6844aabSmrgChecks the rescan interval in the default configuration, checking the 562a6844aabSmrgconfiguration if the interval has passed and reloading the configuration if 563a6844aabSmrgwhen any changes are detected. Returns FcFalse if the configuration cannot be 564a6844aabSmrgreloaded (see FcInitReinitialize). Otherwise returns FcTrue. 5652c393a42Smrg 5662c393a42SmrgVersion 5672c393a42Smrg 568a6844aabSmrgFontconfig version 2.8.0 5692c393a42Smrg 570a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5712c393a42Smrg 572a6844aabSmrgFcPattern 5732c393a42Smrg 574a6844aabSmrgTable of Contents 575a6844aabSmrgFcPatternCreate -- Create a pattern 576a6844aabSmrgFcPatternDuplicate -- Copy a pattern 577a6844aabSmrgFcPatternReference -- Increment pattern reference count 578a6844aabSmrgFcPatternDestroy -- Destroy a pattern 579a6844aabSmrgFcPatternEqual -- Compare patterns 580a6844aabSmrgFcPatternEqualSubset -- Compare portions of patterns 581a6844aabSmrgFcPatternFilter -- Filter the objects of pattern 582a6844aabSmrgFcPatternHash -- Compute a pattern hash value 583a6844aabSmrgFcPatternAdd -- Add a value to a pattern 584a6844aabSmrgFcPatternAddWeak -- Add a value to a pattern with weak binding 585a6844aabSmrgFcPatternAdd-Type -- Add a typed value to a pattern 586a6844aabSmrgFcPatternGet -- Return a value from a pattern 587a6844aabSmrgFcPatternGet-Type -- Return a typed value from a pattern 588a6844aabSmrgFcPatternBuild -- Create patterns from arguments 589a6844aabSmrgFcPatternDel -- Delete a property from a pattern 590a6844aabSmrgFcPatternRemove -- Remove one object of the specified type from the pattern 591a6844aabSmrgFcPatternPrint -- Print a pattern for debugging 592a6844aabSmrgFcDefaultSubstitute -- Perform default substitutions in a pattern 593a6844aabSmrgFcNameParse -- Parse a pattern string 594a6844aabSmrgFcNameUnparse -- Convert a pattern back into a string that can be parsed 595a6844aabSmrgFcPatternFormat -- Format a pattern into a string according to a format 596a6844aabSmrg specifier 5972c393a42Smrg 598a6844aabSmrgAn FcPattern is an opaque type that holds both patterns to match against the 599a6844aabSmrgavailable fonts, as well as the information about each font. 6002c393a42Smrg 6012c393a42SmrgFcPatternCreate 6022c393a42Smrg 6032c393a42SmrgName 6042c393a42Smrg 605a6844aabSmrgFcPatternCreate -- Create a pattern 6062c393a42Smrg 6072c393a42SmrgSynopsis 6082c393a42Smrg 6092c393a42Smrg#include <fontconfig.h> 6102c393a42Smrg 611a6844aabSmrg 612a6844aabSmrgFcPattern * FcPatternCreate(void); 6132c393a42Smrg 6142c393a42SmrgDescription 6152c393a42Smrg 616a6844aabSmrgCreates a pattern with no properties; used to build patterns from scratch. 6172c393a42Smrg 6182c393a42SmrgVersion 6192c393a42Smrg 620a6844aabSmrgFontconfig version 2.8.0 6212c393a42Smrg 6222c393a42SmrgFcPatternDuplicate 6232c393a42Smrg 6242c393a42SmrgName 6252c393a42Smrg 626a6844aabSmrgFcPatternDuplicate -- Copy a pattern 6272c393a42Smrg 6282c393a42SmrgSynopsis 6292c393a42Smrg 6302c393a42Smrg#include <fontconfig.h> 6312c393a42Smrg 632a6844aabSmrg 633a6844aabSmrgFcPattern * FcPatternDuplicate(const FcPattern *p); 6342c393a42Smrg 6352c393a42SmrgDescription 6362c393a42Smrg 637a6844aabSmrgCopy a pattern, returning a new pattern that matches p. Each pattern may be 638a6844aabSmrgmodified without affecting the other. 6392c393a42Smrg 6402c393a42SmrgVersion 6412c393a42Smrg 642a6844aabSmrgFontconfig version 2.8.0 6432c393a42Smrg 6442c393a42SmrgFcPatternReference 6452c393a42Smrg 6462c393a42SmrgName 6472c393a42Smrg 648a6844aabSmrgFcPatternReference -- Increment pattern reference count 6492c393a42Smrg 6502c393a42SmrgSynopsis 6512c393a42Smrg 6522c393a42Smrg#include <fontconfig.h> 6532c393a42Smrg 654a6844aabSmrg 655a6844aabSmrgvoid FcPatternReference(FcPattern *p); 6562c393a42Smrg 6572c393a42SmrgDescription 6582c393a42Smrg 659a6844aabSmrgAdd another reference to p. Patterns are freed only when the reference count 660a6844aabSmrgreaches zero. 6612c393a42Smrg 6622c393a42SmrgVersion 6632c393a42Smrg 664a6844aabSmrgFontconfig version 2.8.0 6652c393a42Smrg 6662c393a42SmrgFcPatternDestroy 6672c393a42Smrg 6682c393a42SmrgName 6692c393a42Smrg 670a6844aabSmrgFcPatternDestroy -- Destroy a pattern 6712c393a42Smrg 6722c393a42SmrgSynopsis 6732c393a42Smrg 6742c393a42Smrg#include <fontconfig.h> 6752c393a42Smrg 676a6844aabSmrg 677a6844aabSmrgvoid FcPatternDestroy(FcPattern *p); 6782c393a42Smrg 6792c393a42SmrgDescription 6802c393a42Smrg 681a6844aabSmrgDecrement the pattern reference count. If all references are gone, destroys the 682a6844aabSmrgpattern, in the process destroying all related values. 6832c393a42Smrg 6842c393a42SmrgVersion 6852c393a42Smrg 686a6844aabSmrgFontconfig version 2.8.0 6872c393a42Smrg 6882c393a42SmrgFcPatternEqual 6892c393a42Smrg 6902c393a42SmrgName 6912c393a42Smrg 692a6844aabSmrgFcPatternEqual -- Compare patterns 6932c393a42Smrg 6942c393a42SmrgSynopsis 6952c393a42Smrg 6962c393a42Smrg#include <fontconfig.h> 6972c393a42Smrg 698a6844aabSmrg 699a6844aabSmrgFcBool FcPatternEqual(const FcPattern *pa, const FcPattern *pb); 7002c393a42Smrg 7012c393a42SmrgDescription 7022c393a42Smrg 703a6844aabSmrgReturns whether pa and pb are exactly alike. 7042c393a42Smrg 7052c393a42SmrgVersion 7062c393a42Smrg 707a6844aabSmrgFontconfig version 2.8.0 7082c393a42Smrg 7092c393a42SmrgFcPatternEqualSubset 7102c393a42Smrg 7112c393a42SmrgName 7122c393a42Smrg 713a6844aabSmrgFcPatternEqualSubset -- Compare portions of patterns 7142c393a42Smrg 7152c393a42SmrgSynopsis 7162c393a42Smrg 7172c393a42Smrg#include <fontconfig.h> 7182c393a42Smrg 719a6844aabSmrg 720a6844aabSmrgFcBool FcPatternEqualSubset(const FcPattern *pa, const FcPattern *pb, const 721a6844aabSmrgFcObjectSet *os); 7222c393a42Smrg 7232c393a42SmrgDescription 7242c393a42Smrg 725a6844aabSmrgReturns whether pa and pb have exactly the same values for all of the objects 726a6844aabSmrgin os. 7272c393a42Smrg 7282c393a42SmrgVersion 7292c393a42Smrg 730a6844aabSmrgFontconfig version 2.8.0 731a6844aabSmrg 732a6844aabSmrgFcPatternFilter 733a6844aabSmrg 734a6844aabSmrgName 735a6844aabSmrg 736a6844aabSmrgFcPatternFilter -- Filter the objects of pattern 737a6844aabSmrg 738a6844aabSmrgSynopsis 739a6844aabSmrg 740a6844aabSmrg#include <fontconfig.h> 741a6844aabSmrg 742a6844aabSmrg 743a6844aabSmrgFcPattern * FcPatternFilter(FcPattern *p, const FcObjectSet *); 744a6844aabSmrg 745a6844aabSmrgDescription 746a6844aabSmrg 747a6844aabSmrgReturns a new pattern that only has those objects from p that are in os. If os 748a6844aabSmrgis NULL, a duplicate of p is returned. 749a6844aabSmrg 750a6844aabSmrgVersion 751a6844aabSmrg 752a6844aabSmrgFontconfig version 2.8.0 7532c393a42Smrg 7542c393a42SmrgFcPatternHash 7552c393a42Smrg 7562c393a42SmrgName 7572c393a42Smrg 758a6844aabSmrgFcPatternHash -- Compute a pattern hash value 7592c393a42Smrg 7602c393a42SmrgSynopsis 7612c393a42Smrg 7622c393a42Smrg#include <fontconfig.h> 7632c393a42Smrg 764a6844aabSmrg 765a6844aabSmrgFcChar32 FcPatternHash(const FcPattern *p); 7662c393a42Smrg 7672c393a42SmrgDescription 7682c393a42Smrg 769a6844aabSmrgReturns a 32-bit number which is the same for any two patterns which are equal. 7702c393a42Smrg 7712c393a42SmrgVersion 7722c393a42Smrg 773a6844aabSmrgFontconfig version 2.8.0 7742c393a42Smrg 7752c393a42SmrgFcPatternAdd 7762c393a42Smrg 7772c393a42SmrgName 7782c393a42Smrg 779a6844aabSmrgFcPatternAdd -- Add a value to a pattern 7802c393a42Smrg 7812c393a42SmrgSynopsis 7822c393a42Smrg 7832c393a42Smrg#include <fontconfig.h> 7842c393a42Smrg 785a6844aabSmrg 786a6844aabSmrgFcBool FcPatternAdd(FcPattern *p, const char *object, FcValue value, FcBool 787a6844aabSmrgappend); 7882c393a42Smrg 7892c393a42SmrgDescription 7902c393a42Smrg 791a6844aabSmrgAdds a single value to the list of values associated with the property named 792a6844aabSmrg`object. If `append is FcTrue, the value is added at the end of any existing 793a6844aabSmrglist, otherwise it is inserted at the begining. `value' is saved (with 794a6844aabSmrgFcValueSave) when inserted into the pattern so that the library retains no 795a6844aabSmrgreference to any application-supplied data structure. 7962c393a42Smrg 7972c393a42SmrgVersion 7982c393a42Smrg 799a6844aabSmrgFontconfig version 2.8.0 8002c393a42Smrg 8012c393a42SmrgFcPatternAddWeak 8022c393a42Smrg 8032c393a42SmrgName 8042c393a42Smrg 805a6844aabSmrgFcPatternAddWeak -- Add a value to a pattern with weak binding 8062c393a42Smrg 8072c393a42SmrgSynopsis 8082c393a42Smrg 8092c393a42Smrg#include <fontconfig.h> 8102c393a42Smrg 811a6844aabSmrg 812a6844aabSmrgFcBool FcPatternAddWeak(FcPattern *p, const char *object, FcValue value, FcBool 813a6844aabSmrgappend); 8142c393a42Smrg 8152c393a42SmrgDescription 8162c393a42Smrg 817a6844aabSmrgFcPatternAddWeak is essentially the same as FcPatternAdd except that any values 818a6844aabSmrgadded to the list have binding weak instead of strong. 8192c393a42Smrg 8202c393a42SmrgVersion 8212c393a42Smrg 822a6844aabSmrgFontconfig version 2.8.0 8232c393a42Smrg 8242c393a42SmrgFcPatternAdd-Type 8252c393a42Smrg 8262c393a42SmrgName 8272c393a42Smrg 828a6844aabSmrgFcPatternAddInteger, FcPatternAddDouble, FcPatternAddString, 829a6844aabSmrgFcPatternAddMatrix, FcPatternAddCharSet, FcPatternAddBool, FcPatternAddFTFace, 830a6844aabSmrgFcPatternAddLangSet -- Add a typed value to a pattern 8312c393a42Smrg 8322c393a42SmrgSynopsis 8332c393a42Smrg 8342c393a42Smrg#include <fontconfig.h> 8352c393a42Smrg 8362c393a42Smrg 837a6844aabSmrgFcBool FcPatternAddInteger(FcPattern *p, const char *object, int i); 838a6844aabSmrg 839a6844aabSmrgFcBool FcPatternAddDouble(FcPattern *p, const char *object, double d); 8402c393a42Smrg 841a6844aabSmrgFcBool FcPatternAddString(FcPattern *p, const char *object, const FcChar8 *s); 8422c393a42Smrg 843a6844aabSmrgFcBool FcPatternAddMatrix(FcPattern *p, const char *object, const FcMatrix *m); 8442c393a42Smrg 845a6844aabSmrgFcBool FcPatternAddCharSet(FcPattern *p, const char *object, const FcCharSet *c 846a6844aabSmrg); 8472c393a42Smrg 848a6844aabSmrgFcBool FcPatternAddBool(FcPattern *p, const char *object, FcBool b); 8492c393a42Smrg 850a6844aabSmrgFcBool FcPatternAddFTFace(FcPattern *p, const char *object, const FT_Facef); 8512c393a42Smrg 852a6844aabSmrgFcBool FcPatternAddLangSet(FcPattern *p, const char *object, const FcLangSet *l 853a6844aabSmrg); 8542c393a42Smrg 8552c393a42SmrgDescription 8562c393a42Smrg 857a6844aabSmrgThese are all convenience functions that insert objects of the specified type 858a6844aabSmrginto the pattern. Use these in preference to FcPatternAdd as they will provide 859a6844aabSmrgcompile-time typechecking. These all append values to any existing list of 860a6844aabSmrgvalues. 8612c393a42Smrg 8622c393a42SmrgVersion 8632c393a42Smrg 864a6844aabSmrgFontconfig version 2.8.0 8652c393a42Smrg 8662c393a42SmrgFcPatternGet 8672c393a42Smrg 8682c393a42SmrgName 8692c393a42Smrg 870a6844aabSmrgFcPatternGet -- Return a value from a pattern 8712c393a42Smrg 8722c393a42SmrgSynopsis 8732c393a42Smrg 8742c393a42Smrg#include <fontconfig.h> 8752c393a42Smrg 876a6844aabSmrg 877a6844aabSmrgFcResult FcPatternGet(FcPattern *p, const char *object, int id, FcValue *v); 8782c393a42Smrg 8792c393a42SmrgDescription 8802c393a42Smrg 881a6844aabSmrgReturns in v the id'th value associated with the property object. The value 882a6844aabSmrgreturned is not a copy, but rather refers to the data stored within the pattern 883a6844aabSmrgdirectly. Applications must not free this value. 8842c393a42Smrg 8852c393a42SmrgVersion 8862c393a42Smrg 887a6844aabSmrgFontconfig version 2.8.0 8882c393a42Smrg 8892c393a42SmrgFcPatternGet-Type 8902c393a42Smrg 8912c393a42SmrgName 8922c393a42Smrg 893a6844aabSmrgFcPatternGetInteger, FcPatternGetDouble, FcPatternGetString, 894a6844aabSmrgFcPatternGetMatrix, FcPatternGetCharSet, FcPatternGetBool, FcPatternGetFTFace, 895a6844aabSmrgFcPatternGetLangSet -- Return a typed value from a pattern 8962c393a42Smrg 8972c393a42SmrgSynopsis 8982c393a42Smrg 8992c393a42Smrg#include <fontconfig.h> 9002c393a42Smrg 9012c393a42Smrg 902a6844aabSmrgFcResult FcPatternGetInteger(FcPattern *p, const char *object, int n, int *i); 903a6844aabSmrg 904a6844aabSmrgFcResult FcPatternGetDouble(FcPattern *p, const char *object, int n, double *d 905a6844aabSmrg); 9062c393a42Smrg 907a6844aabSmrgFcResult FcPatternGetString(FcPattern *p, const char *object, int n, FcChar8 ** 908a6844aabSmrgs); 9092c393a42Smrg 910a6844aabSmrgFcResult FcPatternGetMatrix(FcPattern *p, const char *object, int n, FcMatrix 911a6844aabSmrg**s); 9122c393a42Smrg 913a6844aabSmrgFcResult FcPatternGetCharSet(FcPattern *p, const char *object, int n, FcCharSet 914a6844aabSmrg**c); 9152c393a42Smrg 916a6844aabSmrgFcResult FcPatternGetBool(FcPattern *p, const char *object, int n, FcBool *b); 9172c393a42Smrg 918a6844aabSmrgFcResult FcPatternGetFTFace(FcPattern *p, const char *object, int n); 9192c393a42Smrg 920a6844aabSmrgFcResult FcPatternGetLangSet(FcPattern *p, const char *object, FT_Face *f); 9212c393a42Smrg 9222c393a42SmrgDescription 9232c393a42Smrg 924a6844aabSmrgThese are convenience functions that call FcPatternGet and verify that the 925a6844aabSmrgreturned data is of the expected type. They return FcResultTypeMismatch if this 926a6844aabSmrgis not the case. Note that these (like FcPatternGet) do not make a copy of any 927a6844aabSmrgdata structure referenced by the return value. Use these in preference to 928a6844aabSmrgFcPatternGet to provide compile-time typechecking. 9292c393a42Smrg 9302c393a42SmrgVersion 9312c393a42Smrg 932a6844aabSmrgFontconfig version 2.8.0 9332c393a42Smrg 9342c393a42SmrgFcPatternBuild 9352c393a42Smrg 9362c393a42SmrgName 9372c393a42Smrg 938a6844aabSmrgFcPatternBuild, FcPatternVaBuild, FcPatternVapBuild -- Create patterns from 939a6844aabSmrgarguments 9402c393a42Smrg 9412c393a42SmrgSynopsis 9422c393a42Smrg 9432c393a42Smrg#include <fontconfig.h> 9442c393a42Smrg 9452c393a42Smrg 946a6844aabSmrgFcPattern * FcPatternBuild(FcPattern *pattern, ...); 9472c393a42Smrg 948a6844aabSmrgFcPattern * FcPatternVaBuild(FcPattern *pattern, va_list va); 949a6844aabSmrg 950a6844aabSmrgvoid FcPatternVapBuild(FcPattern *result, FcPattern *pattern, va_list va); 9512c393a42Smrg 9522c393a42SmrgDescription 9532c393a42Smrg 954a6844aabSmrgBuilds a pattern using a list of objects, types and values. Each value to be 955a6844aabSmrgentered in the pattern is specified with three arguments: 956a6844aabSmrg 957a6844aabSmrg 1. Object name, a string describing the property to be added. 958a6844aabSmrg 959a6844aabSmrg 2. Object type, one of the FcType enumerated values 9602c393a42Smrg 961a6844aabSmrg 3. Value, not an FcValue, but the raw type as passed to any of the 962a6844aabSmrg FcPatternAdd<type> functions. Must match the type of the second argument. 9632c393a42Smrg 964a6844aabSmrgThe argument list is terminated by a null object name, no object type nor value 965a6844aabSmrgneed be passed for this. The values are added to `pattern', if `pattern' is 966a6844aabSmrgnull, a new pattern is created. In either case, the pattern is returned. 967a6844aabSmrgExample 9682c393a42Smrg 969a6844aabSmrgpattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Times", (char *) 0); 970a6844aabSmrg 971a6844aabSmrgFcPatternVaBuild is used when the arguments are already in the form of a 972a6844aabSmrgvarargs value. FcPatternVapBuild is a macro version of FcPatternVaBuild which 973a6844aabSmrgreturns its result directly in the result variable. 9742c393a42Smrg 9752c393a42SmrgVersion 9762c393a42Smrg 977a6844aabSmrgFontconfig version 2.8.0 9782c393a42Smrg 9792c393a42SmrgFcPatternDel 9802c393a42Smrg 9812c393a42SmrgName 9822c393a42Smrg 983a6844aabSmrgFcPatternDel -- Delete a property from a pattern 9842c393a42Smrg 9852c393a42SmrgSynopsis 9862c393a42Smrg 9872c393a42Smrg#include <fontconfig.h> 9882c393a42Smrg 989a6844aabSmrg 990a6844aabSmrgFcBool FcPatternDel(FcPattern *p, const char *object); 9912c393a42Smrg 9922c393a42SmrgDescription 9932c393a42Smrg 994a6844aabSmrgDeletes all values associated with the property `object', returning whether the 995a6844aabSmrgproperty existed or not. 9962c393a42Smrg 9972c393a42SmrgVersion 9982c393a42Smrg 999a6844aabSmrgFontconfig version 2.8.0 10002c393a42Smrg 10012c393a42SmrgFcPatternRemove 10022c393a42Smrg 10032c393a42SmrgName 10042c393a42Smrg 1005a6844aabSmrgFcPatternRemove -- Remove one object of the specified type from the pattern 10062c393a42Smrg 10072c393a42SmrgSynopsis 10082c393a42Smrg 10092c393a42Smrg#include <fontconfig.h> 10102c393a42Smrg 1011a6844aabSmrg 1012a6844aabSmrgFcBool FcPatternRemove(FcPattern *p, const char *object, int id); 10132c393a42Smrg 10142c393a42SmrgDescription 10152c393a42Smrg 1016a6844aabSmrgRemoves the value associated with the property `object' at position `id', 1017a6844aabSmrgreturning whether the property existed and had a value at that position or not. 10182c393a42Smrg 10192c393a42SmrgVersion 10202c393a42Smrg 1021a6844aabSmrgFontconfig version 2.8.0 10222c393a42Smrg 10232c393a42SmrgFcPatternPrint 10242c393a42Smrg 10252c393a42SmrgName 10262c393a42Smrg 1027a6844aabSmrgFcPatternPrint -- Print a pattern for debugging 10282c393a42Smrg 10292c393a42SmrgSynopsis 10302c393a42Smrg 10312c393a42Smrg#include <fontconfig.h> 10322c393a42Smrg 1033a6844aabSmrg 1034a6844aabSmrgvoid FcPatternPrint(const FcPattern *p); 10352c393a42Smrg 10362c393a42SmrgDescription 10372c393a42Smrg 1038a6844aabSmrgPrints an easily readable version of the pattern to stdout. There is no 1039a6844aabSmrgprovision for reparsing data in this format, it's just for diagnostics and 1040a6844aabSmrgdebugging. 10412c393a42Smrg 10422c393a42SmrgVersion 10432c393a42Smrg 1044a6844aabSmrgFontconfig version 2.8.0 10452c393a42Smrg 10462c393a42SmrgFcDefaultSubstitute 10472c393a42Smrg 10482c393a42SmrgName 10492c393a42Smrg 1050a6844aabSmrgFcDefaultSubstitute -- Perform default substitutions in a pattern 10512c393a42Smrg 10522c393a42SmrgSynopsis 10532c393a42Smrg 10542c393a42Smrg#include <fontconfig.h> 10552c393a42Smrg 1056a6844aabSmrg 1057a6844aabSmrgvoid FcDefaultSubstitute(FcPattern *pattern); 10582c393a42Smrg 10592c393a42SmrgDescription 10602c393a42Smrg 1061a6844aabSmrgSupplies default values for underspecified font patterns: 1062a6844aabSmrg 1063a6844aabSmrg • Patterns without a specified style or weight are set to Medium 10642c393a42Smrg 1065a6844aabSmrg • Patterns without a specified style or slant are set to Roman 1066a6844aabSmrg 1067a6844aabSmrg • Patterns without a specified pixel size are given one computed from any 1068a6844aabSmrg specified point size (default 12), dpi (default 75) and scale (default 1). 10692c393a42Smrg 10702c393a42SmrgVersion 10712c393a42Smrg 1072a6844aabSmrgFontconfig version 2.8.0 10732c393a42Smrg 10742c393a42SmrgFcNameParse 10752c393a42Smrg 10762c393a42SmrgName 10772c393a42Smrg 1078a6844aabSmrgFcNameParse -- Parse a pattern string 10792c393a42Smrg 10802c393a42SmrgSynopsis 10812c393a42Smrg 10822c393a42Smrg#include <fontconfig.h> 10832c393a42Smrg 1084a6844aabSmrg 1085a6844aabSmrgFcPattern * FcNameParse(const FcChar8 *name); 10862c393a42Smrg 10872c393a42SmrgDescription 10882c393a42Smrg 1089a6844aabSmrgConverts name from the standard text format described above into a pattern. 10902c393a42Smrg 10912c393a42SmrgVersion 10922c393a42Smrg 1093a6844aabSmrgFontconfig version 2.8.0 10942c393a42Smrg 10952c393a42SmrgFcNameUnparse 10962c393a42Smrg 10972c393a42SmrgName 10982c393a42Smrg 1099a6844aabSmrgFcNameUnparse -- Convert a pattern back into a string that can be parsed 11002c393a42Smrg 11012c393a42SmrgSynopsis 11022c393a42Smrg 11032c393a42Smrg#include <fontconfig.h> 11042c393a42Smrg 1105a6844aabSmrg 1106a6844aabSmrgFcChar8 * FcNameUnparse(FcPattern *pat); 11072c393a42Smrg 11082c393a42SmrgDescription 11092c393a42Smrg 1110a6844aabSmrgConverts the given pattern into the standard text format described above. The 1111a6844aabSmrgreturn value is not static, but instead refers to newly allocated memory which 1112a6844aabSmrgshould be freed by the caller using free(). 1113a6844aabSmrg 1114a6844aabSmrgVersion 1115a6844aabSmrg 1116a6844aabSmrgFontconfig version 2.8.0 1117a6844aabSmrg 1118a6844aabSmrgFcPatternFormat 1119a6844aabSmrg 1120a6844aabSmrgName 1121a6844aabSmrg 1122a6844aabSmrgFcPatternFormat -- Format a pattern into a string according to a format 1123a6844aabSmrgspecifier 1124a6844aabSmrg 1125a6844aabSmrgSynopsis 1126a6844aabSmrg 1127a6844aabSmrg#include <fontconfig.h> 1128a6844aabSmrg 1129a6844aabSmrg 1130a6844aabSmrgFcChar8 * FcPatternFormat(FcPattern *pat, const FcChar8 *format); 1131a6844aabSmrg 1132a6844aabSmrgDescription 1133a6844aabSmrg 1134a6844aabSmrgConverts given pattern pat into text described by the format specifier format. 1135a6844aabSmrgThe return value refers to newly allocated memory which should be freed by the 1136a6844aabSmrgcaller using free(), or NULL if format is invalid. 1137a6844aabSmrg 1138a6844aabSmrg The format is loosely modelled after printf-style format string. The format 1139a6844aabSmrgstring is composed of zero or more directives: ordinary characters (not "%"), 1140a6844aabSmrgwhich are copied unchanged to the output stream; and tags which are interpreted 1141a6844aabSmrgto construct text from the pattern in a variety of ways (explained below). 1142a6844aabSmrgSpecial characters can be escaped using backslash. C-string style special 1143a6844aabSmrgcharacters like \n and \r are also supported (this is useful when the format 1144a6844aabSmrgstring is not a C string literal). It is advisable to always escape curly 1145a6844aabSmrgbraces that are meant to be copied to the output as ordinary characters. 1146a6844aabSmrg 1147a6844aabSmrg Each tags is introduced by the character "%", followed by an optional minimum 1148a6844aabSmrgfield width, followed by tag contents in curly braces ({}). If the minimum 1149a6844aabSmrgfield width value is provided the tag will be expanded and the result padded to 1150a6844aabSmrgachieve the minimum width. If the minimum field width is positive, the padding 1151a6844aabSmrgwill right-align the text. Negative field width will left-align. The rest of 1152a6844aabSmrgthis section describes various supported tag contents and their expansion. 1153a6844aabSmrg 1154a6844aabSmrg A simple tag is one where the content is an identifier. When simple tags are 1155a6844aabSmrgexpanded, the named identifier will be looked up in pattern and the resulting 1156a6844aabSmrglist of values returned, joined together using comma. For example, to print the 1157a6844aabSmrgfamily name and style the pattern, use the format "%{family} %{style}\n". To 1158a6844aabSmrgextend the family column to forty characters use "%-40{family}%{style}\n". 1159a6844aabSmrg 1160a6844aabSmrg Simple tags expand to list of all values for an element. To only choose one of 1161a6844aabSmrgthe values, one can index using the syntax "%{elt[idx]}". For example, to get 1162a6844aabSmrgthe first family name only, use "%{family[0]}". 1163a6844aabSmrg 1164a6844aabSmrg If a simple tag ends with "=" and the element is found in the pattern, the 1165a6844aabSmrgname of the element followed by "=" will be output before the list of values. 1166a6844aabSmrgFor example, "%{weight=}" may expand to the string "weight=80". Or to the empty 1167a6844aabSmrgstring if pattern does not have weight set. 1168a6844aabSmrg 1169a6844aabSmrg If a simple tag starts with ":" and the element is found in the pattern, ":" 1170a6844aabSmrgwill be printed first. For example, combining this with the =, the format "% 1171a6844aabSmrg{:weight=}" may expand to ":weight=80" or to the empty string if pattern does 1172a6844aabSmrgnot have weight set. 1173a6844aabSmrg 1174a6844aabSmrg If a simple tag contains the string ":-", the rest of the the tag contents 1175a6844aabSmrgwill be used as a default string. The default string is output if the element 1176a6844aabSmrgis not found in the pattern. For example, the format "%{:weight=:-123}" may 1177a6844aabSmrgexpand to ":weight=80" or to the string ":weight=123" if pattern does not have 1178a6844aabSmrgweight set. 1179a6844aabSmrg 1180a6844aabSmrg A count tag is one that starts with the character "#" followed by an element 1181a6844aabSmrgname, and expands to the number of values for the element in the pattern. For 1182a6844aabSmrgexample, "%{#family}" expands to the number of family names pattern has set, 1183a6844aabSmrgwhich may be zero. 1184a6844aabSmrg 1185a6844aabSmrg A sub-expression tag is one that expands a sub-expression. The tag contents 1186a6844aabSmrgare the sub-expression to expand placed inside another set of curly braces. 1187a6844aabSmrgSub-expression tags are useful for aligning an entire sub-expression, or to 1188a6844aabSmrgapply converters (explained later) on an entire sub-expression. For example, 1189a6844aabSmrgthe format "%40{{%{family} %{style}}}" expands the sub-expression to construct 1190a6844aabSmrgthe family name followed by the style, then takes the entire string and pads it 1191a6844aabSmrgon the left to be at least forty characters. 1192a6844aabSmrg 1193a6844aabSmrg A filter-out tag is one starting with the character "-" followed by a 1194a6844aabSmrgcomma-separated list of element names, followed by a sub-expression enclosed in 1195a6844aabSmrgcurly braces. The sub-expression will be expanded but with a pattern that has 1196a6844aabSmrgthe listed elements removed from it. For example, the format "%{-size,pixelsize 1197a6844aabSmrg{sub-expr}}" will expand "sub-expr" with pattern sans the size and pixelsize 1198a6844aabSmrgelements. 1199a6844aabSmrg 1200a6844aabSmrg A filter-in tag is one starting with the character "+" followed by a 1201a6844aabSmrgcomma-separated list of element names, followed by a sub-expression enclosed in 1202a6844aabSmrgcurly braces. The sub-expression will be expanded but with a pattern that only 1203a6844aabSmrghas the listed elements from the surrounding pattern. For example, the format 1204a6844aabSmrg"%{+family,familylang{sub-expr}}" will expand "sub-expr" with a sub-pattern 1205a6844aabSmrgconsisting only the family and family lang elements of pattern. 1206a6844aabSmrg 1207a6844aabSmrg A conditional tag is one starting with the character "?" followed by a 1208a6844aabSmrgcomma-separated list of element conditions, followed by two sub-expression 1209a6844aabSmrgenclosed in curly braces. An element condition can be an element name, in which 1210a6844aabSmrgcase it tests whether the element is defined in pattern, or the character "!" 1211a6844aabSmrgfollowed by an element name, in which case the test is negated. The conditional 1212a6844aabSmrgpasses if all the element conditions pass. The tag expands the first 1213a6844aabSmrgsub-expression if the conditional passes, and expands the second sub-expression 1214a6844aabSmrgotherwise. For example, the format "%{?size,dpi,!pixelsize{pass}{fail}}" will 1215a6844aabSmrgexpand to "pass" if pattern has size and dpi elements but no pixelsize element, 1216a6844aabSmrgand to "fail" otherwise. 1217a6844aabSmrg 1218a6844aabSmrg An enumerate tag is one starting with the string "[]" followed by a 1219a6844aabSmrgcomma-separated list of element names, followed by a sub-expression enclosed in 1220a6844aabSmrgcurly braces. The list of values for the named elements are walked in parallel 1221a6844aabSmrgand the sub-expression expanded each time with a pattern just having a single 1222a6844aabSmrgvalue for those elements, starting from the first value and continuing as long 1223a6844aabSmrgas any of those elements has a value. For example, the format "%{[] 1224a6844aabSmrgfamily,familylang{%{family} (%{familylang})\n}}" will expand the pattern "% 1225a6844aabSmrg{family} (%{familylang})\n" with a pattern having only the first value of the 1226a6844aabSmrgfamily and familylang elemtns, then expands it with the second values, then the 1227a6844aabSmrgthird, etc. 1228a6844aabSmrg 1229a6844aabSmrg As a special case, if an enumerate tag has only one element, and that element 1230a6844aabSmrghas only one value in the pattern, and that value is of type FcLangSet, the 1231a6844aabSmrgindividual languages in the language set are enumerated. 1232a6844aabSmrg 1233a6844aabSmrg A builtin tag is one starting with the character "=" followed by a builtin 1234a6844aabSmrgname. The following builtins are defined: 1235a6844aabSmrg 1236a6844aabSmrgunparse 1237a6844aabSmrg 1238a6844aabSmrg Expands to the result of calling FcNameUnparse() on the pattern. 1239a6844aabSmrg 1240a6844aabSmrgfcmatch 1241a6844aabSmrg 1242a6844aabSmrg Expands to the output of the default output format of the fc-match command 1243a6844aabSmrg on the pattern, without the final newline. 1244a6844aabSmrg 1245a6844aabSmrgfclist 1246a6844aabSmrg 1247a6844aabSmrg Expands to the output of the default output format of the fc-list command 1248a6844aabSmrg on the pattern, without the final newline. 1249a6844aabSmrg 1250a6844aabSmrgpkgkit 1251a6844aabSmrg 1252a6844aabSmrg Expands to the list of PackageKit font() tags for the pattern. Currently 1253a6844aabSmrg this includes tags for each family name, and each language from the 1254a6844aabSmrg pattern, enumerated and sanitized into a set of tags terminated by newline. 1255a6844aabSmrg Package management systems can use these tags to tag their packages 1256a6844aabSmrg accordingly. 1257a6844aabSmrg 1258a6844aabSmrgFor example, the format "%{+family,style{%{=unparse}}}\n" will expand to an 1259a6844aabSmrgunparsed name containing only the family and style element values from pattern. 1260a6844aabSmrg 1261a6844aabSmrg 1262a6844aabSmrg The contents of any tag can be followed by a set of zero or more converters. A 1263a6844aabSmrgconverter is specified by the character "|" followed by the converter name and 1264a6844aabSmrgarguments. The following converters are defined: 1265a6844aabSmrg 1266a6844aabSmrgbasename 1267a6844aabSmrg 1268a6844aabSmrg Replaces text with the results of calling FcStrBasename() on it. 1269a6844aabSmrg 1270a6844aabSmrgdirname 1271a6844aabSmrg 1272a6844aabSmrg Replaces text with the results of calling FcStrDirname() on it. 1273a6844aabSmrg 1274a6844aabSmrgdowncase 1275a6844aabSmrg 1276a6844aabSmrg Replaces text with the results of calling FcStrDowncase() on it. 1277a6844aabSmrg 1278a6844aabSmrgshescape 1279a6844aabSmrg 1280a6844aabSmrg Escapes text for one level of shell expansion. (Escapes single-quotes, also 1281a6844aabSmrg encloses text in single-quotes.) 1282a6844aabSmrg 1283a6844aabSmrgcescape 1284a6844aabSmrg 1285a6844aabSmrg Escapes text such that it can be used as part of a C string literal. 1286a6844aabSmrg (Escapes backslash and double-quotes.) 1287a6844aabSmrg 1288a6844aabSmrgxmlescape 1289a6844aabSmrg 1290a6844aabSmrg Escapes text such that it can be used in XML and HTML. (Escapes less-than, 1291a6844aabSmrg greater-than, and ampersand.) 1292a6844aabSmrg 1293a6844aabSmrgdelete(chars) 1294a6844aabSmrg 1295a6844aabSmrg Deletes all occurrences of each of the characters in chars from the text. 1296a6844aabSmrg FIXME: This converter is not UTF-8 aware yet. 1297a6844aabSmrg 1298a6844aabSmrgescape(chars) 1299a6844aabSmrg 1300a6844aabSmrg Escapes all occurrences of each of the characters in chars by prepending it 1301a6844aabSmrg by the first character in chars. FIXME: This converter is not UTF-8 aware 1302a6844aabSmrg yet. 1303a6844aabSmrg 1304a6844aabSmrgtranslate(from,to) 1305a6844aabSmrg 1306a6844aabSmrg Translates all occurrences of each of the characters in from by replacing 1307a6844aabSmrg them with their corresponding character in to. If to has fewer characters 1308a6844aabSmrg than from, it will be extended by repeating its last character. FIXME: This 1309a6844aabSmrg converter is not UTF-8 aware yet. 1310a6844aabSmrg 1311a6844aabSmrgFor example, the format "%{family|downcase|delete( )}\n" will expand to the 1312a6844aabSmrgvalues of the family element in pattern, lower-cased and with spaces removed. 13132c393a42Smrg 13142c393a42SmrgVersion 13152c393a42Smrg 1316a6844aabSmrgFontconfig version 2.8.0 1317a6844aabSmrg 1318a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13192c393a42Smrg 1320a6844aabSmrgFcFontSet 13212c393a42Smrg 1322a6844aabSmrgTable of Contents 1323a6844aabSmrgFcFontSetCreate -- Create a font set 1324a6844aabSmrgFcFontSetDestroy -- Destroy a font set 1325a6844aabSmrgFcFontSetAdd -- Add to a font set 1326a6844aabSmrgFcFontSetList -- List fonts from a set of font sets 1327a6844aabSmrgFcFontSetMatch -- Return the best font from a set of font sets 1328a6844aabSmrgFcFontSetPrint -- Print a set of patterns to stdout 1329a6844aabSmrgFcFontSetSort -- Add to a font set 1330a6844aabSmrgFcFontSetSortDestroy -- DEPRECATED destroy a font set 13312c393a42Smrg 1332a6844aabSmrgAn FcFontSet simply holds a list of patterns; these are used to return the 1333a6844aabSmrgresults of listing available fonts. 13342c393a42Smrg 13352c393a42SmrgFcFontSetCreate 13362c393a42Smrg 13372c393a42SmrgName 13382c393a42Smrg 1339a6844aabSmrgFcFontSetCreate -- Create a font set 13402c393a42Smrg 13412c393a42SmrgSynopsis 13422c393a42Smrg 13432c393a42Smrg#include <fontconfig.h> 13442c393a42Smrg 1345a6844aabSmrg 1346a6844aabSmrgFcFontSet * FcFontSetCreate(void); 13472c393a42Smrg 13482c393a42SmrgDescription 13492c393a42Smrg 1350a6844aabSmrgCreates an empty font set. 13512c393a42Smrg 13522c393a42SmrgVersion 13532c393a42Smrg 1354a6844aabSmrgFontconfig version 2.8.0 13552c393a42Smrg 13562c393a42SmrgFcFontSetDestroy 13572c393a42Smrg 13582c393a42SmrgName 13592c393a42Smrg 1360a6844aabSmrgFcFontSetDestroy -- Destroy a font set 13612c393a42Smrg 13622c393a42SmrgSynopsis 13632c393a42Smrg 13642c393a42Smrg#include <fontconfig.h> 13652c393a42Smrg 1366a6844aabSmrg 1367a6844aabSmrgvoid FcFontSetDestroy(FcFontSet *s); 13682c393a42Smrg 13692c393a42SmrgDescription 13702c393a42Smrg 1371a6844aabSmrgDestroys a font set. Note that this destroys any referenced patterns as well. 13722c393a42Smrg 13732c393a42SmrgVersion 13742c393a42Smrg 1375a6844aabSmrgFontconfig version 2.8.0 13762c393a42Smrg 13772c393a42SmrgFcFontSetAdd 13782c393a42Smrg 13792c393a42SmrgName 13802c393a42Smrg 1381a6844aabSmrgFcFontSetAdd -- Add to a font set 13822c393a42Smrg 13832c393a42SmrgSynopsis 13842c393a42Smrg 13852c393a42Smrg#include <fontconfig.h> 13862c393a42Smrg 1387a6844aabSmrg 1388a6844aabSmrgFcBool FcFontSetAdd(FcFontSet *s, FcPattern *font); 13892c393a42Smrg 13902c393a42SmrgDescription 13912c393a42Smrg 1392a6844aabSmrgAdds a pattern to a font set. Note that the pattern is not copied before being 1393a6844aabSmrginserted into the set. Returns FcFalse if the pattern cannot be inserted into 1394a6844aabSmrgthe set (due to allocation failure). Otherwise returns FcTrue. 13952c393a42Smrg 13962c393a42SmrgVersion 13972c393a42Smrg 1398a6844aabSmrgFontconfig version 2.8.0 13992c393a42Smrg 14002c393a42SmrgFcFontSetList 14012c393a42Smrg 14022c393a42SmrgName 14032c393a42Smrg 1404a6844aabSmrgFcFontSetList -- List fonts from a set of font sets 14052c393a42Smrg 14062c393a42SmrgSynopsis 14072c393a42Smrg 14082c393a42Smrg#include <fontconfig.h> 14092c393a42Smrg 1410a6844aabSmrg 1411a6844aabSmrgFcFontSet * FcFontSetList(FcConfig *config, FcFontSet **sets, intnsets, 1412a6844aabSmrgFcPattern *pattern, FcObjectSet *object_set); 14132c393a42Smrg 14142c393a42SmrgDescription 14152c393a42Smrg 1416a6844aabSmrgSelects fonts matching pattern from sets, creates patterns from those fonts 1417a6844aabSmrgcontaining only the objects in object_set and returns the set of unique such 1418a6844aabSmrgpatterns. If config is NULL, the default configuration is checked to be up to 1419a6844aabSmrgdate, and used. 14202c393a42Smrg 14212c393a42SmrgVersion 14222c393a42Smrg 1423a6844aabSmrgFontconfig version 2.8.0 14242c393a42Smrg 14252c393a42SmrgFcFontSetMatch 14262c393a42Smrg 14272c393a42SmrgName 14282c393a42Smrg 1429a6844aabSmrgFcFontSetMatch -- Return the best font from a set of font sets 14302c393a42Smrg 14312c393a42SmrgSynopsis 14322c393a42Smrg 14332c393a42Smrg#include <fontconfig.h> 14342c393a42Smrg 1435a6844aabSmrg 1436a6844aabSmrgFcPattern * FcFontSetMatch(FcConfig *config, FcFontSet **sets, intnsets, 1437a6844aabSmrgFcPattern *pattern, FcResult *result); 14382c393a42Smrg 14392c393a42SmrgDescription 14402c393a42Smrg 1441a6844aabSmrgFinds the font in sets most closely matching pattern and returns the result of 1442a6844aabSmrgFcFontRenderPrepare for that font and the provided pattern. This function 1443a6844aabSmrgshould be called only after FcConfigSubstitute and FcDefaultSubstitute have 1444a6844aabSmrgbeen called for pattern; otherwise the results will not be correct. If config 1445a6844aabSmrgis NULL, the current configuration is used. Returns NULL if an error occurs 1446a6844aabSmrgduring this process. 14472c393a42Smrg 14482c393a42SmrgVersion 14492c393a42Smrg 1450a6844aabSmrgFontconfig version 2.8.0 14512c393a42Smrg 14522c393a42SmrgFcFontSetPrint 14532c393a42Smrg 14542c393a42SmrgName 14552c393a42Smrg 1456a6844aabSmrgFcFontSetPrint -- Print a set of patterns to stdout 14572c393a42Smrg 14582c393a42SmrgSynopsis 14592c393a42Smrg 14602c393a42Smrg#include <fontconfig.h> 14612c393a42Smrg 1462a6844aabSmrg 1463a6844aabSmrgvoid FcFontSetPrint(FcFontSet *set); 14642c393a42Smrg 14652c393a42SmrgDescription 14662c393a42Smrg 1467a6844aabSmrgThis function is useful for diagnosing font related issues, printing the 1468a6844aabSmrgcomplete contents of every pattern in set. The format of the output is designed 1469a6844aabSmrgto be of help to users and developers, and may change at any time. 14702c393a42Smrg 14712c393a42SmrgVersion 14722c393a42Smrg 1473a6844aabSmrgFontconfig version 2.8.0 14742c393a42Smrg 14752c393a42SmrgFcFontSetSort 14762c393a42Smrg 14772c393a42SmrgName 14782c393a42Smrg 1479a6844aabSmrgFcFontSetSort -- Add to a font set 14802c393a42Smrg 14812c393a42SmrgSynopsis 14822c393a42Smrg 14832c393a42Smrg#include <fontconfig.h> 14842c393a42Smrg 1485a6844aabSmrg 1486a6844aabSmrgFcFontSetSort(FcConfig *config, FcFontSet **sets, intnsets, FcPattern *pattern, 1487a6844aabSmrgFcBool trim, FcCharSet **csp, FcResult *result); 14882c393a42Smrg 14892c393a42SmrgDescription 14902c393a42Smrg 1491a6844aabSmrgReturns the list of fonts from sets sorted by closeness to pattern. If trim is 1492a6844aabSmrgFcTrue, elements in the list which don't include Unicode coverage not provided 1493a6844aabSmrgby earlier elements in the list are elided. The union of Unicode coverage of 1494a6844aabSmrgall of the fonts is returned in csp, if csp is not NULL. This function should 1495a6844aabSmrgbe called only after FcConfigSubstitute and FcDefaultSubstitute have been 1496a6844aabSmrgcalled for p; otherwise the results will not be correct. 14972c393a42Smrg 1498a6844aabSmrgThe returned FcFontSet references FcPattern structures which may be shared by 1499a6844aabSmrgthe return value from multiple FcFontSort calls, applications cannot modify 1500a6844aabSmrgthese patterns. Instead, they should be passed, along with pattern to 1501a6844aabSmrgFcFontRenderPrepare which combines them into a complete pattern. 15022c393a42Smrg 1503a6844aabSmrgThe FcFontSet returned by FcFontSetSort is destroyed by caling 1504a6844aabSmrgFcFontSetDestroy. 15052c393a42Smrg 15062c393a42SmrgVersion 15072c393a42Smrg 1508a6844aabSmrgFontconfig version 2.8.0 15092c393a42Smrg 15102c393a42SmrgFcFontSetSortDestroy 15112c393a42Smrg 15122c393a42SmrgName 15132c393a42Smrg 1514a6844aabSmrgFcFontSetSortDestroy -- DEPRECATED destroy a font set 15152c393a42Smrg 15162c393a42SmrgSynopsis 15172c393a42Smrg 15182c393a42Smrg#include <fontconfig.h> 15192c393a42Smrg 1520a6844aabSmrg 1521a6844aabSmrgFcFontSetSortDestroy(FcFontSet *set); 15222c393a42Smrg 15232c393a42SmrgDescription 15242c393a42Smrg 1525a6844aabSmrgThis function is DEPRECATED. FcFontSetSortDestroy destroys set by calling 1526a6844aabSmrgFcFontSetDestroy. Applications should use FcFontSetDestroy directly instead. 15272c393a42Smrg 15282c393a42SmrgVersion 15292c393a42Smrg 1530a6844aabSmrgFontconfig version 2.8.0 1531a6844aabSmrg 1532a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15332c393a42Smrg 1534a6844aabSmrgFcObjectSet 15352c393a42Smrg 1536a6844aabSmrgTable of Contents 1537a6844aabSmrgFcObjectSetCreate -- Create an object set 1538a6844aabSmrgFcObjectSetAdd -- Add to an object set 1539a6844aabSmrgFcObjectSetDestroy -- Destroy an object set 1540a6844aabSmrgFcObjectSetBuild -- Build object set from args 15412c393a42Smrg 1542a6844aabSmrgAn FcObjectSet holds a list of pattern property names; it is used to indiciate 1543a6844aabSmrgwhich properties are to be returned in the patterns from FcFontList. 15442c393a42Smrg 15452c393a42SmrgFcObjectSetCreate 15462c393a42Smrg 15472c393a42SmrgName 15482c393a42Smrg 1549a6844aabSmrgFcObjectSetCreate -- Create an object set 15502c393a42Smrg 15512c393a42SmrgSynopsis 15522c393a42Smrg 15532c393a42Smrg#include <fontconfig.h> 15542c393a42Smrg 1555a6844aabSmrg 1556a6844aabSmrgFcObjectSet * FcObjectSetCreate(void); 15572c393a42Smrg 15582c393a42SmrgDescription 15592c393a42Smrg 1560a6844aabSmrgCreates an empty set. 15612c393a42Smrg 15622c393a42SmrgVersion 15632c393a42Smrg 1564a6844aabSmrgFontconfig version 2.8.0 15652c393a42Smrg 15662c393a42SmrgFcObjectSetAdd 15672c393a42Smrg 15682c393a42SmrgName 15692c393a42Smrg 1570a6844aabSmrgFcObjectSetAdd -- Add to an object set 15712c393a42Smrg 15722c393a42SmrgSynopsis 15732c393a42Smrg 15742c393a42Smrg#include <fontconfig.h> 15752c393a42Smrg 1576a6844aabSmrg 1577a6844aabSmrgFcBool FcObjectSetAdd(FcObjectSet *os, const char *object); 15782c393a42Smrg 15792c393a42SmrgDescription 15802c393a42Smrg 1581a6844aabSmrgAdds a proprety name to the set. Returns FcFalse if the property name cannot be 1582a6844aabSmrginserted into the set (due to allocation failure). Otherwise returns FcTrue. 15832c393a42Smrg 15842c393a42SmrgVersion 15852c393a42Smrg 1586a6844aabSmrgFontconfig version 2.8.0 15872c393a42Smrg 15882c393a42SmrgFcObjectSetDestroy 15892c393a42Smrg 15902c393a42SmrgName 15912c393a42Smrg 1592a6844aabSmrgFcObjectSetDestroy -- Destroy an object set 15932c393a42Smrg 15942c393a42SmrgSynopsis 15952c393a42Smrg 15962c393a42Smrg#include <fontconfig.h> 15972c393a42Smrg 1598a6844aabSmrg 1599a6844aabSmrgvoid FcObjectSetDestroy(FcObjectSet *os); 16002c393a42Smrg 16012c393a42SmrgDescription 16022c393a42Smrg 1603a6844aabSmrgDestroys an object set. 16042c393a42Smrg 16052c393a42SmrgVersion 16062c393a42Smrg 1607a6844aabSmrgFontconfig version 2.8.0 16082c393a42Smrg 16092c393a42SmrgFcObjectSetBuild 16102c393a42Smrg 16112c393a42SmrgName 16122c393a42Smrg 1613a6844aabSmrgFcObjectSetBuild, FcObjectSetVaBuild, FcObjectSetVapBuild -- Build object set 1614a6844aabSmrgfrom args 16152c393a42Smrg 16162c393a42SmrgSynopsis 16172c393a42Smrg 16182c393a42Smrg#include <fontconfig.h> 16192c393a42Smrg 16202c393a42Smrg 1621a6844aabSmrgFcObjectSet * FcObjectSetBuild(const char *first, ...); 16222c393a42Smrg 1623a6844aabSmrgFcObjectSet * FcObjectSetVaBuild(const char *first, va_list va); 1624a6844aabSmrg 1625a6844aabSmrgvoid FcObjectSetVapBuild(FcObjectSet *result, const char *first, va_list va); 16262c393a42Smrg 16272c393a42SmrgDescription 16282c393a42Smrg 1629a6844aabSmrgThese build an object set from a null-terminated list of property names. 1630a6844aabSmrgFcObjectSetVapBuild is a macro version of FcObjectSetVaBuild which returns the 1631a6844aabSmrgresult in the result variable directly. 16322c393a42Smrg 16332c393a42SmrgVersion 16342c393a42Smrg 1635a6844aabSmrgFontconfig version 2.8.0 16362c393a42Smrg 1637a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16382c393a42Smrg 1639a6844aabSmrgFreeType specific functions 16402c393a42Smrg 1641a6844aabSmrgTable of Contents 1642a6844aabSmrgFcFreeTypeCharIndex -- map Unicode to glyph id 1643a6844aabSmrgFcFreeTypeCharSet -- compute unicode coverage 1644a6844aabSmrgFcFreeTypeCharSetAndSpacing -- compute unicode coverage and spacing type 1645a6844aabSmrgFcFreeTypeQuery -- compute pattern from font file (and index) 1646a6844aabSmrgFcFreeTypeQueryFace -- compute pattern from FT_Face 16472c393a42Smrg 1648a6844aabSmrgWhile the fontconfig library doesn't insist that FreeType be used as the 1649a6844aabSmrgrasterization mechanism for fonts, it does provide some convenience functions. 16502c393a42Smrg 16512c393a42SmrgFcFreeTypeCharIndex 16522c393a42Smrg 16532c393a42SmrgName 16542c393a42Smrg 1655a6844aabSmrgFcFreeTypeCharIndex -- map Unicode to glyph id 16562c393a42Smrg 16572c393a42SmrgSynopsis 16582c393a42Smrg 16592c393a42Smrg#include <fontconfig.h> 16602c393a42Smrg#include <fcfreetype.h> 16612c393a42Smrg 1662a6844aabSmrg 1663a6844aabSmrgFT_UInt FcFreeTypeCharIndex(FT_Face face, FcChar32 ucs4); 16642c393a42Smrg 16652c393a42SmrgDescription 16662c393a42Smrg 1667a6844aabSmrgMaps a Unicode char to a glyph index. This function uses information from 1668a6844aabSmrgseveral possible underlying encoding tables to work around broken fonts. As a 1669a6844aabSmrgresult, this function isn't designed to be used in performance sensitive areas; 1670a6844aabSmrgresults from this function are intended to be cached by higher level functions. 16712c393a42Smrg 16722c393a42SmrgVersion 16732c393a42Smrg 1674a6844aabSmrgFontconfig version 2.8.0 16752c393a42Smrg 16762c393a42SmrgFcFreeTypeCharSet 16772c393a42Smrg 16782c393a42SmrgName 16792c393a42Smrg 1680a6844aabSmrgFcFreeTypeCharSet -- compute unicode coverage 16812c393a42Smrg 16822c393a42SmrgSynopsis 16832c393a42Smrg 16842c393a42Smrg#include <fontconfig.h> 16852c393a42Smrg#include <fcfreetype.h> 16862c393a42Smrg 1687a6844aabSmrg 1688a6844aabSmrgFcCharSet * FcFreeTypeCharSet(FT_Face face, FcBlanks *blanks); 16892c393a42Smrg 16902c393a42SmrgDescription 16912c393a42Smrg 1692a6844aabSmrgScans a FreeType face and returns the set of encoded Unicode chars. This scans 1693a6844aabSmrgseveral encoding tables to build as complete a list as possible. If 'blanks' is 1694a6844aabSmrgnot 0, the glyphs in the font are examined and any blank glyphs not in 'blanks' 1695a6844aabSmrgare not placed in the returned FcCharSet. 16962c393a42Smrg 16972c393a42SmrgVersion 16982c393a42Smrg 1699a6844aabSmrgFontconfig version 2.8.0 17002c393a42Smrg 17012c393a42SmrgFcFreeTypeCharSetAndSpacing 17022c393a42Smrg 17032c393a42SmrgName 17042c393a42Smrg 1705a6844aabSmrgFcFreeTypeCharSetAndSpacing -- compute unicode coverage and spacing type 17062c393a42Smrg 17072c393a42SmrgSynopsis 17082c393a42Smrg 17092c393a42Smrg#include <fontconfig.h> 17102c393a42Smrg#include <fcfreetype.h> 17112c393a42Smrg 1712a6844aabSmrg 1713a6844aabSmrgFcCharSet * FcFreeTypeCharSetAndSpacing(FT_Face face, FcBlanks *blanks, int * 1714a6844aabSmrgspacing); 17152c393a42Smrg 17162c393a42SmrgDescription 17172c393a42Smrg 1718a6844aabSmrgScans a FreeType face and returns the set of encoded Unicode chars. This scans 1719a6844aabSmrgseveral encoding tables to build as complete a list as possible. If 'blanks' is 1720a6844aabSmrgnot 0, the glyphs in the font are examined and any blank glyphs not in 'blanks' 1721a6844aabSmrgare not placed in the returned FcCharSet. spacing receives the computed spacing 1722a6844aabSmrgtype of the font, one of FC_MONO for a font where all glyphs have the same 1723a6844aabSmrgwidth, FC_DUAL, where the font has glyphs in precisely two widths, one twice as 1724a6844aabSmrgwide as the other, or FC_PROPORTIONAL where the font has glyphs of many widths. 17252c393a42Smrg 17262c393a42SmrgVersion 17272c393a42Smrg 1728a6844aabSmrgFontconfig version 2.8.0 17292c393a42Smrg 17302c393a42SmrgFcFreeTypeQuery 17312c393a42Smrg 17322c393a42SmrgName 17332c393a42Smrg 1734a6844aabSmrgFcFreeTypeQuery -- compute pattern from font file (and index) 17352c393a42Smrg 17362c393a42SmrgSynopsis 17372c393a42Smrg 17382c393a42Smrg#include <fontconfig.h> 17392c393a42Smrg#include <fcfreetype.h> 17402c393a42Smrg 1741a6844aabSmrg 1742a6844aabSmrgFcPattern * FcFreeTypeQuery(const FcChar8 *file, int id, FcBlanks *blanks, int 1743a6844aabSmrg*count); 17442c393a42Smrg 17452c393a42SmrgDescription 17462c393a42Smrg 1747a6844aabSmrgConstructs a pattern representing the 'id'th font in 'file'. The number of 1748a6844aabSmrgfonts in 'file' is returned in 'count'. 17492c393a42Smrg 17502c393a42SmrgVersion 17512c393a42Smrg 1752a6844aabSmrgFontconfig version 2.8.0 17532c393a42Smrg 17542c393a42SmrgFcFreeTypeQueryFace 17552c393a42Smrg 17562c393a42SmrgName 17572c393a42Smrg 1758a6844aabSmrgFcFreeTypeQueryFace -- compute pattern from FT_Face 17592c393a42Smrg 17602c393a42SmrgSynopsis 17612c393a42Smrg 17622c393a42Smrg#include <fontconfig.h> 17632c393a42Smrg#include <fcfreetype.h> 17642c393a42Smrg 1765a6844aabSmrg 1766a6844aabSmrgFcPattern * FcFreeTypeQueryFace(const FT_Face face, const FcChar8 *file, int id 1767a6844aabSmrg, FcBlanks *blanks); 17682c393a42Smrg 17692c393a42SmrgDescription 17702c393a42Smrg 1771a6844aabSmrgConstructs a pattern representing 'face'. 'file' and 'id' are used solely as 1772a6844aabSmrgdata for pattern elements (FC_FILE, FC_INDEX and sometimes FC_FAMILY). 17732c393a42Smrg 17742c393a42SmrgVersion 17752c393a42Smrg 1776a6844aabSmrgFontconfig version 2.8.0 1777a6844aabSmrg 1778a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17792c393a42Smrg 1780a6844aabSmrgFcValue 17812c393a42Smrg 1782a6844aabSmrgTable of Contents 1783a6844aabSmrgFcValueDestroy -- Free a value 1784a6844aabSmrgFcValueSave -- Copy a value 1785a6844aabSmrgFcValuePrint -- Print a value to stdout 1786a6844aabSmrgFcValueEqual -- Test two values for equality 17872c393a42Smrg 1788a6844aabSmrgFcValue is a structure containing a type tag and a union of all possible 1789a6844aabSmrgdatatypes. The tag is an enum of type FcType and is intended to provide a 1790a6844aabSmrgmeasure of run-time typechecking, although that depends on careful programming. 17912c393a42Smrg 17922c393a42SmrgFcValueDestroy 17932c393a42Smrg 17942c393a42SmrgName 17952c393a42Smrg 1796a6844aabSmrgFcValueDestroy -- Free a value 17972c393a42Smrg 17982c393a42SmrgSynopsis 17992c393a42Smrg 18002c393a42Smrg#include <fontconfig.h> 18012c393a42Smrg 1802a6844aabSmrg 1803a6844aabSmrgvoid FcValueDestroy(FcValue v); 18042c393a42Smrg 18052c393a42SmrgDescription 18062c393a42Smrg 1807a6844aabSmrgFrees any memory referenced by v. Values of type FcTypeString, FcTypeMatrix and 1808a6844aabSmrgFcTypeCharSet reference memory, the other types do not. 18092c393a42Smrg 18102c393a42SmrgVersion 18112c393a42Smrg 1812a6844aabSmrgFontconfig version 2.8.0 18132c393a42Smrg 18142c393a42SmrgFcValueSave 18152c393a42Smrg 18162c393a42SmrgName 18172c393a42Smrg 1818a6844aabSmrgFcValueSave -- Copy a value 18192c393a42Smrg 18202c393a42SmrgSynopsis 18212c393a42Smrg 18222c393a42Smrg#include <fontconfig.h> 18232c393a42Smrg 1824a6844aabSmrg 1825a6844aabSmrgFcValue FcValueSave(FcValue v); 18262c393a42Smrg 18272c393a42SmrgDescription 18282c393a42Smrg 1829a6844aabSmrgReturns a copy of v duplicating any object referenced by it so that v may be 1830a6844aabSmrgsafely destroyed without harming the new value. 18312c393a42Smrg 18322c393a42SmrgVersion 18332c393a42Smrg 1834a6844aabSmrgFontconfig version 2.8.0 18352c393a42Smrg 18362c393a42SmrgFcValuePrint 18372c393a42Smrg 18382c393a42SmrgName 18392c393a42Smrg 1840a6844aabSmrgFcValuePrint -- Print a value to stdout 18412c393a42Smrg 18422c393a42SmrgSynopsis 18432c393a42Smrg 18442c393a42Smrg#include <fontconfig.h> 18452c393a42Smrg 1846a6844aabSmrg 1847a6844aabSmrgvoid FcValuePrint(FcValue v); 18482c393a42Smrg 18492c393a42SmrgDescription 18502c393a42Smrg 1851a6844aabSmrgPrints a human-readable representation of v to stdout. The format should not be 1852a6844aabSmrgconsidered part of the library specification as it may change in the future. 18532c393a42Smrg 18542c393a42SmrgVersion 18552c393a42Smrg 1856a6844aabSmrgFontconfig version 2.8.0 18572c393a42Smrg 18582c393a42SmrgFcValueEqual 18592c393a42Smrg 18602c393a42SmrgName 18612c393a42Smrg 1862a6844aabSmrgFcValueEqual -- Test two values for equality 18632c393a42Smrg 18642c393a42SmrgSynopsis 18652c393a42Smrg 18662c393a42Smrg#include <fontconfig.h> 18672c393a42Smrg 1868a6844aabSmrg 1869a6844aabSmrgFcBool FcValueEqual(FcValue v_a, FcValue v_b); 18702c393a42Smrg 18712c393a42SmrgDescription 18722c393a42Smrg 1873a6844aabSmrgCompares two values. Integers and Doubles are compared as numbers; otherwise 1874a6844aabSmrgthe two values have to be the same type to be considered equal. Strings are 1875a6844aabSmrgcompared ignoring case. 18762c393a42Smrg 18772c393a42SmrgVersion 18782c393a42Smrg 1879a6844aabSmrgFontconfig version 2.8.0 18802c393a42Smrg 1881a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18822c393a42Smrg 1883a6844aabSmrgFcCharSet 18842c393a42Smrg 1885a6844aabSmrgTable of Contents 1886a6844aabSmrgFcCharSetCreate -- Create an empty character set 1887a6844aabSmrgFcCharSetDestroy -- Destroy a character set 1888a6844aabSmrgFcCharSetAddChar -- Add a character to a charset 1889a6844aabSmrgFcCharSetCopy -- Copy a charset 1890a6844aabSmrgFcCharSetEqual -- Compare two charsets 1891a6844aabSmrgFcCharSetIntersect -- Intersect charsets 1892a6844aabSmrgFcCharSetUnion -- Add charsets 1893a6844aabSmrgFcCharSetSubtract -- Subtract charsets 1894a6844aabSmrgFcCharSetMerge -- Merge charsets 1895a6844aabSmrgFcCharSetHasChar -- Check a charset for a char 1896a6844aabSmrgFcCharSetCount -- Count entries in a charset 1897a6844aabSmrgFcCharSetIntersectCount -- Intersect and count charsets 1898a6844aabSmrgFcCharSetSubtractCount -- Subtract and count charsets 1899a6844aabSmrgFcCharSetIsSubset -- Test for charset inclusion 1900a6844aabSmrgFcCharSetFirstPage -- Start enumerating charset contents 1901a6844aabSmrgFcCharSetNextPage -- Continue enumerating charset contents 1902a6844aabSmrgFcCharSetCoverage -- DEPRECATED return coverage for a Unicode page 1903a6844aabSmrgFcCharSetNew -- DEPRECATED alias for FcCharSetCreate 19042c393a42Smrg 1905a6844aabSmrgAn FcCharSet is a boolean array indicating a set of unicode chars. Those 1906a6844aabSmrgassociated with a font are marked constant and cannot be edited. FcCharSets may 1907a6844aabSmrgbe reference counted internally to reduce memory consumption; this may be 1908a6844aabSmrgvisible to applications as the result of FcCharSetCopy may return it's 1909a6844aabSmrgargument, and that CharSet may remain unmodifiable. 19102c393a42Smrg 19112c393a42SmrgFcCharSetCreate 19122c393a42Smrg 19132c393a42SmrgName 19142c393a42Smrg 1915a6844aabSmrgFcCharSetCreate -- Create an empty character set 19162c393a42Smrg 19172c393a42SmrgSynopsis 19182c393a42Smrg 19192c393a42Smrg#include <fontconfig.h> 19202c393a42Smrg 1921a6844aabSmrg 1922a6844aabSmrgFcCharSet * FcCharSetCreate(void); 19232c393a42Smrg 19242c393a42SmrgDescription 19252c393a42Smrg 1926a6844aabSmrgFcCharSetCreate allocates and initializes a new empty character set object. 19272c393a42Smrg 19282c393a42SmrgVersion 19292c393a42Smrg 1930a6844aabSmrgFontconfig version 2.8.0 19312c393a42Smrg 19322c393a42SmrgFcCharSetDestroy 19332c393a42Smrg 19342c393a42SmrgName 19352c393a42Smrg 1936a6844aabSmrgFcCharSetDestroy -- Destroy a character set 19372c393a42Smrg 19382c393a42SmrgSynopsis 19392c393a42Smrg 19402c393a42Smrg#include <fontconfig.h> 19412c393a42Smrg 1942a6844aabSmrg 1943a6844aabSmrgvoid FcCharSetDestroy(FcCharSet *fcs); 19442c393a42Smrg 19452c393a42SmrgDescription 19462c393a42Smrg 1947a6844aabSmrgFcCharSetDestroy decrements the reference count fcs. If the reference count 1948a6844aabSmrgbecomes zero, all memory referenced is freed. 19492c393a42Smrg 19502c393a42SmrgVersion 19512c393a42Smrg 1952a6844aabSmrgFontconfig version 2.8.0 19532c393a42Smrg 19542c393a42SmrgFcCharSetAddChar 19552c393a42Smrg 19562c393a42SmrgName 19572c393a42Smrg 1958a6844aabSmrgFcCharSetAddChar -- Add a character to a charset 19592c393a42Smrg 19602c393a42SmrgSynopsis 19612c393a42Smrg 19622c393a42Smrg#include <fontconfig.h> 19632c393a42Smrg 1964a6844aabSmrg 1965a6844aabSmrgFcBool FcCharSetAddChar(FcCharSet *fcs, FcChar32 ucs4); 19662c393a42Smrg 19672c393a42SmrgDescription 19682c393a42Smrg 1969a6844aabSmrgFcCharSetAddChar adds a single unicode char to the set, returning FcFalse on 1970a6844aabSmrgfailure, either as a result of a constant set or from running out of memory. 19712c393a42Smrg 19722c393a42SmrgVersion 19732c393a42Smrg 1974a6844aabSmrgFontconfig version 2.8.0 19752c393a42Smrg 19762c393a42SmrgFcCharSetCopy 19772c393a42Smrg 19782c393a42SmrgName 19792c393a42Smrg 1980a6844aabSmrgFcCharSetCopy -- Copy a charset 19812c393a42Smrg 19822c393a42SmrgSynopsis 19832c393a42Smrg 19842c393a42Smrg#include <fontconfig.h> 19852c393a42Smrg 1986a6844aabSmrg 1987a6844aabSmrgFcCharSet * FcCharSetCopy(FcCharSet *src); 19882c393a42Smrg 19892c393a42SmrgDescription 19902c393a42Smrg 1991a6844aabSmrgMakes a copy of src; note that this may not actually do anything more than 1992a6844aabSmrgincrement the reference count on src. 19932c393a42Smrg 19942c393a42SmrgVersion 19952c393a42Smrg 1996a6844aabSmrgFontconfig version 2.8.0 19972c393a42Smrg 19982c393a42SmrgFcCharSetEqual 19992c393a42Smrg 20002c393a42SmrgName 20012c393a42Smrg 2002a6844aabSmrgFcCharSetEqual -- Compare two charsets 20032c393a42Smrg 20042c393a42SmrgSynopsis 20052c393a42Smrg 20062c393a42Smrg#include <fontconfig.h> 20072c393a42Smrg 2008a6844aabSmrg 2009a6844aabSmrgFcBool FcCharSetEqual(const FcCharSet *a, const FcCharSet *b); 20102c393a42Smrg 20112c393a42SmrgDescription 20122c393a42Smrg 2013a6844aabSmrgReturns whether a and b contain the same set of unicode chars. 20142c393a42Smrg 20152c393a42SmrgVersion 20162c393a42Smrg 2017a6844aabSmrgFontconfig version 2.8.0 20182c393a42Smrg 20192c393a42SmrgFcCharSetIntersect 20202c393a42Smrg 20212c393a42SmrgName 20222c393a42Smrg 2023a6844aabSmrgFcCharSetIntersect -- Intersect charsets 20242c393a42Smrg 20252c393a42SmrgSynopsis 20262c393a42Smrg 20272c393a42Smrg#include <fontconfig.h> 20282c393a42Smrg 2029a6844aabSmrg 2030a6844aabSmrgFcCharSet * FcCharSetIntersect(const FcCharSet *a, const FcCharSet *b); 20312c393a42Smrg 20322c393a42SmrgDescription 20332c393a42Smrg 2034a6844aabSmrgReturns a set including only those chars found in both a and b. 20352c393a42Smrg 20362c393a42SmrgVersion 20372c393a42Smrg 2038a6844aabSmrgFontconfig version 2.8.0 20392c393a42Smrg 20402c393a42SmrgFcCharSetUnion 20412c393a42Smrg 20422c393a42SmrgName 20432c393a42Smrg 2044a6844aabSmrgFcCharSetUnion -- Add charsets 20452c393a42Smrg 20462c393a42SmrgSynopsis 20472c393a42Smrg 20482c393a42Smrg#include <fontconfig.h> 20492c393a42Smrg 2050a6844aabSmrg 2051a6844aabSmrgFcCharSet * FcCharSetUnion(const FcCharSet *a, const FcCharSet *b); 20522c393a42Smrg 20532c393a42SmrgDescription 20542c393a42Smrg 2055a6844aabSmrgReturns a set including only those chars found in either a or b. 20562c393a42Smrg 20572c393a42SmrgVersion 20582c393a42Smrg 2059a6844aabSmrgFontconfig version 2.8.0 20602c393a42Smrg 20612c393a42SmrgFcCharSetSubtract 20622c393a42Smrg 20632c393a42SmrgName 20642c393a42Smrg 2065a6844aabSmrgFcCharSetSubtract -- Subtract charsets 20662c393a42Smrg 20672c393a42SmrgSynopsis 20682c393a42Smrg 20692c393a42Smrg#include <fontconfig.h> 20702c393a42Smrg 2071a6844aabSmrg 2072a6844aabSmrgFcCharSet * FcCharSetSubtract(const FcCharSet *a, const FcCharSet *b); 20732c393a42Smrg 20742c393a42SmrgDescription 20752c393a42Smrg 2076a6844aabSmrgReturns a set including only those chars found in a but not b. 20772c393a42Smrg 20782c393a42SmrgVersion 20792c393a42Smrg 2080a6844aabSmrgFontconfig version 2.8.0 2081a6844aabSmrg 2082a6844aabSmrgFcCharSetMerge 2083a6844aabSmrg 2084a6844aabSmrgName 2085a6844aabSmrg 2086a6844aabSmrgFcCharSetMerge -- Merge charsets 2087a6844aabSmrg 2088a6844aabSmrgSynopsis 2089a6844aabSmrg 2090a6844aabSmrg#include <fontconfig.h> 2091a6844aabSmrg 2092a6844aabSmrg 2093a6844aabSmrgFcBool FcCharSetMerge(FcCharSet *a, const FcCharSet *b, FcBool *changed); 2094a6844aabSmrg 2095a6844aabSmrgDescription 2096a6844aabSmrg 2097a6844aabSmrgAdds all chars in b to a. In other words, this is an in-place version of 2098a6844aabSmrgFcCharSetUnion. If changed is not NULL, then it returns whether any new chars 2099a6844aabSmrgfrom b were added to a. Returns FcFalse on failure, either when a is a constant 2100a6844aabSmrgset or from running out of memory. 2101a6844aabSmrg 2102a6844aabSmrgVersion 2103a6844aabSmrg 2104a6844aabSmrgFontconfig version 2.8.0 21052c393a42Smrg 21062c393a42SmrgFcCharSetHasChar 21072c393a42Smrg 21082c393a42SmrgName 21092c393a42Smrg 2110a6844aabSmrgFcCharSetHasChar -- Check a charset for a char 21112c393a42Smrg 21122c393a42SmrgSynopsis 21132c393a42Smrg 21142c393a42Smrg#include <fontconfig.h> 21152c393a42Smrg 2116a6844aabSmrg 2117a6844aabSmrgFcBool FcCharSetHasChar(const FcCharSet *fcs, FcChar32 ucs4); 21182c393a42Smrg 21192c393a42SmrgDescription 21202c393a42Smrg 2121a6844aabSmrgReturns whether fcs contains the char ucs4. 21222c393a42Smrg 21232c393a42SmrgVersion 21242c393a42Smrg 2125a6844aabSmrgFontconfig version 2.8.0 21262c393a42Smrg 21272c393a42SmrgFcCharSetCount 21282c393a42Smrg 21292c393a42SmrgName 21302c393a42Smrg 2131a6844aabSmrgFcCharSetCount -- Count entries in a charset 21322c393a42Smrg 21332c393a42SmrgSynopsis 21342c393a42Smrg 21352c393a42Smrg#include <fontconfig.h> 21362c393a42Smrg 2137a6844aabSmrg 2138a6844aabSmrgFcChar32 FcCharSetCount(const FcCharSet *a); 21392c393a42Smrg 21402c393a42SmrgDescription 21412c393a42Smrg 2142a6844aabSmrgReturns the total number of unicode chars in a. 21432c393a42Smrg 21442c393a42SmrgVersion 21452c393a42Smrg 2146a6844aabSmrgFontconfig version 2.8.0 21472c393a42Smrg 21482c393a42SmrgFcCharSetIntersectCount 21492c393a42Smrg 21502c393a42SmrgName 21512c393a42Smrg 2152a6844aabSmrgFcCharSetIntersectCount -- Intersect and count charsets 21532c393a42Smrg 21542c393a42SmrgSynopsis 21552c393a42Smrg 21562c393a42Smrg#include <fontconfig.h> 21572c393a42Smrg 2158a6844aabSmrg 2159a6844aabSmrgFcChar32 FcCharSetIntersectCount(const FcCharSet *a, const FcCharSet *b); 21602c393a42Smrg 21612c393a42SmrgDescription 21622c393a42Smrg 2163a6844aabSmrgReturns the number of chars that are in both a and b. 21642c393a42Smrg 21652c393a42SmrgVersion 21662c393a42Smrg 2167a6844aabSmrgFontconfig version 2.8.0 21682c393a42Smrg 21692c393a42SmrgFcCharSetSubtractCount 21702c393a42Smrg 21712c393a42SmrgName 21722c393a42Smrg 2173a6844aabSmrgFcCharSetSubtractCount -- Subtract and count charsets 21742c393a42Smrg 21752c393a42SmrgSynopsis 21762c393a42Smrg 21772c393a42Smrg#include <fontconfig.h> 21782c393a42Smrg 2179a6844aabSmrg 2180a6844aabSmrgFcChar32 FcCharSetSubtractCount(const FcCharSet *a, const FcCharSet *b); 21812c393a42Smrg 21822c393a42SmrgDescription 21832c393a42Smrg 2184a6844aabSmrgReturns the number of chars that are in a but not in b. 21852c393a42Smrg 21862c393a42SmrgVersion 21872c393a42Smrg 2188a6844aabSmrgFontconfig version 2.8.0 21892c393a42Smrg 21902c393a42SmrgFcCharSetIsSubset 21912c393a42Smrg 21922c393a42SmrgName 21932c393a42Smrg 2194a6844aabSmrgFcCharSetIsSubset -- Test for charset inclusion 21952c393a42Smrg 21962c393a42SmrgSynopsis 21972c393a42Smrg 21982c393a42Smrg#include <fontconfig.h> 21992c393a42Smrg 2200a6844aabSmrg 2201a6844aabSmrgFcBool FcCharSetIsSubset(const FcCharSet *a, const FcCharSet *b); 22022c393a42Smrg 22032c393a42SmrgDescription 22042c393a42Smrg 2205a6844aabSmrgReturns whether a is a subset of b. 22062c393a42Smrg 22072c393a42SmrgVersion 22082c393a42Smrg 2209a6844aabSmrgFontconfig version 2.8.0 22102c393a42Smrg 22112c393a42SmrgFcCharSetFirstPage 22122c393a42Smrg 22132c393a42SmrgName 22142c393a42Smrg 2215a6844aabSmrgFcCharSetFirstPage -- Start enumerating charset contents 22162c393a42Smrg 22172c393a42SmrgSynopsis 22182c393a42Smrg 22192c393a42Smrg#include <fontconfig.h> 22202c393a42Smrg 2221a6844aabSmrg 2222a6844aabSmrgFcChar32 FcCharSetFirstPage(const FcCharSet *a, FcChar32[FC_CHARSET_MAP_SIZE] 2223a6844aabSmrgmap, FcChar32 *next); 22242c393a42Smrg 22252c393a42SmrgDescription 22262c393a42Smrg 2227a6844aabSmrgBuilds an array of bits marking the first page of Unicode coverage of a. 2228a6844aabSmrgReturns the base of the array. next contains the next page in the font. 22292c393a42Smrg 22302c393a42SmrgVersion 22312c393a42Smrg 2232a6844aabSmrgFontconfig version 2.8.0 22332c393a42Smrg 22342c393a42SmrgFcCharSetNextPage 22352c393a42Smrg 22362c393a42SmrgName 22372c393a42Smrg 2238a6844aabSmrgFcCharSetNextPage -- Continue enumerating charset contents 22392c393a42Smrg 22402c393a42SmrgSynopsis 22412c393a42Smrg 22422c393a42Smrg#include <fontconfig.h> 22432c393a42Smrg 2244a6844aabSmrg 2245a6844aabSmrgFcChar32 FcCharSetNextPage(const FcCharSet *a, FcChar32[FC_CHARSET_MAP_SIZE] 2246a6844aabSmrgmap, FcChar32 *next); 22472c393a42Smrg 22482c393a42SmrgDescription 22492c393a42Smrg 2250a6844aabSmrgBuilds an array of bits marking the Unicode coverage of a for page *next. 2251a6844aabSmrgReturns the base of the array. next contains the next page in the font. 22522c393a42Smrg 22532c393a42SmrgVersion 22542c393a42Smrg 2255a6844aabSmrgFontconfig version 2.8.0 22562c393a42Smrg 22572c393a42SmrgFcCharSetCoverage 22582c393a42Smrg 22592c393a42SmrgName 22602c393a42Smrg 2261a6844aabSmrgFcCharSetCoverage -- DEPRECATED return coverage for a Unicode page 22622c393a42Smrg 22632c393a42SmrgSynopsis 22642c393a42Smrg 22652c393a42Smrg#include <fontconfig.h> 22662c393a42Smrg 2267a6844aabSmrg 2268a6844aabSmrgFcChar32 FcCharSetCoverage(const FcCharSet *a, FcChar32page, FcChar32[8]result 2269a6844aabSmrg); 22702c393a42Smrg 22712c393a42SmrgDescription 22722c393a42Smrg 2273a6844aabSmrgDEPRECATED This function returns a bitmask in result which indicates which code 2274a6844aabSmrgpoints in page are included in a. FcCharSetCoverage returns the next page in 2275a6844aabSmrgthe charset which has any coverage. 22762c393a42Smrg 22772c393a42SmrgVersion 22782c393a42Smrg 2279a6844aabSmrgFontconfig version 2.8.0 22802c393a42Smrg 22812c393a42SmrgFcCharSetNew 22822c393a42Smrg 22832c393a42SmrgName 22842c393a42Smrg 2285a6844aabSmrgFcCharSetNew -- DEPRECATED alias for FcCharSetCreate 22862c393a42Smrg 22872c393a42SmrgSynopsis 22882c393a42Smrg 22892c393a42Smrg#include <fontconfig.h> 22902c393a42Smrg 2291a6844aabSmrg 2292a6844aabSmrgFcCharSet * FcCharSetNew(void); 22932c393a42Smrg 22942c393a42SmrgDescription 22952c393a42Smrg 2296a6844aabSmrgFcCharSetNew is a DEPRECATED alias for FcCharSetCreate. 22972c393a42Smrg 22982c393a42SmrgVersion 22992c393a42Smrg 2300a6844aabSmrgFontconfig version 2.8.0 2301a6844aabSmrg 2302a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23032c393a42Smrg 2304a6844aabSmrgFcLangSet 23052c393a42Smrg 2306a6844aabSmrgTable of Contents 2307a6844aabSmrgFcLangSetCreate -- create a langset object 2308a6844aabSmrgFcLangSetDestroy -- destroy a langset object 2309a6844aabSmrgFcLangSetCopy -- copy a langset object 2310a6844aabSmrgFcLangSetAdd -- add a language to a langset 2311a6844aabSmrgFcLangSetCompare -- compare language sets 2312a6844aabSmrgFcLangSetContains -- check langset subset relation 2313a6844aabSmrgFcLangSetEqual -- test for matching langsets 2314a6844aabSmrgFcLangSetHash -- return a hash value for a langset 2315a6844aabSmrgFcLangSetHasLang -- test langset for language support 2316a6844aabSmrgFcLangSetGetLangs -- get the list of languages in the langset 2317a6844aabSmrgFcGetLangs -- Get list of languages 2318a6844aabSmrgFcLangGetCharSet -- Get character map for a language 23192c393a42Smrg 2320a6844aabSmrgAn FcLangSet is a set of language names (each of which include language and an 2321a6844aabSmrgoptional territory). They are used when selecting fonts to indicate which 2322a6844aabSmrglanguages the fonts need to support. Each font is marked, using language 2323a6844aabSmrgorthography information built into fontconfig, with the set of supported 2324a6844aabSmrglanguages. 23252c393a42Smrg 23262c393a42SmrgFcLangSetCreate 23272c393a42Smrg 23282c393a42SmrgName 23292c393a42Smrg 2330a6844aabSmrgFcLangSetCreate -- create a langset object 23312c393a42Smrg 23322c393a42SmrgSynopsis 23332c393a42Smrg 23342c393a42Smrg#include <fontconfig.h> 23352c393a42Smrg 2336a6844aabSmrg 2337a6844aabSmrgFcLangSet * FcLangSetCreate(void); 23382c393a42Smrg 23392c393a42SmrgDescription 23402c393a42Smrg 2341a6844aabSmrgFcLangSetCreate creates a new FcLangSet object. 23422c393a42Smrg 23432c393a42SmrgVersion 23442c393a42Smrg 2345a6844aabSmrgFontconfig version 2.8.0 23462c393a42Smrg 23472c393a42SmrgFcLangSetDestroy 23482c393a42Smrg 23492c393a42SmrgName 23502c393a42Smrg 2351a6844aabSmrgFcLangSetDestroy -- destroy a langset object 23522c393a42Smrg 23532c393a42SmrgSynopsis 23542c393a42Smrg 23552c393a42Smrg#include <fontconfig.h> 23562c393a42Smrg 2357a6844aabSmrg 2358a6844aabSmrgvoid FcLangSetDestroy(FcLangSet *ls); 23592c393a42Smrg 23602c393a42SmrgDescription 23612c393a42Smrg 2362a6844aabSmrgFcLangSetDestroy destroys a FcLangSet object, freeing all memory associated 2363a6844aabSmrgwith it. 23642c393a42Smrg 23652c393a42SmrgVersion 23662c393a42Smrg 2367a6844aabSmrgFontconfig version 2.8.0 23682c393a42Smrg 23692c393a42SmrgFcLangSetCopy 23702c393a42Smrg 23712c393a42SmrgName 23722c393a42Smrg 2373a6844aabSmrgFcLangSetCopy -- copy a langset object 23742c393a42Smrg 23752c393a42SmrgSynopsis 23762c393a42Smrg 23772c393a42Smrg#include <fontconfig.h> 23782c393a42Smrg 2379a6844aabSmrg 2380a6844aabSmrgFcLangSet * FcLangSetCopy(const FcLangSet *ls); 23812c393a42Smrg 23822c393a42SmrgDescription 23832c393a42Smrg 2384a6844aabSmrgFcLangSetCopy creates a new FcLangSet object and populates it with the contents 2385a6844aabSmrgof ls. 23862c393a42Smrg 23872c393a42SmrgVersion 23882c393a42Smrg 2389a6844aabSmrgFontconfig version 2.8.0 23902c393a42Smrg 23912c393a42SmrgFcLangSetAdd 23922c393a42Smrg 23932c393a42SmrgName 23942c393a42Smrg 2395a6844aabSmrgFcLangSetAdd -- add a language to a langset 23962c393a42Smrg 23972c393a42SmrgSynopsis 23982c393a42Smrg 23992c393a42Smrg#include <fontconfig.h> 24002c393a42Smrg 2401a6844aabSmrg 2402a6844aabSmrgFcBool FcLangSetAdd(FcLangSet *ls, const FcChar8 *lang); 24032c393a42Smrg 24042c393a42SmrgDescription 24052c393a42Smrg 2406a6844aabSmrglang is added to ls. lang should be of the form Ll-Tt where Ll is a two or 2407a6844aabSmrgthree letter language from ISO 639 and Tt is a territory from ISO 3166. 24082c393a42Smrg 24092c393a42SmrgVersion 24102c393a42Smrg 2411a6844aabSmrgFontconfig version 2.8.0 24122c393a42Smrg 24132c393a42SmrgFcLangSetCompare 24142c393a42Smrg 24152c393a42SmrgName 24162c393a42Smrg 2417a6844aabSmrgFcLangSetCompare -- compare language sets 24182c393a42Smrg 24192c393a42SmrgSynopsis 24202c393a42Smrg 24212c393a42Smrg#include <fontconfig.h> 24222c393a42Smrg 2423a6844aabSmrg 2424a6844aabSmrgFcLangResult FcLangSetCompare(const FcLangSet *ls_a, const FcLangSet *ls_b); 24252c393a42Smrg 24262c393a42SmrgDescription 24272c393a42Smrg 2428a6844aabSmrgFcLangSetCompare compares language coverage for ls_a and ls_b. If they share 2429a6844aabSmrgany language and territory pair, this function returns FcLangEqual. If they 2430a6844aabSmrgshare a language but differ in which territory that language is for, this 2431a6844aabSmrgfunction returns FcLangDiffentTerritory. If they share no languages in common, 2432a6844aabSmrgthis function returns FcLangDifferentLang. 24332c393a42Smrg 24342c393a42SmrgVersion 24352c393a42Smrg 2436a6844aabSmrgFontconfig version 2.8.0 24372c393a42Smrg 24382c393a42SmrgFcLangSetContains 24392c393a42Smrg 24402c393a42SmrgName 24412c393a42Smrg 2442a6844aabSmrgFcLangSetContains -- check langset subset relation 24432c393a42Smrg 24442c393a42SmrgSynopsis 24452c393a42Smrg 24462c393a42Smrg#include <fontconfig.h> 24472c393a42Smrg 2448a6844aabSmrg 2449a6844aabSmrgFcBool FcLangSetContains(const FcLangSet *ls_a, const FcLangSet *ls_b); 24502c393a42Smrg 24512c393a42SmrgDescription 24522c393a42Smrg 2453a6844aabSmrgFcLangSetContains returns FcTrue if ls_a contains every language in ls_b. ls_a 2454a6844aabSmrgwill 'contain' a language from ls_b if ls_a has exactly the language, or either 2455a6844aabSmrgthe language or ls_a has no territory. 24562c393a42Smrg 24572c393a42SmrgVersion 24582c393a42Smrg 2459a6844aabSmrgFontconfig version 2.8.0 24602c393a42Smrg 24612c393a42SmrgFcLangSetEqual 24622c393a42Smrg 24632c393a42SmrgName 24642c393a42Smrg 2465a6844aabSmrgFcLangSetEqual -- test for matching langsets 24662c393a42Smrg 24672c393a42SmrgSynopsis 24682c393a42Smrg 24692c393a42Smrg#include <fontconfig.h> 24702c393a42Smrg 2471a6844aabSmrg 2472a6844aabSmrgFcBool FcLangSetEqual(const FcLangSet *ls_a, const FcLangSet *ls_b); 24732c393a42Smrg 24742c393a42SmrgDescription 24752c393a42Smrg 2476a6844aabSmrgReturns FcTrue if and only if ls_a supports precisely the same language and 2477a6844aabSmrgterritory combinations as ls_b. 24782c393a42Smrg 24792c393a42SmrgVersion 24802c393a42Smrg 2481a6844aabSmrgFontconfig version 2.8.0 24822c393a42Smrg 24832c393a42SmrgFcLangSetHash 24842c393a42Smrg 24852c393a42SmrgName 24862c393a42Smrg 2487a6844aabSmrgFcLangSetHash -- return a hash value for a langset 24882c393a42Smrg 24892c393a42SmrgSynopsis 24902c393a42Smrg 24912c393a42Smrg#include <fontconfig.h> 24922c393a42Smrg 2493a6844aabSmrg 2494a6844aabSmrgFcChar32 FcLangSetHash(const FcLangSet *ls); 24952c393a42Smrg 24962c393a42SmrgDescription 24972c393a42Smrg 2498a6844aabSmrgThis function returns a value which depends solely on the languages supported 2499a6844aabSmrgby ls. Any language which equals ls will have the same result from 2500a6844aabSmrgFcLangSetHash. However, two langsets with the same hash value may not be equal. 25012c393a42Smrg 25022c393a42SmrgVersion 25032c393a42Smrg 2504a6844aabSmrgFontconfig version 2.8.0 25052c393a42Smrg 25062c393a42SmrgFcLangSetHasLang 25072c393a42Smrg 25082c393a42SmrgName 25092c393a42Smrg 2510a6844aabSmrgFcLangSetHasLang -- test langset for language support 2511a6844aabSmrg 2512a6844aabSmrgSynopsis 2513a6844aabSmrg 2514a6844aabSmrg#include <fontconfig.h> 2515a6844aabSmrg 2516a6844aabSmrg 2517a6844aabSmrgFcLangResult FcLangSetHasLang(const FcLangSet *ls, const FcChar8 *lang); 2518a6844aabSmrg 2519a6844aabSmrgDescription 2520a6844aabSmrg 2521a6844aabSmrgFcLangSetHasLang checks whether ls supports lang. If ls has a matching language 2522a6844aabSmrgand territory pair, this function returns FcLangEqual. If ls has a matching 2523a6844aabSmrglanguage but differs in which territory that language is for, this function 2524a6844aabSmrgreturns FcLangDiffentTerritory. If ls has no matching language, this function 2525a6844aabSmrgreturns FcLangDifferentLang. 2526a6844aabSmrg 2527a6844aabSmrgVersion 2528a6844aabSmrg 2529a6844aabSmrgFontconfig version 2.8.0 2530a6844aabSmrg 2531a6844aabSmrgFcLangSetGetLangs 2532a6844aabSmrg 2533a6844aabSmrgName 2534a6844aabSmrg 2535a6844aabSmrgFcLangSetGetLangs -- get the list of languages in the langset 25362c393a42Smrg 25372c393a42SmrgSynopsis 25382c393a42Smrg 25392c393a42Smrg#include <fontconfig.h> 25402c393a42Smrg 2541a6844aabSmrg 2542a6844aabSmrgFcStrSet * FcLangSetGetLangs(const FcLangSet *ls); 25432c393a42Smrg 25442c393a42SmrgDescription 25452c393a42Smrg 2546a6844aabSmrgReturns a string set of all languages in langset. 25472c393a42Smrg 25482c393a42SmrgVersion 25492c393a42Smrg 2550a6844aabSmrgFontconfig version 2.8.0 25512c393a42Smrg 25522c393a42SmrgFcGetLangs 25532c393a42Smrg 25542c393a42SmrgName 25552c393a42Smrg 2556a6844aabSmrgFcGetLangs -- Get list of languages 25572c393a42Smrg 25582c393a42SmrgSynopsis 25592c393a42Smrg 25602c393a42Smrg#include <fontconfig.h> 25612c393a42Smrg 2562a6844aabSmrg 2563a6844aabSmrgFcStrSet * FcGetLangs(void); 25642c393a42Smrg 25652c393a42SmrgDescription 25662c393a42Smrg 2567a6844aabSmrgReturns a string set of all known languages. 25682c393a42Smrg 25692c393a42SmrgVersion 25702c393a42Smrg 2571a6844aabSmrgFontconfig version 2.8.0 25722c393a42Smrg 25732c393a42SmrgFcLangGetCharSet 25742c393a42Smrg 25752c393a42SmrgName 25762c393a42Smrg 2577a6844aabSmrgFcLangGetCharSet -- Get character map for a language 25782c393a42Smrg 25792c393a42SmrgSynopsis 25802c393a42Smrg 25812c393a42Smrg#include <fontconfig.h> 25822c393a42Smrg 2583a6844aabSmrg 2584a6844aabSmrgconst FcCharSet * FcLangGetCharSet(const FcChar8 *lang); 25852c393a42Smrg 25862c393a42SmrgDescription 25872c393a42Smrg 2588a6844aabSmrgReturns the FcCharMap for a language. 25892c393a42Smrg 25902c393a42SmrgVersion 25912c393a42Smrg 2592a6844aabSmrgFontconfig version 2.8.0 2593a6844aabSmrg 2594a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 25952c393a42Smrg 2596a6844aabSmrgFcMatrix 25972c393a42Smrg 2598a6844aabSmrgTable of Contents 2599a6844aabSmrgFcMatrixInit -- initialize an FcMatrix structure 2600a6844aabSmrgFcMatrixCopy -- Copy a matrix 2601a6844aabSmrgFcMatrixEqual -- Compare two matrices 2602a6844aabSmrgFcMatrixMultiply -- Multiply matrices 2603a6844aabSmrgFcMatrixRotate -- Rotate a matrix 2604a6844aabSmrgFcMatrixScale -- Scale a matrix 2605a6844aabSmrgFcMatrixShear -- Shear a matrix 26062c393a42Smrg 2607a6844aabSmrgFcMatrix structures hold an affine transformation in matrix form. 26082c393a42Smrg 26092c393a42SmrgFcMatrixInit 26102c393a42Smrg 26112c393a42SmrgName 26122c393a42Smrg 2613a6844aabSmrgFcMatrixInit -- initialize an FcMatrix structure 26142c393a42Smrg 26152c393a42SmrgSynopsis 26162c393a42Smrg 26172c393a42Smrg#include <fontconfig.h> 26182c393a42Smrg 2619a6844aabSmrg 2620a6844aabSmrgvoid FcMatrixInit(FcMatrix *matrix); 26212c393a42Smrg 26222c393a42SmrgDescription 26232c393a42Smrg 2624a6844aabSmrgFcMatrixInit initializes matrix to the identity matrix. 26252c393a42Smrg 26262c393a42SmrgVersion 26272c393a42Smrg 2628a6844aabSmrgFontconfig version 2.8.0 26292c393a42Smrg 26302c393a42SmrgFcMatrixCopy 26312c393a42Smrg 26322c393a42SmrgName 26332c393a42Smrg 2634a6844aabSmrgFcMatrixCopy -- Copy a matrix 26352c393a42Smrg 26362c393a42SmrgSynopsis 26372c393a42Smrg 26382c393a42Smrg#include <fontconfig.h> 26392c393a42Smrg 2640a6844aabSmrg 2641a6844aabSmrgvoid FcMatrixCopy(const FcMatrix *matrix); 26422c393a42Smrg 26432c393a42SmrgDescription 26442c393a42Smrg 2645a6844aabSmrgFcMatrixCopy allocates a new FcMatrix and copies mat into it. 26462c393a42Smrg 26472c393a42SmrgVersion 26482c393a42Smrg 2649a6844aabSmrgFontconfig version 2.8.0 26502c393a42Smrg 26512c393a42SmrgFcMatrixEqual 26522c393a42Smrg 26532c393a42SmrgName 26542c393a42Smrg 2655a6844aabSmrgFcMatrixEqual -- Compare two matrices 26562c393a42Smrg 26572c393a42SmrgSynopsis 26582c393a42Smrg 26592c393a42Smrg#include <fontconfig.h> 26602c393a42Smrg 2661a6844aabSmrg 2662a6844aabSmrgvoid FcMatrixEqual(const FcMatrix *matrix1, const FcMatrix *matrix2); 26632c393a42Smrg 26642c393a42SmrgDescription 26652c393a42Smrg 2666a6844aabSmrgFcMatrixEqual compares matrix1 and matrix2 returning FcTrue when they are equal 2667a6844aabSmrgand FcFalse when they are not. 26682c393a42Smrg 26692c393a42SmrgVersion 26702c393a42Smrg 2671a6844aabSmrgFontconfig version 2.8.0 26722c393a42Smrg 26732c393a42SmrgFcMatrixMultiply 26742c393a42Smrg 26752c393a42SmrgName 26762c393a42Smrg 2677a6844aabSmrgFcMatrixMultiply -- Multiply matrices 26782c393a42Smrg 26792c393a42SmrgSynopsis 26802c393a42Smrg 26812c393a42Smrg#include <fontconfig.h> 26822c393a42Smrg 2683a6844aabSmrg 2684a6844aabSmrgvoid FcMatrixMultiply(FcMatrix *result, const FcMatrix *matrix1, const FcMatrix 2685a6844aabSmrg*matrix2); 26862c393a42Smrg 26872c393a42SmrgDescription 26882c393a42Smrg 2689a6844aabSmrgFcMatrixMultiply multiplies matrix1 and matrix2 storing the result in result. 26902c393a42Smrg 26912c393a42SmrgVersion 26922c393a42Smrg 2693a6844aabSmrgFontconfig version 2.8.0 26942c393a42Smrg 26952c393a42SmrgFcMatrixRotate 26962c393a42Smrg 26972c393a42SmrgName 26982c393a42Smrg 2699a6844aabSmrgFcMatrixRotate -- Rotate a matrix 27002c393a42Smrg 27012c393a42SmrgSynopsis 27022c393a42Smrg 27032c393a42Smrg#include <fontconfig.h> 27042c393a42Smrg 2705a6844aabSmrg 2706a6844aabSmrgvoid FcMatrixRotate(FcMatrix *matrix, double cos, double sin); 27072c393a42Smrg 27082c393a42SmrgDescription 27092c393a42Smrg 2710a6844aabSmrgFcMatrixRotate rotates matrix by the angle who's sine is sin and cosine is cos. 2711a6844aabSmrgThis is done by multiplying by the matrix: 2712a6844aabSmrg 27132c393a42Smrg cos -sin 27142c393a42Smrg sin cos 27152c393a42Smrg 27162c393a42SmrgVersion 27172c393a42Smrg 2718a6844aabSmrgFontconfig version 2.8.0 27192c393a42Smrg 27202c393a42SmrgFcMatrixScale 27212c393a42Smrg 27222c393a42SmrgName 27232c393a42Smrg 2724a6844aabSmrgFcMatrixScale -- Scale a matrix 27252c393a42Smrg 27262c393a42SmrgSynopsis 27272c393a42Smrg 27282c393a42Smrg#include <fontconfig.h> 27292c393a42Smrg 2730a6844aabSmrg 2731a6844aabSmrgvoid FcMatrixScale(FcMatrix *matrix, double sx, double dy); 27322c393a42Smrg 27332c393a42SmrgDescription 27342c393a42Smrg 2735a6844aabSmrgFcMatrixScale multiplies matrix x values by sx and y values by sy. This is done 2736a6844aabSmrgby multiplying by the matrix: 2737a6844aabSmrg 27382c393a42Smrg sx 0 27392c393a42Smrg 0 sy 27402c393a42Smrg 27412c393a42SmrgVersion 27422c393a42Smrg 2743a6844aabSmrgFontconfig version 2.8.0 27442c393a42Smrg 27452c393a42SmrgFcMatrixShear 27462c393a42Smrg 27472c393a42SmrgName 27482c393a42Smrg 2749a6844aabSmrgFcMatrixShear -- Shear a matrix 27502c393a42Smrg 27512c393a42SmrgSynopsis 27522c393a42Smrg 27532c393a42Smrg#include <fontconfig.h> 27542c393a42Smrg 2755a6844aabSmrg 2756a6844aabSmrgvoid FcMatrixShear(FcMatrix *matrix, double sh, double sv); 27572c393a42Smrg 27582c393a42SmrgDescription 27592c393a42Smrg 2760a6844aabSmrgFcMatrixShare shears matrix horizontally by sh and vertically by sv. This is 2761a6844aabSmrgdone by multiplying by the matrix: 2762a6844aabSmrg 27632c393a42Smrg 1 sh 27642c393a42Smrg sv 1 27652c393a42Smrg 27662c393a42SmrgVersion 27672c393a42Smrg 2768a6844aabSmrgFontconfig version 2.8.0 2769a6844aabSmrg 2770a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2771a6844aabSmrg 2772a6844aabSmrgFcConfig 2773a6844aabSmrg 2774a6844aabSmrgTable of Contents 2775a6844aabSmrgFcConfigCreate -- Create a configuration 2776a6844aabSmrgFcConfigReference -- Increment config reference count 2777a6844aabSmrgFcConfigDestroy -- Destroy a configuration 2778a6844aabSmrgFcConfigSetCurrent -- Set configuration as default 2779a6844aabSmrgFcConfigGetCurrent -- Return current configuration 2780a6844aabSmrgFcConfigUptoDate -- Check timestamps on config files 2781a6844aabSmrgFcConfigHome -- return the current home directory. 2782a6844aabSmrgFcConfigEnableHome -- controls use of the home directory. 2783a6844aabSmrgFcConfigBuildFonts -- Build font database 2784a6844aabSmrgFcConfigGetConfigDirs -- Get config directories 2785a6844aabSmrgFcConfigGetFontDirs -- Get font directories 2786a6844aabSmrgFcConfigGetConfigFiles -- Get config files 2787a6844aabSmrgFcConfigGetCache -- DEPRECATED used to return per-user cache filename 2788a6844aabSmrgFcConfigGetCacheDirs -- return the list of directories searched for cache files 2789a6844aabSmrgFcConfigGetFonts -- Get config font set 2790a6844aabSmrgFcConfigGetBlanks -- Get config blanks 2791a6844aabSmrgFcConfigGetRescanInterval -- Get config rescan interval 2792a6844aabSmrgFcConfigSetRescanInterval -- Set config rescan interval 2793a6844aabSmrgFcConfigAppFontAddFile -- Add font file to font database 2794a6844aabSmrgFcConfigAppFontAddDir -- Add fonts from directory to font database 2795a6844aabSmrgFcConfigAppFontClear -- Remove all app fonts from font database 2796a6844aabSmrgFcConfigSubstituteWithPat -- Execute substitutions 2797a6844aabSmrgFcConfigSubstitute -- Execute substitutions 2798a6844aabSmrgFcFontMatch -- Return best font 2799a6844aabSmrgFcFontSort -- Return list of matching fonts 2800a6844aabSmrgFcFontRenderPrepare -- Prepare pattern for loading font file 2801a6844aabSmrgFcFontList -- List fonts 2802a6844aabSmrgFcConfigFilename -- Find a config file 2803a6844aabSmrgFcConfigParseAndLoad -- load a configuration file 2804a6844aabSmrg 2805a6844aabSmrgAn FcConfig object holds the internal representation of a configuration. There 2806a6844aabSmrgis a default configuration which applications may use by passing 0 to any 2807a6844aabSmrgfunction using the data within an FcConfig. 28082c393a42Smrg 28092c393a42SmrgFcConfigCreate 28102c393a42Smrg 28112c393a42SmrgName 28122c393a42Smrg 2813a6844aabSmrgFcConfigCreate -- Create a configuration 28142c393a42Smrg 28152c393a42SmrgSynopsis 28162c393a42Smrg 28172c393a42Smrg#include <fontconfig.h> 28182c393a42Smrg 2819a6844aabSmrg 2820a6844aabSmrgFcConfig * FcConfigCreate(void); 28212c393a42Smrg 28222c393a42SmrgDescription 28232c393a42Smrg 2824a6844aabSmrgCreates an empty configuration. 28252c393a42Smrg 28262c393a42SmrgVersion 28272c393a42Smrg 2828a6844aabSmrgFontconfig version 2.8.0 2829a6844aabSmrg 2830a6844aabSmrgFcConfigReference 2831a6844aabSmrg 2832a6844aabSmrgName 2833a6844aabSmrg 2834a6844aabSmrgFcConfigReference -- Increment config reference count 2835a6844aabSmrg 2836a6844aabSmrgSynopsis 2837a6844aabSmrg 2838a6844aabSmrg#include <fontconfig.h> 2839a6844aabSmrg 2840a6844aabSmrg 2841a6844aabSmrgFcConfig * FcConfigReference(FcConfig *config); 2842a6844aabSmrg 2843a6844aabSmrgDescription 2844a6844aabSmrg 2845a6844aabSmrgAdd another reference to config. Configs are freed only when the reference 2846a6844aabSmrgcount reaches zero. If config is NULL, the current configuration is used. In 2847a6844aabSmrgthat case this function will be similar to FcConfigGetCurrent() except that it 2848a6844aabSmrgincrements the reference count before returning and the user is responsible for 2849a6844aabSmrgdestroying the configuration when not needed anymore. 2850a6844aabSmrg 2851a6844aabSmrgVersion 2852a6844aabSmrg 2853a6844aabSmrgFontconfig version 2.8.0 28542c393a42Smrg 28552c393a42SmrgFcConfigDestroy 28562c393a42Smrg 28572c393a42SmrgName 28582c393a42Smrg 2859a6844aabSmrgFcConfigDestroy -- Destroy a configuration 28602c393a42Smrg 28612c393a42SmrgSynopsis 28622c393a42Smrg 28632c393a42Smrg#include <fontconfig.h> 28642c393a42Smrg 2865a6844aabSmrg 2866a6844aabSmrgvoid FcConfigDestroy(FcConfig *config); 28672c393a42Smrg 28682c393a42SmrgDescription 28692c393a42Smrg 2870a6844aabSmrgDecrements the config reference count. If all references are gone, destroys the 2871a6844aabSmrgconfiguration and any data associated with it. Note that calling this function 2872a6844aabSmrgwith the return from FcConfigGetCurrent will cause a new configuration to be 2873a6844aabSmrgcreated for use as current configuration. 28742c393a42Smrg 28752c393a42SmrgVersion 28762c393a42Smrg 2877a6844aabSmrgFontconfig version 2.8.0 28782c393a42Smrg 28792c393a42SmrgFcConfigSetCurrent 28802c393a42Smrg 28812c393a42SmrgName 28822c393a42Smrg 2883a6844aabSmrgFcConfigSetCurrent -- Set configuration as default 28842c393a42Smrg 28852c393a42SmrgSynopsis 28862c393a42Smrg 28872c393a42Smrg#include <fontconfig.h> 28882c393a42Smrg 2889a6844aabSmrg 2890a6844aabSmrgFcBool FcConfigSetCurrent(FcConfig *config); 28912c393a42Smrg 28922c393a42SmrgDescription 28932c393a42Smrg 2894a6844aabSmrgSets the current default configuration to config. Implicitly calls 2895a6844aabSmrgFcConfigBuildFonts if necessary, returning FcFalse if that call fails. 28962c393a42Smrg 28972c393a42SmrgVersion 28982c393a42Smrg 2899a6844aabSmrgFontconfig version 2.8.0 29002c393a42Smrg 29012c393a42SmrgFcConfigGetCurrent 29022c393a42Smrg 29032c393a42SmrgName 29042c393a42Smrg 2905a6844aabSmrgFcConfigGetCurrent -- Return current configuration 29062c393a42Smrg 29072c393a42SmrgSynopsis 29082c393a42Smrg 29092c393a42Smrg#include <fontconfig.h> 29102c393a42Smrg 2911a6844aabSmrg 2912a6844aabSmrgFcConfig * FcConfigGetCurrent(void); 29132c393a42Smrg 29142c393a42SmrgDescription 29152c393a42Smrg 2916a6844aabSmrgReturns the current default configuration. 29172c393a42Smrg 29182c393a42SmrgVersion 29192c393a42Smrg 2920a6844aabSmrgFontconfig version 2.8.0 29212c393a42Smrg 29222c393a42SmrgFcConfigUptoDate 29232c393a42Smrg 29242c393a42SmrgName 29252c393a42Smrg 2926a6844aabSmrgFcConfigUptoDate -- Check timestamps on config files 29272c393a42Smrg 29282c393a42SmrgSynopsis 29292c393a42Smrg 29302c393a42Smrg#include <fontconfig.h> 29312c393a42Smrg 2932a6844aabSmrg 2933a6844aabSmrgFcBool FcConfigUptoDate(FcConfig *config); 29342c393a42Smrg 29352c393a42SmrgDescription 29362c393a42Smrg 2937a6844aabSmrgChecks all of the files related to config and returns whether any of them has 2938a6844aabSmrgbeen modified since the configuration was created. If config is NULL, the 2939a6844aabSmrgcurrent configuration is used. 29402c393a42Smrg 29412c393a42SmrgVersion 29422c393a42Smrg 2943a6844aabSmrgFontconfig version 2.8.0 29442c393a42Smrg 29452c393a42SmrgFcConfigHome 29462c393a42Smrg 29472c393a42SmrgName 29482c393a42Smrg 2949a6844aabSmrgFcConfigHome -- return the current home directory. 29502c393a42Smrg 29512c393a42SmrgSynopsis 29522c393a42Smrg 29532c393a42Smrg#include <fontconfig.h> 29542c393a42Smrg 2955a6844aabSmrg 2956a6844aabSmrgFcChar8 * FcConfigHome(void); 29572c393a42Smrg 29582c393a42SmrgDescription 29592c393a42Smrg 2960a6844aabSmrgReturn the current user's home directory, if it is available, and if using it 2961a6844aabSmrgis enabled, and NULL otherwise. See also FcConfigEnableHome). 29622c393a42Smrg 29632c393a42SmrgVersion 29642c393a42Smrg 2965a6844aabSmrgFontconfig version 2.8.0 29662c393a42Smrg 29672c393a42SmrgFcConfigEnableHome 29682c393a42Smrg 29692c393a42SmrgName 29702c393a42Smrg 2971a6844aabSmrgFcConfigEnableHome -- controls use of the home directory. 29722c393a42Smrg 29732c393a42SmrgSynopsis 29742c393a42Smrg 29752c393a42Smrg#include <fontconfig.h> 29762c393a42Smrg 2977a6844aabSmrg 2978a6844aabSmrgFcBol FcConfigEnableHome(FcBool enable); 29792c393a42Smrg 29802c393a42SmrgDescription 29812c393a42Smrg 2982a6844aabSmrgIf enable is FcTrue, then Fontconfig will use various files which are specified 2983a6844aabSmrgrelative to the user's home directory (using the ~ notation in the 2984a6844aabSmrgconfiguration). When enable is FcFalse, then all use of the home directory in 2985a6844aabSmrgthese contexts will be disabled. The previous setting of the value is returned. 29862c393a42Smrg 29872c393a42SmrgVersion 29882c393a42Smrg 2989a6844aabSmrgFontconfig version 2.8.0 29902c393a42Smrg 29912c393a42SmrgFcConfigBuildFonts 29922c393a42Smrg 29932c393a42SmrgName 29942c393a42Smrg 2995a6844aabSmrgFcConfigBuildFonts -- Build font database 29962c393a42Smrg 29972c393a42SmrgSynopsis 29982c393a42Smrg 29992c393a42Smrg#include <fontconfig.h> 30002c393a42Smrg 3001a6844aabSmrg 3002a6844aabSmrgFcBool FcConfigBuildFonts(FcConfig *config); 30032c393a42Smrg 30042c393a42SmrgDescription 30052c393a42Smrg 3006a6844aabSmrgBuilds the set of available fonts for the given configuration. Note that any 3007a6844aabSmrgchanges to the configuration after this call have indeterminate effects. 3008a6844aabSmrgReturns FcFalse if this operation runs out of memory. If config is NULL, the 3009a6844aabSmrgcurrent configuration is used. 30102c393a42Smrg 30112c393a42SmrgVersion 30122c393a42Smrg 3013a6844aabSmrgFontconfig version 2.8.0 30142c393a42Smrg 30152c393a42SmrgFcConfigGetConfigDirs 30162c393a42Smrg 30172c393a42SmrgName 30182c393a42Smrg 3019a6844aabSmrgFcConfigGetConfigDirs -- Get config directories 30202c393a42Smrg 30212c393a42SmrgSynopsis 30222c393a42Smrg 30232c393a42Smrg#include <fontconfig.h> 30242c393a42Smrg 3025a6844aabSmrg 3026a6844aabSmrgFcStrList * FcConfigGetConfigDirs(FcConfig *config); 30272c393a42Smrg 30282c393a42SmrgDescription 30292c393a42Smrg 3030a6844aabSmrgReturns the list of font directories specified in the configuration files for 3031a6844aabSmrgconfig. Does not include any subdirectories. If config is NULL, the current 3032a6844aabSmrgconfiguration is used. 30332c393a42Smrg 30342c393a42SmrgVersion 30352c393a42Smrg 3036a6844aabSmrgFontconfig version 2.8.0 30372c393a42Smrg 30382c393a42SmrgFcConfigGetFontDirs 30392c393a42Smrg 30402c393a42SmrgName 30412c393a42Smrg 3042a6844aabSmrgFcConfigGetFontDirs -- Get font directories 30432c393a42Smrg 30442c393a42SmrgSynopsis 30452c393a42Smrg 30462c393a42Smrg#include <fontconfig.h> 30472c393a42Smrg 3048a6844aabSmrg 3049a6844aabSmrgFcStrList * FcConfigGetFontDirs(FcConfig *config); 30502c393a42Smrg 30512c393a42SmrgDescription 30522c393a42Smrg 3053a6844aabSmrgReturns the list of font directories in config. This includes the configured 3054a6844aabSmrgfont directories along with any directories below those in the filesystem. If 3055a6844aabSmrgconfig is NULL, the current configuration is used. 30562c393a42Smrg 30572c393a42SmrgVersion 30582c393a42Smrg 3059a6844aabSmrgFontconfig version 2.8.0 30602c393a42Smrg 30612c393a42SmrgFcConfigGetConfigFiles 30622c393a42Smrg 30632c393a42SmrgName 30642c393a42Smrg 3065a6844aabSmrgFcConfigGetConfigFiles -- Get config files 30662c393a42Smrg 30672c393a42SmrgSynopsis 30682c393a42Smrg 30692c393a42Smrg#include <fontconfig.h> 30702c393a42Smrg 3071a6844aabSmrg 3072a6844aabSmrgFcStrList * FcConfigGetConfigFiles(FcConfig *config); 30732c393a42Smrg 30742c393a42SmrgDescription 30752c393a42Smrg 3076a6844aabSmrgReturns the list of known configuration files used to generate config. If 3077a6844aabSmrgconfig is NULL, the current configuration is used. 30782c393a42Smrg 30792c393a42SmrgVersion 30802c393a42Smrg 3081a6844aabSmrgFontconfig version 2.8.0 30822c393a42Smrg 30832c393a42SmrgFcConfigGetCache 30842c393a42Smrg 30852c393a42SmrgName 30862c393a42Smrg 3087a6844aabSmrgFcConfigGetCache -- DEPRECATED used to return per-user cache filename 30882c393a42Smrg 30892c393a42SmrgSynopsis 30902c393a42Smrg 30912c393a42Smrg#include <fontconfig.h> 30922c393a42Smrg 3093a6844aabSmrg 3094a6844aabSmrgFcChar8 * FcConfigGetCache(FcConfig *config); 30952c393a42Smrg 30962c393a42SmrgDescription 30972c393a42Smrg 3098a6844aabSmrgWith fontconfig no longer using per-user cache files, this function now simply 3099a6844aabSmrgreturns NULL to indicate that no per-user file exists. 31002c393a42Smrg 31012c393a42SmrgVersion 31022c393a42Smrg 3103a6844aabSmrgFontconfig version 2.8.0 31042c393a42Smrg 31052c393a42SmrgFcConfigGetCacheDirs 31062c393a42Smrg 31072c393a42SmrgName 31082c393a42Smrg 3109a6844aabSmrgFcConfigGetCacheDirs -- return the list of directories searched for cache files 31102c393a42Smrg 31112c393a42SmrgSynopsis 31122c393a42Smrg 31132c393a42Smrg#include <fontconfig.h> 31142c393a42Smrg 3115a6844aabSmrg 3116a6844aabSmrgFcStrList * FcConfigGetCacheDirs(FcConfig *config); 31172c393a42Smrg 31182c393a42SmrgDescription 31192c393a42Smrg 3120a6844aabSmrgFcConfigGetCacheDirs returns a string list containing all of the directories 3121a6844aabSmrgthat fontconfig will search when attempting to load a cache file for a font 3122a6844aabSmrgdirectory. If config is NULL, the current configuration is used. 31232c393a42Smrg 31242c393a42SmrgVersion 31252c393a42Smrg 3126a6844aabSmrgFontconfig version 2.8.0 31272c393a42Smrg 31282c393a42SmrgFcConfigGetFonts 31292c393a42Smrg 31302c393a42SmrgName 31312c393a42Smrg 3132a6844aabSmrgFcConfigGetFonts -- Get config font set 31332c393a42Smrg 31342c393a42SmrgSynopsis 31352c393a42Smrg 31362c393a42Smrg#include <fontconfig.h> 31372c393a42Smrg 3138a6844aabSmrg 3139a6844aabSmrgFcFontSet * FcConfigGetFonts(FcConfig *config, FcSetName set); 31402c393a42Smrg 31412c393a42SmrgDescription 31422c393a42Smrg 3143a6844aabSmrgReturns one of the two sets of fonts from the configuration as specified by set 3144a6844aabSmrg. This font set is owned by the library and must not be modified or freed. If 3145a6844aabSmrgconfig is NULL, the current configuration is used. 31462c393a42Smrg 31472c393a42SmrgVersion 31482c393a42Smrg 3149a6844aabSmrgFontconfig version 2.8.0 31502c393a42Smrg 31512c393a42SmrgFcConfigGetBlanks 31522c393a42Smrg 31532c393a42SmrgName 31542c393a42Smrg 3155a6844aabSmrgFcConfigGetBlanks -- Get config blanks 31562c393a42Smrg 31572c393a42SmrgSynopsis 31582c393a42Smrg 31592c393a42Smrg#include <fontconfig.h> 31602c393a42Smrg 3161a6844aabSmrg 3162a6844aabSmrgFcBlanks * FcConfigGetBlanks(FcConfig *config); 31632c393a42Smrg 31642c393a42SmrgDescription 31652c393a42Smrg 3166a6844aabSmrgReturns the FcBlanks object associated with the given configuration, if no 3167a6844aabSmrgblanks were present in the configuration, this function will return 0. The 3168a6844aabSmrgreturned FcBlanks object if not NULL, is valid as long as the owning FcConfig 3169a6844aabSmrgis alive. If config is NULL, the current configuration is used. 31702c393a42Smrg 31712c393a42SmrgVersion 31722c393a42Smrg 3173a6844aabSmrgFontconfig version 2.8.0 31742c393a42Smrg 31752c393a42SmrgFcConfigGetRescanInterval 31762c393a42Smrg 31772c393a42SmrgName 31782c393a42Smrg 3179a6844aabSmrgFcConfigGetRescanInterval -- Get config rescan interval 31802c393a42Smrg 31812c393a42SmrgSynopsis 31822c393a42Smrg 31832c393a42Smrg#include <fontconfig.h> 31842c393a42Smrg 3185a6844aabSmrg 3186a6844aabSmrgint FcConfigGetRescanInterval(FcConfig *config); 31872c393a42Smrg 31882c393a42SmrgDescription 31892c393a42Smrg 3190a6844aabSmrgReturns the interval between automatic checks of the configuration (in seconds) 3191a6844aabSmrgspecified in config. The configuration is checked during a call to FcFontList 3192a6844aabSmrgwhen this interval has passed since the last check. An interval setting of zero 3193a6844aabSmrgdisables automatic checks. If config is NULL, the current configuration is 3194a6844aabSmrgused. 31952c393a42Smrg 31962c393a42SmrgVersion 31972c393a42Smrg 3198a6844aabSmrgFontconfig version 2.8.0 31992c393a42Smrg 32002c393a42SmrgFcConfigSetRescanInterval 32012c393a42Smrg 32022c393a42SmrgName 32032c393a42Smrg 3204a6844aabSmrgFcConfigSetRescanInterval -- Set config rescan interval 32052c393a42Smrg 32062c393a42SmrgSynopsis 32072c393a42Smrg 32082c393a42Smrg#include <fontconfig.h> 32092c393a42Smrg 3210a6844aabSmrg 3211a6844aabSmrgFcBool FcConfigSetRescanInterval(FcConfig *config, int rescanInterval); 32122c393a42Smrg 32132c393a42SmrgDescription 32142c393a42Smrg 3215a6844aabSmrgSets the rescan interval. Returns FcFalse if the interval cannot be set (due to 3216a6844aabSmrgallocation failure). Otherwise returns FcTrue. An interval setting of zero 3217a6844aabSmrgdisables automatic checks. If config is NULL, the current configuration is 3218a6844aabSmrgused. 32192c393a42Smrg 32202c393a42SmrgVersion 32212c393a42Smrg 3222a6844aabSmrgFontconfig version 2.8.0 32232c393a42Smrg 32242c393a42SmrgFcConfigAppFontAddFile 32252c393a42Smrg 32262c393a42SmrgName 32272c393a42Smrg 3228a6844aabSmrgFcConfigAppFontAddFile -- Add font file to font database 32292c393a42Smrg 32302c393a42SmrgSynopsis 32312c393a42Smrg 32322c393a42Smrg#include <fontconfig.h> 32332c393a42Smrg 3234a6844aabSmrg 3235a6844aabSmrgFcBool FcConfigAppFontAddFile(FcConfig *config, const FcChar8 *file); 32362c393a42Smrg 32372c393a42SmrgDescription 32382c393a42Smrg 3239a6844aabSmrgAdds an application-specific font to the configuration. Returns FcFalse if the 3240a6844aabSmrgfonts cannot be added (due to allocation failure). Otherwise returns FcTrue. If 3241a6844aabSmrgconfig is NULL, the current configuration is used. 32422c393a42Smrg 32432c393a42SmrgVersion 32442c393a42Smrg 3245a6844aabSmrgFontconfig version 2.8.0 32462c393a42Smrg 32472c393a42SmrgFcConfigAppFontAddDir 32482c393a42Smrg 32492c393a42SmrgName 32502c393a42Smrg 3251a6844aabSmrgFcConfigAppFontAddDir -- Add fonts from directory to font database 32522c393a42Smrg 32532c393a42SmrgSynopsis 32542c393a42Smrg 32552c393a42Smrg#include <fontconfig.h> 32562c393a42Smrg 3257a6844aabSmrg 3258a6844aabSmrgFcBool FcConfigAppFontAddDir(FcConfig *config, const FcChar8 *dir); 32592c393a42Smrg 32602c393a42SmrgDescription 32612c393a42Smrg 3262a6844aabSmrgScans the specified directory for fonts, adding each one found to the 3263a6844aabSmrgapplication-specific set of fonts. Returns FcFalse if the fonts cannot be added 3264a6844aabSmrg(due to allocation failure). Otherwise returns FcTrue. If config is NULL, the 3265a6844aabSmrgcurrent configuration is used. 32662c393a42Smrg 32672c393a42SmrgVersion 32682c393a42Smrg 3269a6844aabSmrgFontconfig version 2.8.0 32702c393a42Smrg 32712c393a42SmrgFcConfigAppFontClear 32722c393a42Smrg 32732c393a42SmrgName 32742c393a42Smrg 3275a6844aabSmrgFcConfigAppFontClear -- Remove all app fonts from font database 32762c393a42Smrg 32772c393a42SmrgSynopsis 32782c393a42Smrg 32792c393a42Smrg#include <fontconfig.h> 32802c393a42Smrg 3281a6844aabSmrg 3282a6844aabSmrgvoid FcConfigAppFontClear(FcConfig *config); 32832c393a42Smrg 32842c393a42SmrgDescription 32852c393a42Smrg 3286a6844aabSmrgClears the set of application-specific fonts. If config is NULL, the current 3287a6844aabSmrgconfiguration is used. 32882c393a42Smrg 32892c393a42SmrgVersion 32902c393a42Smrg 3291a6844aabSmrgFontconfig version 2.8.0 32922c393a42Smrg 32932c393a42SmrgFcConfigSubstituteWithPat 32942c393a42Smrg 32952c393a42SmrgName 32962c393a42Smrg 3297a6844aabSmrgFcConfigSubstituteWithPat -- Execute substitutions 32982c393a42Smrg 32992c393a42SmrgSynopsis 33002c393a42Smrg 33012c393a42Smrg#include <fontconfig.h> 33022c393a42Smrg 3303a6844aabSmrg 3304a6844aabSmrgFcBool FcConfigSubstituteWithPat(FcConfig *config, FcPattern *p, FcPattern * 3305a6844aabSmrgp_pat, FcMatchKind kind); 33062c393a42Smrg 33072c393a42SmrgDescription 33082c393a42Smrg 3309a6844aabSmrgPerforms the sequence of pattern modification operations, if kind is 3310a6844aabSmrgFcMatchPattern, then those tagged as pattern operations are applied, else if 3311a6844aabSmrgkind is FcMatchFont, those tagged as font operations are applied and p_pat is 3312a6844aabSmrgused for <test> elements with target=pattern. Returns FcFalse if the 3313a6844aabSmrgsubstitution cannot be performed (due to allocation failure). Otherwise returns 3314a6844aabSmrgFcTrue. If config is NULL, the current configuration is used. 33152c393a42Smrg 33162c393a42SmrgVersion 33172c393a42Smrg 3318a6844aabSmrgFontconfig version 2.8.0 33192c393a42Smrg 33202c393a42SmrgFcConfigSubstitute 33212c393a42Smrg 33222c393a42SmrgName 33232c393a42Smrg 3324a6844aabSmrgFcConfigSubstitute -- Execute substitutions 33252c393a42Smrg 33262c393a42SmrgSynopsis 33272c393a42Smrg 33282c393a42Smrg#include <fontconfig.h> 33292c393a42Smrg 3330a6844aabSmrg 3331a6844aabSmrgFcBool FcConfigSubstitute(FcConfig *config, FcPattern *p, FcMatchKind kind); 33322c393a42Smrg 33332c393a42SmrgDescription 33342c393a42Smrg 3335a6844aabSmrgCalls FcConfigSubstituteWithPat setting p_pat to NULL. Returns FcFalse if the 3336a6844aabSmrgsubstitution cannot be performed (due to allocation failure). Otherwise returns 3337a6844aabSmrgFcTrue. If config is NULL, the current configuration is used. 33382c393a42Smrg 33392c393a42SmrgVersion 33402c393a42Smrg 3341a6844aabSmrgFontconfig version 2.8.0 33422c393a42Smrg 33432c393a42SmrgFcFontMatch 33442c393a42Smrg 33452c393a42SmrgName 33462c393a42Smrg 3347a6844aabSmrgFcFontMatch -- Return best font 33482c393a42Smrg 33492c393a42SmrgSynopsis 33502c393a42Smrg 33512c393a42Smrg#include <fontconfig.h> 33522c393a42Smrg 3353a6844aabSmrg 3354a6844aabSmrgFcPattern * FcFontMatch(FcConfig *config, FcPattern *p, FcResult *result); 33552c393a42Smrg 33562c393a42SmrgDescription 33572c393a42Smrg 3358a6844aabSmrgFinds the font in sets most closely matching pattern and returns the result of 3359a6844aabSmrgFcFontRenderPrepare for that font and the provided pattern. This function 3360a6844aabSmrgshould be called only after FcConfigSubstitute and FcDefaultSubstitute have 3361a6844aabSmrgbeen called for p; otherwise the results will not be correct. If config is 3362a6844aabSmrgNULL, the current configuration is used. 33632c393a42Smrg 33642c393a42SmrgVersion 33652c393a42Smrg 3366a6844aabSmrgFontconfig version 2.8.0 33672c393a42Smrg 33682c393a42SmrgFcFontSort 33692c393a42Smrg 33702c393a42SmrgName 33712c393a42Smrg 3372a6844aabSmrgFcFontSort -- Return list of matching fonts 33732c393a42Smrg 33742c393a42SmrgSynopsis 33752c393a42Smrg 33762c393a42Smrg#include <fontconfig.h> 33772c393a42Smrg 3378a6844aabSmrg 3379a6844aabSmrgFcFontSet * FcFontSort(FcConfig *config, FcPattern *p, FcBool trim, FcCharSet 3380a6844aabSmrg**csp, FcResult *result); 33812c393a42Smrg 33822c393a42SmrgDescription 33832c393a42Smrg 3384a6844aabSmrgReturns the list of fonts sorted by closeness to p. If trim is FcTrue, elements 3385a6844aabSmrgin the list which don't include Unicode coverage not provided by earlier 3386a6844aabSmrgelements in the list are elided. The union of Unicode coverage of all of the 3387a6844aabSmrgfonts is returned in csp, if csp is not NULL. This function should be called 3388a6844aabSmrgonly after FcConfigSubstitute and FcDefaultSubstitute have been called for p; 3389a6844aabSmrgotherwise the results will not be correct. 33902c393a42Smrg 3391a6844aabSmrgThe returned FcFontSet references FcPattern structures which may be shared by 3392a6844aabSmrgthe return value from multiple FcFontSort calls, applications must not modify 3393a6844aabSmrgthese patterns. Instead, they should be passed, along with p to 3394a6844aabSmrgFcFontRenderPrepare which combines them into a complete pattern. 33952c393a42Smrg 3396a6844aabSmrgThe FcFontSet returned by FcFontSort is destroyed by caling FcFontSetDestroy. 3397a6844aabSmrgIf config is NULL, the current configuration is used. 33982c393a42Smrg 33992c393a42SmrgVersion 34002c393a42Smrg 3401a6844aabSmrgFontconfig version 2.8.0 34022c393a42Smrg 34032c393a42SmrgFcFontRenderPrepare 34042c393a42Smrg 34052c393a42SmrgName 34062c393a42Smrg 3407a6844aabSmrgFcFontRenderPrepare -- Prepare pattern for loading font file 34082c393a42Smrg 34092c393a42SmrgSynopsis 34102c393a42Smrg 34112c393a42Smrg#include <fontconfig.h> 34122c393a42Smrg 3413a6844aabSmrg 3414a6844aabSmrgFcPattern * FcFontRenderPrepare(FcConfig *config, FcPattern *pat, FcPattern * 3415a6844aabSmrgfont); 34162c393a42Smrg 34172c393a42SmrgDescription 34182c393a42Smrg 3419a6844aabSmrgCreates a new pattern consisting of elements of font not appearing in pat, 3420a6844aabSmrgelements of pat not appearing in font and the best matching value from pat for 3421a6844aabSmrgelements appearing in both. The result is passed to FcConfigSubstituteWithPat 3422a6844aabSmrgwith kind FcMatchFont and then returned. 34232c393a42Smrg 34242c393a42SmrgVersion 34252c393a42Smrg 3426a6844aabSmrgFontconfig version 2.8.0 34272c393a42Smrg 34282c393a42SmrgFcFontList 34292c393a42Smrg 34302c393a42SmrgName 34312c393a42Smrg 3432a6844aabSmrgFcFontList -- List fonts 34332c393a42Smrg 34342c393a42SmrgSynopsis 34352c393a42Smrg 34362c393a42Smrg#include <fontconfig.h> 34372c393a42Smrg 3438a6844aabSmrg 3439a6844aabSmrgFcFontSet * FcFontList(FcConfig *config, FcPattern *p, FcObjectSet *os); 34402c393a42Smrg 34412c393a42SmrgDescription 34422c393a42Smrg 3443a6844aabSmrgSelects fonts matching p, creates patterns from those fonts containing only the 3444a6844aabSmrgobjects in os and returns the set of unique such patterns. If config is NULL, 3445a6844aabSmrgthe default configuration is checked to be up to date, and used. 34462c393a42Smrg 34472c393a42SmrgVersion 34482c393a42Smrg 3449a6844aabSmrgFontconfig version 2.8.0 34502c393a42Smrg 34512c393a42SmrgFcConfigFilename 34522c393a42Smrg 34532c393a42SmrgName 34542c393a42Smrg 3455a6844aabSmrgFcConfigFilename -- Find a config file 34562c393a42Smrg 34572c393a42SmrgSynopsis 34582c393a42Smrg 34592c393a42Smrg#include <fontconfig.h> 34602c393a42Smrg 3461a6844aabSmrg 3462a6844aabSmrgFcChar8 * FcConfigFilename(const FcChar8 *name); 34632c393a42Smrg 34642c393a42SmrgDescription 34652c393a42Smrg 3466a6844aabSmrgGiven the specified external entity name, return the associated filename. This 3467a6844aabSmrgprovides applications a way to convert various configuration file references 3468a6844aabSmrginto filename form. 34692c393a42Smrg 3470a6844aabSmrgA null or empty name indicates that the default configuration file should be 3471a6844aabSmrgused; which file this references can be overridden with the FC_CONFIG_FILE 3472a6844aabSmrgenvironment variable. Next, if the name starts with ~, it refers to a file in 3473a6844aabSmrgthe current users home directory. Otherwise if the name doesn't start with '/', 3474a6844aabSmrgit refers to a file in the default configuration directory; the built-in 3475a6844aabSmrgdefault directory can be overridden with the FC_CONFIG_DIR environment 3476a6844aabSmrgvariable. 34772c393a42Smrg 34782c393a42SmrgVersion 34792c393a42Smrg 3480a6844aabSmrgFontconfig version 2.8.0 34812c393a42Smrg 34822c393a42SmrgFcConfigParseAndLoad 34832c393a42Smrg 34842c393a42SmrgName 34852c393a42Smrg 3486a6844aabSmrgFcConfigParseAndLoad -- load a configuration file 34872c393a42Smrg 34882c393a42SmrgSynopsis 34892c393a42Smrg 34902c393a42Smrg#include <fontconfig.h> 34912c393a42Smrg 3492a6844aabSmrg 3493a6844aabSmrgFcBool FcConfigParseAndLoad(FcConfig *config, const FcChar8 *file, FcBool 3494a6844aabSmrgcomplain); 34952c393a42Smrg 34962c393a42SmrgDescription 34972c393a42Smrg 3498a6844aabSmrgWalks the configuration in 'file' and constructs the internal representation in 3499a6844aabSmrg'config'. Any include files referenced from within 'file' will be loaded and 3500a6844aabSmrgparsed. If 'complain' is FcFalse, no warning will be displayed if 'file' does 3501a6844aabSmrgnot exist. Error and warning messages will be output to stderr. Returns FcFalse 3502a6844aabSmrgif some error occurred while loading the file, either a parse error, semantic 3503a6844aabSmrgerror or allocation failure. Otherwise returns FcTrue. 35042c393a42Smrg 35052c393a42SmrgVersion 35062c393a42Smrg 3507a6844aabSmrgFontconfig version 2.8.0 35082c393a42Smrg 3509a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35102c393a42Smrg 3511a6844aabSmrgFcObjectType 35122c393a42Smrg 3513a6844aabSmrgTable of Contents 3514a6844aabSmrgFcNameRegisterObjectTypes -- Register object types 3515a6844aabSmrgFcNameUnregisterObjectTypes -- Unregister object types 3516a6844aabSmrgFcNameGetObjectType -- Lookup an object type 3517a6844aabSmrg 3518a6844aabSmrgProvides for applcation-specified font name object types so that new pattern 3519a6844aabSmrgelements can be generated from font names. 35202c393a42Smrg 35212c393a42SmrgFcNameRegisterObjectTypes 35222c393a42Smrg 35232c393a42SmrgName 35242c393a42Smrg 3525a6844aabSmrgFcNameRegisterObjectTypes -- Register object types 35262c393a42Smrg 35272c393a42SmrgSynopsis 35282c393a42Smrg 35292c393a42Smrg#include <fontconfig.h> 35302c393a42Smrg 3531a6844aabSmrg 3532a6844aabSmrgFcBool FcNameRegisterObjectTypes(const FcObjectType *types, int ntype); 35332c393a42Smrg 35342c393a42SmrgDescription 35352c393a42Smrg 3536a6844aabSmrgRegister ntype new object types. Returns FcFalse if some of the names cannot be 3537a6844aabSmrgregistered (due to allocation failure). Otherwise returns FcTrue. 35382c393a42Smrg 35392c393a42SmrgVersion 35402c393a42Smrg 3541a6844aabSmrgFontconfig version 2.8.0 35422c393a42Smrg 35432c393a42SmrgFcNameUnregisterObjectTypes 35442c393a42Smrg 35452c393a42SmrgName 35462c393a42Smrg 3547a6844aabSmrgFcNameUnregisterObjectTypes -- Unregister object types 35482c393a42Smrg 35492c393a42SmrgSynopsis 35502c393a42Smrg 35512c393a42Smrg#include <fontconfig.h> 35522c393a42Smrg 3553a6844aabSmrg 3554a6844aabSmrgFcBool FcNameUnregisterObjectTypes(const FcObjectType *types, int ntype); 35552c393a42Smrg 35562c393a42SmrgDescription 35572c393a42Smrg 3558a6844aabSmrgUnregister ntype object types. Returns FcTrue. 35592c393a42Smrg 35602c393a42SmrgVersion 35612c393a42Smrg 3562a6844aabSmrgFontconfig version 2.8.0 35632c393a42Smrg 35642c393a42SmrgFcNameGetObjectType 35652c393a42Smrg 35662c393a42SmrgName 35672c393a42Smrg 3568a6844aabSmrgFcNameGetObjectType -- Lookup an object type 35692c393a42Smrg 35702c393a42SmrgSynopsis 35712c393a42Smrg 35722c393a42Smrg#include <fontconfig.h> 35732c393a42Smrg 3574a6844aabSmrg 3575a6844aabSmrgconst FcObjectType * FcNameGetObjectType(const char *object); 35762c393a42Smrg 35772c393a42SmrgDescription 35782c393a42Smrg 3579a6844aabSmrgReturn the object type for the pattern element named object. 35802c393a42Smrg 35812c393a42SmrgVersion 35822c393a42Smrg 3583a6844aabSmrgFontconfig version 2.8.0 3584a6844aabSmrg 3585a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35862c393a42Smrg 3587a6844aabSmrgFcConstant 35882c393a42Smrg 3589a6844aabSmrgTable of Contents 3590a6844aabSmrgFcNameRegisterConstants -- Register symbolic constants 3591a6844aabSmrgFcNameUnregisterConstants -- Unregister symbolic constants 3592a6844aabSmrgFcNameGetConstant -- Lookup symbolic constant 3593a6844aabSmrgFcNameConstant -- Get the value for a symbolic constant 35942c393a42Smrg 3595a6844aabSmrgProvides for application-specified symbolic constants for font names. 35962c393a42Smrg 35972c393a42SmrgFcNameRegisterConstants 35982c393a42Smrg 35992c393a42SmrgName 36002c393a42Smrg 3601a6844aabSmrgFcNameRegisterConstants -- Register symbolic constants 36022c393a42Smrg 36032c393a42SmrgSynopsis 36042c393a42Smrg 36052c393a42Smrg#include <fontconfig.h> 36062c393a42Smrg 3607a6844aabSmrg 3608a6844aabSmrgFcBool FcNameRegisterConstants(const FcConstant *consts, int nconsts); 36092c393a42Smrg 36102c393a42SmrgDescription 36112c393a42Smrg 3612a6844aabSmrgRegister nconsts new symbolic constants. Returns FcFalse if the constants 3613a6844aabSmrgcannot be registered (due to allocation failure). Otherwise returns FcTrue. 36142c393a42Smrg 36152c393a42SmrgVersion 36162c393a42Smrg 3617a6844aabSmrgFontconfig version 2.8.0 36182c393a42Smrg 36192c393a42SmrgFcNameUnregisterConstants 36202c393a42Smrg 36212c393a42SmrgName 36222c393a42Smrg 3623a6844aabSmrgFcNameUnregisterConstants -- Unregister symbolic constants 36242c393a42Smrg 36252c393a42SmrgSynopsis 36262c393a42Smrg 36272c393a42Smrg#include <fontconfig.h> 36282c393a42Smrg 3629a6844aabSmrg 3630a6844aabSmrgFcBool FcNameUnregisterConstants(const FcConstant *consts, int nconsts); 36312c393a42Smrg 36322c393a42SmrgDescription 36332c393a42Smrg 3634a6844aabSmrgUnregister nconsts symbolic constants. Returns FcFalse if the specified 3635a6844aabSmrgconstants were not registered. Otherwise returns FcTrue. 36362c393a42Smrg 36372c393a42SmrgVersion 36382c393a42Smrg 3639a6844aabSmrgFontconfig version 2.8.0 36402c393a42Smrg 36412c393a42SmrgFcNameGetConstant 36422c393a42Smrg 36432c393a42SmrgName 36442c393a42Smrg 3645a6844aabSmrgFcNameGetConstant -- Lookup symbolic constant 36462c393a42Smrg 36472c393a42SmrgSynopsis 36482c393a42Smrg 36492c393a42Smrg#include <fontconfig.h> 36502c393a42Smrg 3651a6844aabSmrg 3652a6844aabSmrgconst FcConstant * FcNameGetConstant(FcChar8 *string); 36532c393a42Smrg 36542c393a42SmrgDescription 36552c393a42Smrg 3656a6844aabSmrgReturn the FcConstant structure related to symbolic constant string. 36572c393a42Smrg 36582c393a42SmrgVersion 36592c393a42Smrg 3660a6844aabSmrgFontconfig version 2.8.0 36612c393a42Smrg 36622c393a42SmrgFcNameConstant 36632c393a42Smrg 36642c393a42SmrgName 36652c393a42Smrg 3666a6844aabSmrgFcNameConstant -- Get the value for a symbolic constant 36672c393a42Smrg 36682c393a42SmrgSynopsis 36692c393a42Smrg 36702c393a42Smrg#include <fontconfig.h> 36712c393a42Smrg 3672a6844aabSmrg 3673a6844aabSmrgFcBool FcNameConstant(FcChar8 *string, int *result); 36742c393a42Smrg 36752c393a42SmrgDescription 36762c393a42Smrg 3677a6844aabSmrgReturns whether a symbolic constant with name string is registered, placing the 3678a6844aabSmrgvalue of the constant in result if present. 36792c393a42Smrg 36802c393a42SmrgVersion 36812c393a42Smrg 3682a6844aabSmrgFontconfig version 2.8.0 3683a6844aabSmrg 3684a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36852c393a42Smrg 3686a6844aabSmrgFcBlanks 36872c393a42Smrg 3688a6844aabSmrgTable of Contents 3689a6844aabSmrgFcBlanksCreate -- Create an FcBlanks 3690a6844aabSmrgFcBlanksDestroy -- Destroy and FcBlanks 3691a6844aabSmrgFcBlanksAdd -- Add a character to an FcBlanks 3692a6844aabSmrgFcBlanksIsMember -- Query membership in an FcBlanks 36932c393a42Smrg 3694a6844aabSmrgAn FcBlanks object holds a list of Unicode chars which are expected to be blank 3695a6844aabSmrgwhen drawn. When scanning new fonts, any glyphs which are empty and not in this 3696a6844aabSmrglist will be assumed to be broken and not placed in the FcCharSet associated 3697a6844aabSmrgwith the font. This provides a significantly more accurate CharSet for 3698a6844aabSmrgapplications. 36992c393a42Smrg 37002c393a42SmrgFcBlanksCreate 37012c393a42Smrg 37022c393a42SmrgName 37032c393a42Smrg 3704a6844aabSmrgFcBlanksCreate -- Create an FcBlanks 37052c393a42Smrg 37062c393a42SmrgSynopsis 37072c393a42Smrg 37082c393a42Smrg#include <fontconfig.h> 37092c393a42Smrg 3710a6844aabSmrg 3711a6844aabSmrgFcBlanks * FcBlanksCreate(void); 37122c393a42Smrg 37132c393a42SmrgDescription 37142c393a42Smrg 3715a6844aabSmrgCreates an empty FcBlanks object. 37162c393a42Smrg 37172c393a42SmrgVersion 37182c393a42Smrg 3719a6844aabSmrgFontconfig version 2.8.0 37202c393a42Smrg 37212c393a42SmrgFcBlanksDestroy 37222c393a42Smrg 37232c393a42SmrgName 37242c393a42Smrg 3725a6844aabSmrgFcBlanksDestroy -- Destroy and FcBlanks 37262c393a42Smrg 37272c393a42SmrgSynopsis 37282c393a42Smrg 37292c393a42Smrg#include <fontconfig.h> 37302c393a42Smrg 3731a6844aabSmrg 3732a6844aabSmrgvoid FcBlanksDestroy(FcBlanks *b); 37332c393a42Smrg 37342c393a42SmrgDescription 37352c393a42Smrg 3736a6844aabSmrgDestroys an FcBlanks object, freeing any associated memory. 37372c393a42Smrg 37382c393a42SmrgVersion 37392c393a42Smrg 3740a6844aabSmrgFontconfig version 2.8.0 37412c393a42Smrg 37422c393a42SmrgFcBlanksAdd 37432c393a42Smrg 37442c393a42SmrgName 37452c393a42Smrg 3746a6844aabSmrgFcBlanksAdd -- Add a character to an FcBlanks 37472c393a42Smrg 37482c393a42SmrgSynopsis 37492c393a42Smrg 37502c393a42Smrg#include <fontconfig.h> 37512c393a42Smrg 3752a6844aabSmrg 3753a6844aabSmrgFcBool FcBlanksAdd(FcBlanks *b, FcChar32 ucs4); 37542c393a42Smrg 37552c393a42SmrgDescription 37562c393a42Smrg 3757a6844aabSmrgAdds a single character to an FcBlanks object, returning FcFalse if this 3758a6844aabSmrgprocess ran out of memory. 37592c393a42Smrg 37602c393a42SmrgVersion 37612c393a42Smrg 3762a6844aabSmrgFontconfig version 2.8.0 37632c393a42Smrg 37642c393a42SmrgFcBlanksIsMember 37652c393a42Smrg 37662c393a42SmrgName 37672c393a42Smrg 3768a6844aabSmrgFcBlanksIsMember -- Query membership in an FcBlanks 37692c393a42Smrg 37702c393a42SmrgSynopsis 37712c393a42Smrg 37722c393a42Smrg#include <fontconfig.h> 37732c393a42Smrg 3774a6844aabSmrg 3775a6844aabSmrgFcBool FcBlanksIsMember(FcBlanks *b, FcChar32 ucs4); 37762c393a42Smrg 37772c393a42SmrgDescription 37782c393a42Smrg 3779a6844aabSmrgReturns whether the specified FcBlanks object contains the indicated Unicode 3780a6844aabSmrgvalue. 37812c393a42Smrg 37822c393a42SmrgVersion 37832c393a42Smrg 3784a6844aabSmrgFontconfig version 2.8.0 3785a6844aabSmrg 3786a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 37872c393a42Smrg 3788a6844aabSmrgFcAtomic 37892c393a42Smrg 3790a6844aabSmrgTable of Contents 3791a6844aabSmrgFcAtomicCreate -- create an FcAtomic object 3792a6844aabSmrgFcAtomicLock -- lock a file 3793a6844aabSmrgFcAtomicNewFile -- return new temporary file name 3794a6844aabSmrgFcAtomicOrigFile -- return original file name 3795a6844aabSmrgFcAtomicReplaceOrig -- replace original with new 3796a6844aabSmrgFcAtomicDeleteNew -- delete new file 3797a6844aabSmrgFcAtomicUnlock -- unlock a file 3798a6844aabSmrgFcAtomicDestroy -- destroy an FcAtomic object 37992c393a42Smrg 3800a6844aabSmrgThese functions provide a safe way to update config files, allowing ongoing 3801a6844aabSmrgreading of the old config file while locked for writing and ensuring that a 3802a6844aabSmrgconsistent and complete version of the config file is always available. 38032c393a42Smrg 38042c393a42SmrgFcAtomicCreate 38052c393a42Smrg 38062c393a42SmrgName 38072c393a42Smrg 3808a6844aabSmrgFcAtomicCreate -- create an FcAtomic object 38092c393a42Smrg 38102c393a42SmrgSynopsis 38112c393a42Smrg 38122c393a42Smrg#include <fontconfig.h> 38132c393a42Smrg 3814a6844aabSmrg 3815a6844aabSmrgFcAtomic * FcAtomicCreate(const FcChar8 *file); 38162c393a42Smrg 38172c393a42SmrgDescription 38182c393a42Smrg 3819a6844aabSmrgCreates a data structure containing data needed to control access to file. 3820a6844aabSmrgWriting is done to a separate file. Once that file is complete, the original 3821a6844aabSmrgconfiguration file is atomically replaced so that reading process always see a 3822a6844aabSmrgconsistent and complete file without the need to lock for reading. 38232c393a42Smrg 38242c393a42SmrgVersion 38252c393a42Smrg 3826a6844aabSmrgFontconfig version 2.8.0 38272c393a42Smrg 38282c393a42SmrgFcAtomicLock 38292c393a42Smrg 38302c393a42SmrgName 38312c393a42Smrg 3832a6844aabSmrgFcAtomicLock -- lock a file 38332c393a42Smrg 38342c393a42SmrgSynopsis 38352c393a42Smrg 38362c393a42Smrg#include <fontconfig.h> 38372c393a42Smrg 3838a6844aabSmrg 3839a6844aabSmrgFcBool FcAtomicLock(FcAtomic *atomic); 38402c393a42Smrg 38412c393a42SmrgDescription 38422c393a42Smrg 3843a6844aabSmrgAttempts to lock the file referenced by atomic. Returns FcFalse if the file is 3844a6844aabSmrgalready locked, else returns FcTrue and leaves the file locked. 38452c393a42Smrg 38462c393a42SmrgVersion 38472c393a42Smrg 3848a6844aabSmrgFontconfig version 2.8.0 38492c393a42Smrg 38502c393a42SmrgFcAtomicNewFile 38512c393a42Smrg 38522c393a42SmrgName 38532c393a42Smrg 3854a6844aabSmrgFcAtomicNewFile -- return new temporary file name 38552c393a42Smrg 38562c393a42SmrgSynopsis 38572c393a42Smrg 38582c393a42Smrg#include <fontconfig.h> 38592c393a42Smrg 3860a6844aabSmrg 3861a6844aabSmrgFcChar8 * FcAtomicNewFile(FcAtomic *atomic); 38622c393a42Smrg 38632c393a42SmrgDescription 38642c393a42Smrg 3865a6844aabSmrgReturns the filename for writing a new version of the file referenced by atomic 3866a6844aabSmrg. 38672c393a42Smrg 38682c393a42SmrgVersion 38692c393a42Smrg 3870a6844aabSmrgFontconfig version 2.8.0 38712c393a42Smrg 38722c393a42SmrgFcAtomicOrigFile 38732c393a42Smrg 38742c393a42SmrgName 38752c393a42Smrg 3876a6844aabSmrgFcAtomicOrigFile -- return original file name 38772c393a42Smrg 38782c393a42SmrgSynopsis 38792c393a42Smrg 38802c393a42Smrg#include <fontconfig.h> 38812c393a42Smrg 3882a6844aabSmrg 3883a6844aabSmrgFcChar8 * FcAtomicOrigFile(FcAtomic *atomic); 38842c393a42Smrg 38852c393a42SmrgDescription 38862c393a42Smrg 3887a6844aabSmrgReturns the file refernced by atomic. 38882c393a42Smrg 38892c393a42SmrgVersion 38902c393a42Smrg 3891a6844aabSmrgFontconfig version 2.8.0 38922c393a42Smrg 38932c393a42SmrgFcAtomicReplaceOrig 38942c393a42Smrg 38952c393a42SmrgName 38962c393a42Smrg 3897a6844aabSmrgFcAtomicReplaceOrig -- replace original with new 38982c393a42Smrg 38992c393a42SmrgSynopsis 39002c393a42Smrg 39012c393a42Smrg#include <fontconfig.h> 39022c393a42Smrg 3903a6844aabSmrg 3904a6844aabSmrgFcBool FcAtomicReplaceOrig(FcAtomic *atomic); 39052c393a42Smrg 39062c393a42SmrgDescription 39072c393a42Smrg 3908a6844aabSmrgReplaces the original file referenced by atomic with the new file. Returns 3909a6844aabSmrgFcFalse if the file cannot be replaced due to permission issues in the 3910a6844aabSmrgfilesystem. Otherwise returns FcTrue. 39112c393a42Smrg 39122c393a42SmrgVersion 39132c393a42Smrg 3914a6844aabSmrgFontconfig version 2.8.0 39152c393a42Smrg 39162c393a42SmrgFcAtomicDeleteNew 39172c393a42Smrg 39182c393a42SmrgName 39192c393a42Smrg 3920a6844aabSmrgFcAtomicDeleteNew -- delete new file 39212c393a42Smrg 39222c393a42SmrgSynopsis 39232c393a42Smrg 39242c393a42Smrg#include <fontconfig.h> 39252c393a42Smrg 3926a6844aabSmrg 3927a6844aabSmrgvoid FcAtomicDeleteNew(FcAtomic *atomic); 39282c393a42Smrg 39292c393a42SmrgDescription 39302c393a42Smrg 3931a6844aabSmrgDeletes the new file. Used in error recovery to back out changes. 39322c393a42Smrg 39332c393a42SmrgVersion 39342c393a42Smrg 3935a6844aabSmrgFontconfig version 2.8.0 39362c393a42Smrg 39372c393a42SmrgFcAtomicUnlock 39382c393a42Smrg 39392c393a42SmrgName 39402c393a42Smrg 3941a6844aabSmrgFcAtomicUnlock -- unlock a file 39422c393a42Smrg 39432c393a42SmrgSynopsis 39442c393a42Smrg 39452c393a42Smrg#include <fontconfig.h> 39462c393a42Smrg 3947a6844aabSmrg 3948a6844aabSmrgvoid FcAtomicUnlock(FcAtomic *atomic); 39492c393a42Smrg 39502c393a42SmrgDescription 39512c393a42Smrg 3952a6844aabSmrgUnlocks the file. 39532c393a42Smrg 39542c393a42SmrgVersion 39552c393a42Smrg 3956a6844aabSmrgFontconfig version 2.8.0 39572c393a42Smrg 39582c393a42SmrgFcAtomicDestroy 39592c393a42Smrg 39602c393a42SmrgName 39612c393a42Smrg 3962a6844aabSmrgFcAtomicDestroy -- destroy an FcAtomic object 39632c393a42Smrg 39642c393a42SmrgSynopsis 39652c393a42Smrg 39662c393a42Smrg#include <fontconfig.h> 39672c393a42Smrg 3968a6844aabSmrg 3969a6844aabSmrgvoid FcAtomicDestroy(FcAtomic *atomic); 39702c393a42Smrg 39712c393a42SmrgDescription 39722c393a42Smrg 3973a6844aabSmrgDestroys atomic. 39742c393a42Smrg 39752c393a42SmrgVersion 39762c393a42Smrg 3977a6844aabSmrgFontconfig version 2.8.0 39782c393a42Smrg 3979a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 39802c393a42Smrg 3981a6844aabSmrgFile and Directory routines 39822c393a42Smrg 3983a6844aabSmrgTable of Contents 3984a6844aabSmrgFcFileScan -- scan a font file 3985a6844aabSmrgFcFileIsDir -- check whether a file is a directory 3986a6844aabSmrgFcDirScan -- scan a font directory without caching it 3987a6844aabSmrgFcDirSave -- DEPRECATED: formerly used to save a directory cache 3988a6844aabSmrgFcDirCacheUnlink -- Remove all caches related to dir 3989a6844aabSmrgFcDirCacheValid -- check directory cache 3990a6844aabSmrgFcDirCacheLoad -- load a directory cache 3991a6844aabSmrgFcDirCacheRead -- read or construct a directory cache 3992a6844aabSmrgFcDirCacheLoadFile -- load a cache file 3993a6844aabSmrgFcDirCacheUnload -- unload a cache file 39942c393a42Smrg 3995a6844aabSmrgThese routines work with font files and directories, including font directory 3996a6844aabSmrgcache files. 39972c393a42Smrg 39982c393a42SmrgFcFileScan 39992c393a42Smrg 40002c393a42SmrgName 40012c393a42Smrg 4002a6844aabSmrgFcFileScan -- scan a font file 40032c393a42Smrg 40042c393a42SmrgSynopsis 40052c393a42Smrg 40062c393a42Smrg#include <fontconfig.h> 40072c393a42Smrg 4008a6844aabSmrg 4009a6844aabSmrgFcBool FcFileScan(FcFontSet *set, FcStrSet *dirs, FcFileCache *cache, FcBlanks 4010a6844aabSmrg*blanks, const FcChar8 *file, FcBool force); 40112c393a42Smrg 40122c393a42SmrgDescription 40132c393a42Smrg 4014a6844aabSmrgScans a single file and adds all fonts found to set. If force is FcTrue, then 4015a6844aabSmrgthe file is scanned even if associated information is found in cache. If file 4016a6844aabSmrgis a directory, it is added to dirs. Whether fonts are found depends on 4017a6844aabSmrgfontconfig policy as well as the current configuration. Internally, fontconfig 4018a6844aabSmrgwill ignore BDF and PCF fonts which are not in Unicode (or the effectively 4019a6844aabSmrgequivalent ISO Latin-1) encoding as those are not usable by Unicode-based 4020a6844aabSmrgapplications. The configuration can ignore fonts based on filename or contents 4021a6844aabSmrgof the font file itself. Returns FcFalse if any of the fonts cannot be added 4022a6844aabSmrg(due to allocation failure). Otherwise returns FcTrue. 40232c393a42Smrg 40242c393a42SmrgVersion 40252c393a42Smrg 4026a6844aabSmrgFontconfig version 2.8.0 40272c393a42Smrg 40282c393a42SmrgFcFileIsDir 40292c393a42Smrg 40302c393a42SmrgName 40312c393a42Smrg 4032a6844aabSmrgFcFileIsDir -- check whether a file is a directory 40332c393a42Smrg 40342c393a42SmrgSynopsis 40352c393a42Smrg 40362c393a42Smrg#include <fontconfig.h> 40372c393a42Smrg 4038a6844aabSmrg 4039a6844aabSmrgFcBool FcFileIsDir(const FcChar8 *file); 40402c393a42Smrg 40412c393a42SmrgDescription 40422c393a42Smrg 4043a6844aabSmrgReturns FcTrue if file is a directory, otherwise returns FcFalse. 40442c393a42Smrg 40452c393a42SmrgVersion 40462c393a42Smrg 4047a6844aabSmrgFontconfig version 2.8.0 40482c393a42Smrg 40492c393a42SmrgFcDirScan 40502c393a42Smrg 40512c393a42SmrgName 40522c393a42Smrg 4053a6844aabSmrgFcDirScan -- scan a font directory without caching it 40542c393a42Smrg 40552c393a42SmrgSynopsis 40562c393a42Smrg 40572c393a42Smrg#include <fontconfig.h> 40582c393a42Smrg 4059a6844aabSmrg 4060a6844aabSmrgFcBool FcDirScan(FcFontSet *set, FcStrSet *dirs, FcFileCache *cache, FcBlanks * 4061a6844aabSmrgblanks, const FcChar8 *dir, FcBool force); 40622c393a42Smrg 40632c393a42SmrgDescription 40642c393a42Smrg 4065a6844aabSmrgIf cache is not zero or if force is FcFalse, this function currently returns 4066a6844aabSmrgFcFalse. Otherwise, it scans an entire directory and adds all fonts found to 4067a6844aabSmrgset. Any subdirectories found are added to dirs. Calling this function does not 4068a6844aabSmrgcreate any cache files. Use FcDirCacheRead() if caching is desired. 40692c393a42Smrg 40702c393a42SmrgVersion 40712c393a42Smrg 4072a6844aabSmrgFontconfig version 2.8.0 40732c393a42Smrg 40742c393a42SmrgFcDirSave 40752c393a42Smrg 40762c393a42SmrgName 40772c393a42Smrg 4078a6844aabSmrgFcDirSave -- DEPRECATED: formerly used to save a directory cache 40792c393a42Smrg 40802c393a42SmrgSynopsis 40812c393a42Smrg 40822c393a42Smrg#include <fontconfig.h> 40832c393a42Smrg 4084a6844aabSmrg 4085a6844aabSmrgFcBool FcDirSave(FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir); 40862c393a42Smrg 40872c393a42SmrgDescription 40882c393a42Smrg 4089a6844aabSmrgThis function now does nothing aside from returning FcFalse. It used to creates 4090a6844aabSmrgthe per-directory cache file for dir and populates it with the fonts in set and 4091a6844aabSmrgsubdirectories in dirs. All of this functionality is now automatically managed 4092a6844aabSmrgby FcDirCacheLoad and FcDirCacheRead. 40932c393a42Smrg 40942c393a42SmrgVersion 40952c393a42Smrg 4096a6844aabSmrgFontconfig version 2.8.0 40972c393a42Smrg 40982c393a42SmrgFcDirCacheUnlink 40992c393a42Smrg 41002c393a42SmrgName 41012c393a42Smrg 4102a6844aabSmrgFcDirCacheUnlink -- Remove all caches related to dir 41032c393a42Smrg 41042c393a42SmrgSynopsis 41052c393a42Smrg 41062c393a42Smrg#include <fontconfig.h> 41072c393a42Smrg 4108a6844aabSmrg 4109a6844aabSmrgFcBool FcDirCacheUnlink(const FcChar8 *dir, FcConfig *config); 41102c393a42Smrg 41112c393a42SmrgDescription 41122c393a42Smrg 4113a6844aabSmrgScans the cache directories in config, removing any instances of the cache file 4114a6844aabSmrgfor dir. Returns FcFalse when some internal error occurs (out of memory, etc). 4115a6844aabSmrgErrors actually unlinking any files are ignored. 41162c393a42Smrg 41172c393a42SmrgVersion 41182c393a42Smrg 4119a6844aabSmrgFontconfig version 2.8.0 41202c393a42Smrg 41212c393a42SmrgFcDirCacheValid 41222c393a42Smrg 41232c393a42SmrgName 41242c393a42Smrg 4125a6844aabSmrgFcDirCacheValid -- check directory cache 41262c393a42Smrg 41272c393a42SmrgSynopsis 41282c393a42Smrg 41292c393a42Smrg#include <fontconfig.h> 41302c393a42Smrg 4131a6844aabSmrg 4132a6844aabSmrgFcBool FcDirCacheValid(const FcChar8 *dir); 41332c393a42Smrg 41342c393a42SmrgDescription 41352c393a42Smrg 4136a6844aabSmrgReturns FcTrue if dir has an associated valid cache file, else returns FcFalse 41372c393a42Smrg 41382c393a42SmrgVersion 41392c393a42Smrg 4140a6844aabSmrgFontconfig version 2.8.0 41412c393a42Smrg 41422c393a42SmrgFcDirCacheLoad 41432c393a42Smrg 41442c393a42SmrgName 41452c393a42Smrg 4146a6844aabSmrgFcDirCacheLoad -- load a directory cache 41472c393a42Smrg 41482c393a42SmrgSynopsis 41492c393a42Smrg 41502c393a42Smrg#include <fontconfig.h> 41512c393a42Smrg 4152a6844aabSmrg 4153a6844aabSmrgFcCache * FcDirCacheLoad(const FcChar8 *dir, FcConfig *config, FcChar8 ** 4154a6844aabSmrgcache_file); 41552c393a42Smrg 41562c393a42SmrgDescription 41572c393a42Smrg 4158a6844aabSmrgLoads the cache related to dir. If no cache file exists, returns NULL. The name 4159a6844aabSmrgof the cache file is returned in cache_file, unless that is NULL. See also 4160a6844aabSmrgFcDirCacheRead. 41612c393a42Smrg 41622c393a42SmrgVersion 41632c393a42Smrg 4164a6844aabSmrgFontconfig version 2.8.0 41652c393a42Smrg 41662c393a42SmrgFcDirCacheRead 41672c393a42Smrg 41682c393a42SmrgName 41692c393a42Smrg 4170a6844aabSmrgFcDirCacheRead -- read or construct a directory cache 41712c393a42Smrg 41722c393a42SmrgSynopsis 41732c393a42Smrg 41742c393a42Smrg#include <fontconfig.h> 41752c393a42Smrg 4176a6844aabSmrg 4177a6844aabSmrgFcCache * FcDirCacheRead(const FcChar8 *dir, FcBool force, FcConfig *config); 41782c393a42Smrg 41792c393a42SmrgDescription 41802c393a42Smrg 4181a6844aabSmrgThis returns a cache for dir. If force is FcFalse, then an existing, valid 4182a6844aabSmrgcache file will be used. Otherwise, a new cache will be created by scanning the 4183a6844aabSmrgdirectory and that returned. 41842c393a42Smrg 41852c393a42SmrgVersion 41862c393a42Smrg 4187a6844aabSmrgFontconfig version 2.8.0 41882c393a42Smrg 41892c393a42SmrgFcDirCacheLoadFile 41902c393a42Smrg 41912c393a42SmrgName 41922c393a42Smrg 4193a6844aabSmrgFcDirCacheLoadFile -- load a cache file 41942c393a42Smrg 41952c393a42SmrgSynopsis 41962c393a42Smrg 41972c393a42Smrg#include <fontconfig.h> 41982c393a42Smrg 4199a6844aabSmrg 4200a6844aabSmrgFcCache * FcDirCacheLoadFile(const FcChar8 *cache_file, struct stat *file_stat 4201a6844aabSmrg); 42022c393a42Smrg 42032c393a42SmrgDescription 42042c393a42Smrg 4205a6844aabSmrgThis function loads a directory cache from cache_file. If file_stat is 4206a6844aabSmrgnon-NULL, it will be filled with the results of stat(2) on the cache file. 42072c393a42Smrg 42082c393a42SmrgVersion 42092c393a42Smrg 4210a6844aabSmrgFontconfig version 2.8.0 42112c393a42Smrg 42122c393a42SmrgFcDirCacheUnload 42132c393a42Smrg 42142c393a42SmrgName 42152c393a42Smrg 4216a6844aabSmrgFcDirCacheUnload -- unload a cache file 42172c393a42Smrg 42182c393a42SmrgSynopsis 42192c393a42Smrg 42202c393a42Smrg#include <fontconfig.h> 42212c393a42Smrg 4222a6844aabSmrg 4223a6844aabSmrgvoid FcDirCacheUnload(FcCache *cache); 42242c393a42Smrg 42252c393a42SmrgDescription 42262c393a42Smrg 4227a6844aabSmrgThis function dereferences cache. When no other references to it remain, all 4228a6844aabSmrgmemory associated with the cache will be freed. 42292c393a42Smrg 42302c393a42SmrgVersion 42312c393a42Smrg 4232a6844aabSmrgFontconfig version 2.8.0 42332c393a42Smrg 4234a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42352c393a42Smrg 4236a6844aabSmrgFcCache routines 42372c393a42Smrg 4238a6844aabSmrgTable of Contents 4239a6844aabSmrgFcCacheDir -- Return directory of cache 4240a6844aabSmrgFcCacheCopySet -- Returns a copy of the fontset from cache 4241a6844aabSmrgFcCacheSubdir -- Return the i'th subdirectory. 4242a6844aabSmrgFcCacheNumSubdir -- Return the number of subdirectories in cache. 4243a6844aabSmrgFcCacheNumFont -- Returns the number of fonts in cache. 42442c393a42Smrg 4245a6844aabSmrgThese routines work with font directory caches, accessing their contents in 4246a6844aabSmrglimited ways. It is not expected that normal applications will need to use 4247a6844aabSmrgthese functions. 42482c393a42Smrg 42492c393a42SmrgFcCacheDir 42502c393a42Smrg 42512c393a42SmrgName 42522c393a42Smrg 4253a6844aabSmrgFcCacheDir -- Return directory of cache 42542c393a42Smrg 42552c393a42SmrgSynopsis 42562c393a42Smrg 42572c393a42Smrg#include <fontconfig.h> 42582c393a42Smrg 4259a6844aabSmrg 4260a6844aabSmrgconst FcChar8 * FcCacheDir(const FcCache *cache); 42612c393a42Smrg 42622c393a42SmrgDescription 42632c393a42Smrg 4264a6844aabSmrgThis function returns the directory from which the cache was constructed. 42652c393a42Smrg 42662c393a42SmrgVersion 42672c393a42Smrg 4268a6844aabSmrgFontconfig version 2.8.0 42692c393a42Smrg 42702c393a42SmrgFcCacheCopySet 42712c393a42Smrg 42722c393a42SmrgName 42732c393a42Smrg 4274a6844aabSmrgFcCacheCopySet -- Returns a copy of the fontset from cache 42752c393a42Smrg 42762c393a42SmrgSynopsis 42772c393a42Smrg 42782c393a42Smrg#include <fontconfig.h> 42792c393a42Smrg 4280a6844aabSmrg 4281a6844aabSmrgFcFontSet * FcCacheCopySet(const FcCache *cache); 42822c393a42Smrg 42832c393a42SmrgDescription 42842c393a42Smrg 4285a6844aabSmrgThe returned fontset contains each of the font patterns from cache. This 4286a6844aabSmrgfontset may be modified, but the patterns from the cache are read-only. 42872c393a42Smrg 42882c393a42SmrgVersion 42892c393a42Smrg 4290a6844aabSmrgFontconfig version 2.8.0 42912c393a42Smrg 42922c393a42SmrgFcCacheSubdir 42932c393a42Smrg 42942c393a42SmrgName 42952c393a42Smrg 4296a6844aabSmrgFcCacheSubdir -- Return the i'th subdirectory. 42972c393a42Smrg 42982c393a42SmrgSynopsis 42992c393a42Smrg 43002c393a42Smrg#include <fontconfig.h> 43012c393a42Smrg 4302a6844aabSmrg 4303a6844aabSmrgconst FcChar8 * FcCacheSubdir(const FcCache *cache, inti); 43042c393a42Smrg 43052c393a42SmrgDescription 43062c393a42Smrg 4307a6844aabSmrgThe set of subdirectories stored in a cache file are indexed by this function, 4308a6844aabSmrgi should range from 0 to n-1, where n is the return value from 4309a6844aabSmrgFcCacheNumSubdir. 43102c393a42Smrg 43112c393a42SmrgVersion 43122c393a42Smrg 4313a6844aabSmrgFontconfig version 2.8.0 43142c393a42Smrg 43152c393a42SmrgFcCacheNumSubdir 43162c393a42Smrg 43172c393a42SmrgName 43182c393a42Smrg 4319a6844aabSmrgFcCacheNumSubdir -- Return the number of subdirectories in cache. 43202c393a42Smrg 43212c393a42SmrgSynopsis 43222c393a42Smrg 43232c393a42Smrg#include <fontconfig.h> 43242c393a42Smrg 4325a6844aabSmrg 4326a6844aabSmrgint FcCacheNumSubdir(const FcCache *cache); 43272c393a42Smrg 43282c393a42SmrgDescription 43292c393a42Smrg 4330a6844aabSmrgThis returns the total number of subdirectories in the cache. 43312c393a42Smrg 43322c393a42SmrgVersion 43332c393a42Smrg 4334a6844aabSmrgFontconfig version 2.8.0 43352c393a42Smrg 43362c393a42SmrgFcCacheNumFont 43372c393a42Smrg 43382c393a42SmrgName 43392c393a42Smrg 4340a6844aabSmrgFcCacheNumFont -- Returns the number of fonts in cache. 43412c393a42Smrg 43422c393a42SmrgSynopsis 43432c393a42Smrg 43442c393a42Smrg#include <fontconfig.h> 43452c393a42Smrg 4346a6844aabSmrg 4347a6844aabSmrgint FcCacheNumFont(const FcCache *cache); 43482c393a42Smrg 43492c393a42SmrgDescription 43502c393a42Smrg 4351a6844aabSmrgThis returns the number of fonts which would be included in the return from 4352a6844aabSmrgFcCacheCopySet. 43532c393a42Smrg 43542c393a42SmrgVersion 43552c393a42Smrg 4356a6844aabSmrgFontconfig version 2.8.0 4357a6844aabSmrg 4358a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43592c393a42Smrg 4360a6844aabSmrgFcStrSet and FcStrList 43612c393a42Smrg 4362a6844aabSmrgTable of Contents 4363a6844aabSmrgFcStrSetCreate -- create a string set 4364a6844aabSmrgFcStrSetMember -- check set for membership 4365a6844aabSmrgFcStrSetEqual -- check sets for equality 4366a6844aabSmrgFcStrSetAdd -- add to a string set 4367a6844aabSmrgFcStrSetAddFilename -- add a filename to a string set 4368a6844aabSmrgFcStrSetDel -- delete from a string set 4369a6844aabSmrgFcStrSetDestroy -- destroy a string set 4370a6844aabSmrgFcStrListCreate -- create a string iterator 4371a6844aabSmrgFcStrListNext -- get next string in iteration 4372a6844aabSmrgFcStrListDone -- destroy a string iterator 43732c393a42Smrg 4374a6844aabSmrgA data structure for enumerating strings, used to list directories while 4375a6844aabSmrgscanning the configuration as directories are added while scanning. 43762c393a42Smrg 43772c393a42SmrgFcStrSetCreate 43782c393a42Smrg 43792c393a42SmrgName 43802c393a42Smrg 4381a6844aabSmrgFcStrSetCreate -- create a string set 43822c393a42Smrg 43832c393a42SmrgSynopsis 43842c393a42Smrg 43852c393a42Smrg#include <fontconfig.h> 43862c393a42Smrg 4387a6844aabSmrg 4388a6844aabSmrgFcStrSet * FcStrSetCreate(void); 43892c393a42Smrg 43902c393a42SmrgDescription 43912c393a42Smrg 4392a6844aabSmrgCreate an empty set. 43932c393a42Smrg 43942c393a42SmrgVersion 43952c393a42Smrg 4396a6844aabSmrgFontconfig version 2.8.0 43972c393a42Smrg 43982c393a42SmrgFcStrSetMember 43992c393a42Smrg 44002c393a42SmrgName 44012c393a42Smrg 4402a6844aabSmrgFcStrSetMember -- check set for membership 44032c393a42Smrg 44042c393a42SmrgSynopsis 44052c393a42Smrg 44062c393a42Smrg#include <fontconfig.h> 44072c393a42Smrg 4408a6844aabSmrg 4409a6844aabSmrgFcBool FcStrSetMember(FcStrSet *set, const FcChar8 *s); 44102c393a42Smrg 44112c393a42SmrgDescription 44122c393a42Smrg 4413a6844aabSmrgReturns whether s is a member of set. 44142c393a42Smrg 44152c393a42SmrgVersion 44162c393a42Smrg 4417a6844aabSmrgFontconfig version 2.8.0 44182c393a42Smrg 44192c393a42SmrgFcStrSetEqual 44202c393a42Smrg 44212c393a42SmrgName 44222c393a42Smrg 4423a6844aabSmrgFcStrSetEqual -- check sets for equality 44242c393a42Smrg 44252c393a42SmrgSynopsis 44262c393a42Smrg 44272c393a42Smrg#include <fontconfig.h> 44282c393a42Smrg 4429a6844aabSmrg 4430a6844aabSmrgFcBool FcStrSetEqual(FcStrSet *set_a, FcStrSet *set_b); 44312c393a42Smrg 44322c393a42SmrgDescription 44332c393a42Smrg 4434a6844aabSmrgReturns whether set_a contains precisely the same strings as set_b. Ordering of 4435a6844aabSmrgstrings within the two sets is not considered. 44362c393a42Smrg 44372c393a42SmrgVersion 44382c393a42Smrg 4439a6844aabSmrgFontconfig version 2.8.0 44402c393a42Smrg 44412c393a42SmrgFcStrSetAdd 44422c393a42Smrg 44432c393a42SmrgName 44442c393a42Smrg 4445a6844aabSmrgFcStrSetAdd -- add to a string set 44462c393a42Smrg 44472c393a42SmrgSynopsis 44482c393a42Smrg 44492c393a42Smrg#include <fontconfig.h> 44502c393a42Smrg 4451a6844aabSmrg 4452a6844aabSmrgFcBool FcStrSetAdd(FcStrSet *set, const FcChar8 *s); 44532c393a42Smrg 44542c393a42SmrgDescription 44552c393a42Smrg 4456a6844aabSmrgAdds a copy of s to set. 44572c393a42Smrg 44582c393a42SmrgVersion 44592c393a42Smrg 4460a6844aabSmrgFontconfig version 2.8.0 44612c393a42Smrg 44622c393a42SmrgFcStrSetAddFilename 44632c393a42Smrg 44642c393a42SmrgName 44652c393a42Smrg 4466a6844aabSmrgFcStrSetAddFilename -- add a filename to a string set 44672c393a42Smrg 44682c393a42SmrgSynopsis 44692c393a42Smrg 44702c393a42Smrg#include <fontconfig.h> 44712c393a42Smrg 4472a6844aabSmrg 4473a6844aabSmrgFcBool FcStrSetAddFilename(FcStrSet *set, const FcChar8 *s); 44742c393a42Smrg 44752c393a42SmrgDescription 44762c393a42Smrg 4477a6844aabSmrgAdds a copy s to set, The copy is created with FcStrCopyFilename so that 4478a6844aabSmrgleading '~' values are replaced with the value of the HOME environment 4479a6844aabSmrgvariable. 44802c393a42Smrg 44812c393a42SmrgVersion 44822c393a42Smrg 4483a6844aabSmrgFontconfig version 2.8.0 44842c393a42Smrg 44852c393a42SmrgFcStrSetDel 44862c393a42Smrg 44872c393a42SmrgName 44882c393a42Smrg 4489a6844aabSmrgFcStrSetDel -- delete from a string set 44902c393a42Smrg 44912c393a42SmrgSynopsis 44922c393a42Smrg 44932c393a42Smrg#include <fontconfig.h> 44942c393a42Smrg 4495a6844aabSmrg 4496a6844aabSmrgFcBool FcStrSetDel(FcStrSet *set, const FcChar8 *s); 44972c393a42Smrg 44982c393a42SmrgDescription 44992c393a42Smrg 4500a6844aabSmrgRemoves s from set, returning FcTrue if s was a member else FcFalse. 45012c393a42Smrg 45022c393a42SmrgVersion 45032c393a42Smrg 4504a6844aabSmrgFontconfig version 2.8.0 45052c393a42Smrg 45062c393a42SmrgFcStrSetDestroy 45072c393a42Smrg 45082c393a42SmrgName 45092c393a42Smrg 4510a6844aabSmrgFcStrSetDestroy -- destroy a string set 45112c393a42Smrg 45122c393a42SmrgSynopsis 45132c393a42Smrg 45142c393a42Smrg#include <fontconfig.h> 45152c393a42Smrg 4516a6844aabSmrg 4517a6844aabSmrgvoid FcStrSetDestroy(FcStrSet *set); 45182c393a42Smrg 45192c393a42SmrgDescription 45202c393a42Smrg 4521a6844aabSmrgDestroys set. 45222c393a42Smrg 45232c393a42SmrgVersion 45242c393a42Smrg 4525a6844aabSmrgFontconfig version 2.8.0 45262c393a42Smrg 45272c393a42SmrgFcStrListCreate 45282c393a42Smrg 45292c393a42SmrgName 45302c393a42Smrg 4531a6844aabSmrgFcStrListCreate -- create a string iterator 45322c393a42Smrg 45332c393a42SmrgSynopsis 45342c393a42Smrg 45352c393a42Smrg#include <fontconfig.h> 45362c393a42Smrg 4537a6844aabSmrg 4538a6844aabSmrgFcStrList * FcStrListCreate(FcStrSet *set); 45392c393a42Smrg 45402c393a42SmrgDescription 45412c393a42Smrg 4542a6844aabSmrgCreates an iterator to list the strings in set. 45432c393a42Smrg 45442c393a42SmrgVersion 45452c393a42Smrg 4546a6844aabSmrgFontconfig version 2.8.0 45472c393a42Smrg 45482c393a42SmrgFcStrListNext 45492c393a42Smrg 45502c393a42SmrgName 45512c393a42Smrg 4552a6844aabSmrgFcStrListNext -- get next string in iteration 45532c393a42Smrg 45542c393a42SmrgSynopsis 45552c393a42Smrg 45562c393a42Smrg#include <fontconfig.h> 45572c393a42Smrg 4558a6844aabSmrg 4559a6844aabSmrgFcChar8 * FcStrListNext(FcStrList *list); 45602c393a42Smrg 45612c393a42SmrgDescription 45622c393a42Smrg 4563a6844aabSmrgReturns the next string in set. 45642c393a42Smrg 45652c393a42SmrgVersion 45662c393a42Smrg 4567a6844aabSmrgFontconfig version 2.8.0 45682c393a42Smrg 45692c393a42SmrgFcStrListDone 45702c393a42Smrg 45712c393a42SmrgName 45722c393a42Smrg 4573a6844aabSmrgFcStrListDone -- destroy a string iterator 45742c393a42Smrg 45752c393a42SmrgSynopsis 45762c393a42Smrg 45772c393a42Smrg#include <fontconfig.h> 45782c393a42Smrg 4579a6844aabSmrg 4580a6844aabSmrgvoid FcStrListDone(FcStrList *list); 45812c393a42Smrg 45822c393a42SmrgDescription 45832c393a42Smrg 4584a6844aabSmrgDestroys the enumerator list. 45852c393a42Smrg 45862c393a42SmrgVersion 45872c393a42Smrg 4588a6844aabSmrgFontconfig version 2.8.0 45892c393a42Smrg 4590a6844aabSmrg━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45912c393a42Smrg 4592a6844aabSmrgString utilities 45932c393a42Smrg 4594a6844aabSmrgTable of Contents 4595a6844aabSmrgFcUtf8ToUcs4 -- convert UTF-8 to UCS4 4596a6844aabSmrgFcUcs4ToUtf8 -- convert UCS4 to UTF-8 4597a6844aabSmrgFcUtf8Len -- count UTF-8 encoded chars 4598a6844aabSmrgFcUtf16ToUcs4 -- convert UTF-16 to UCS4 4599a6844aabSmrgFcUtf16Len -- count UTF-16 encoded chars 4600a6844aabSmrgFcIsLower -- check for lower case ASCII character 4601a6844aabSmrgFcIsUpper -- check for upper case ASCII character 4602a6844aabSmrgFcToLower -- convert upper case ASCII to lower case 4603a6844aabSmrgFcStrCopy -- duplicate a string 4604a6844aabSmrgFcStrDowncase -- create a lower case translation of a string 4605a6844aabSmrgFcStrCopyFilename -- create a complete path from a filename 4606a6844aabSmrgFcStrCmp -- compare UTF-8 strings 4607a6844aabSmrgFcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case 4608a6844aabSmrgFcStrStr -- locate UTF-8 substring 4609a6844aabSmrgFcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII case 4610a6844aabSmrgFcStrPlus -- concatenate two strings 4611a6844aabSmrgFcStrFree -- free a string 4612a6844aabSmrgFcStrDirname -- directory part of filename 4613a6844aabSmrgFcStrBasename -- last component of filename 46142c393a42Smrg 4615a6844aabSmrgFontconfig manipulates many UTF-8 strings represented with the FcChar8 type. 4616a6844aabSmrgThese functions are exposed to help applications deal with these UTF-8 strings 4617a6844aabSmrgin a locale-insensitive manner. 46182c393a42Smrg 46192c393a42SmrgFcUtf8ToUcs4 46202c393a42Smrg 46212c393a42SmrgName 46222c393a42Smrg 4623a6844aabSmrgFcUtf8ToUcs4 -- convert UTF-8 to UCS4 46242c393a42Smrg 46252c393a42SmrgSynopsis 46262c393a42Smrg 46272c393a42Smrg#include <fontconfig.h> 46282c393a42Smrg 4629a6844aabSmrg 4630a6844aabSmrgint FcUtf8ToUcs4(FcChar8 *src, FcChar32 *dst, int len); 46312c393a42Smrg 46322c393a42SmrgDescription 46332c393a42Smrg 4634a6844aabSmrgConverts the next Unicode char from src into dst and returns the number of 4635a6844aabSmrgbytes containing the char. src must be at least len bytes long. 46362c393a42Smrg 46372c393a42SmrgVersion 46382c393a42Smrg 4639a6844aabSmrgFontconfig version 2.8.0 46402c393a42Smrg 46412c393a42SmrgFcUcs4ToUtf8 46422c393a42Smrg 46432c393a42SmrgName 46442c393a42Smrg 4645a6844aabSmrgFcUcs4ToUtf8 -- convert UCS4 to UTF-8 46462c393a42Smrg 46472c393a42SmrgSynopsis 46482c393a42Smrg 46492c393a42Smrg#include <fontconfig.h> 46502c393a42Smrg 4651a6844aabSmrg 4652a6844aabSmrgint FcUcs4ToUtf8(FcChar32 src, FcChar8 dst[FC_UTF8_MAX_LEN]); 46532c393a42Smrg 46542c393a42SmrgDescription 46552c393a42Smrg 4656a6844aabSmrgConverts the Unicode char from src into dst and returns the number of bytes 4657a6844aabSmrgneeded to encode the char. 46582c393a42Smrg 46592c393a42SmrgVersion 46602c393a42Smrg 4661a6844aabSmrgFontconfig version 2.8.0 46622c393a42Smrg 46632c393a42SmrgFcUtf8Len 46642c393a42Smrg 46652c393a42SmrgName 46662c393a42Smrg 4667a6844aabSmrgFcUtf8Len -- count UTF-8 encoded chars 46682c393a42Smrg 46692c393a42SmrgSynopsis 46702c393a42Smrg 46712c393a42Smrg#include <fontconfig.h> 46722c393a42Smrg 4673a6844aabSmrg 4674a6844aabSmrgFcBool FcUtf8Len(FcChar8 *src, int len, int *nchar, int *wchar); 46752c393a42Smrg 46762c393a42SmrgDescription 46772c393a42Smrg 4678a6844aabSmrgCounts the number of Unicode chars in len bytes of src. Places that count in 4679a6844aabSmrgnchar. wchar contains 1, 2 or 4 depending on the number of bytes needed to hold 4680a6844aabSmrgthe largest unicode char counted. The return value indicates whether src is a 4681a6844aabSmrgwell-formed UTF8 string. 46822c393a42Smrg 46832c393a42SmrgVersion 46842c393a42Smrg 4685a6844aabSmrgFontconfig version 2.8.0 46862c393a42Smrg 46872c393a42SmrgFcUtf16ToUcs4 46882c393a42Smrg 46892c393a42SmrgName 46902c393a42Smrg 4691a6844aabSmrgFcUtf16ToUcs4 -- convert UTF-16 to UCS4 46922c393a42Smrg 46932c393a42SmrgSynopsis 46942c393a42Smrg 46952c393a42Smrg#include <fontconfig.h> 46962c393a42Smrg 4697a6844aabSmrg 4698a6844aabSmrgint FcUtf16ToUcs4(FcChar8 *src, FcEndian endian, FcChar32 *dst, int len); 46992c393a42Smrg 47002c393a42SmrgDescription 47012c393a42Smrg 4702a6844aabSmrgConverts the next Unicode char from src into dst and returns the number of 4703a6844aabSmrgbytes containing the char. src must be at least len bytes long. Bytes of src 4704a6844aabSmrgare combined into 16-bit units according to endian. 47052c393a42Smrg 47062c393a42SmrgVersion 47072c393a42Smrg 4708a6844aabSmrgFontconfig version 2.8.0 47092c393a42Smrg 47102c393a42SmrgFcUtf16Len 47112c393a42Smrg 47122c393a42SmrgName 47132c393a42Smrg 4714a6844aabSmrgFcUtf16Len -- count UTF-16 encoded chars 47152c393a42Smrg 47162c393a42SmrgSynopsis 47172c393a42Smrg 47182c393a42Smrg#include <fontconfig.h> 47192c393a42Smrg 4720a6844aabSmrg 4721a6844aabSmrgFcBool FcUtf16Len(FcChar8 *src, FcEndian endian, int len, int *nchar, int * 4722a6844aabSmrgwchar); 47232c393a42Smrg 47242c393a42SmrgDescription 47252c393a42Smrg 4726a6844aabSmrgCounts the number of Unicode chars in len bytes of src. Bytes of src are 4727a6844aabSmrgcombined into 16-bit units according to endian. Places that count in nchar. 4728a6844aabSmrgwchar contains 1, 2 or 4 depending on the number of bytes needed to hold the 4729a6844aabSmrglargest unicode char counted. The return value indicates whether string is a 4730a6844aabSmrgwell-formed UTF16 string. 47312c393a42Smrg 47322c393a42SmrgVersion 47332c393a42Smrg 4734a6844aabSmrgFontconfig version 2.8.0 47352c393a42Smrg 47362c393a42SmrgFcIsLower 47372c393a42Smrg 47382c393a42SmrgName 47392c393a42Smrg 4740a6844aabSmrgFcIsLower -- check for lower case ASCII character 47412c393a42Smrg 47422c393a42SmrgSynopsis 47432c393a42Smrg 47442c393a42Smrg#include <fontconfig.h> 47452c393a42Smrg 4746a6844aabSmrg 4747a6844aabSmrgFcBool FcIsLower(FcChar8c); 47482c393a42Smrg 47492c393a42SmrgDescription 47502c393a42Smrg 4751a6844aabSmrgThis macro checks whether c is an lower case ASCII letter. 47522c393a42Smrg 47532c393a42SmrgVersion 47542c393a42Smrg 4755a6844aabSmrgFontconfig version 2.8.0 47562c393a42Smrg 47572c393a42SmrgFcIsUpper 47582c393a42Smrg 47592c393a42SmrgName 47602c393a42Smrg 4761a6844aabSmrgFcIsUpper -- check for upper case ASCII character 47622c393a42Smrg 47632c393a42SmrgSynopsis 47642c393a42Smrg 47652c393a42Smrg#include <fontconfig.h> 47662c393a42Smrg 4767a6844aabSmrg 4768a6844aabSmrgFcBool FcIsUpper(FcChar8c); 47692c393a42Smrg 47702c393a42SmrgDescription 47712c393a42Smrg 4772a6844aabSmrgThis macro checks whether c is a upper case ASCII letter. 47732c393a42Smrg 47742c393a42SmrgVersion 47752c393a42Smrg 4776a6844aabSmrgFontconfig version 2.8.0 47772c393a42Smrg 47782c393a42SmrgFcToLower 47792c393a42Smrg 47802c393a42SmrgName 47812c393a42Smrg 4782a6844aabSmrgFcToLower -- convert upper case ASCII to lower case 47832c393a42Smrg 47842c393a42SmrgSynopsis 47852c393a42Smrg 47862c393a42Smrg#include <fontconfig.h> 47872c393a42Smrg 4788a6844aabSmrg 4789a6844aabSmrgFcChar8 FcToLower(FcChar8c); 47902c393a42Smrg 47912c393a42SmrgDescription 47922c393a42Smrg 4793a6844aabSmrgThis macro converts upper case ASCII c to the equivalent lower case letter. 47942c393a42Smrg 47952c393a42SmrgVersion 47962c393a42Smrg 4797a6844aabSmrgFontconfig version 2.8.0 47982c393a42Smrg 47992c393a42SmrgFcStrCopy 48002c393a42Smrg 48012c393a42SmrgName 48022c393a42Smrg 4803a6844aabSmrgFcStrCopy -- duplicate a string 48042c393a42Smrg 48052c393a42SmrgSynopsis 48062c393a42Smrg 48072c393a42Smrg#include <fontconfig.h> 48082c393a42Smrg 4809a6844aabSmrg 4810a6844aabSmrgFcChar8 * FcStrCopy(const FcChar8 *s); 48112c393a42Smrg 48122c393a42SmrgDescription 48132c393a42Smrg 4814a6844aabSmrgAllocates memory, copies s and returns the resulting buffer. Yes, this is 4815a6844aabSmrgstrdup, but that function isn't available on every platform. 48162c393a42Smrg 48172c393a42SmrgVersion 48182c393a42Smrg 4819a6844aabSmrgFontconfig version 2.8.0 48202c393a42Smrg 48212c393a42SmrgFcStrDowncase 48222c393a42Smrg 48232c393a42SmrgName 48242c393a42Smrg 4825a6844aabSmrgFcStrDowncase -- create a lower case translation of a string 48262c393a42Smrg 48272c393a42SmrgSynopsis 48282c393a42Smrg 48292c393a42Smrg#include <fontconfig.h> 48302c393a42Smrg 4831a6844aabSmrg 4832a6844aabSmrgFcChar8 * FcStrDowncase(const FcChar8 *s); 48332c393a42Smrg 48342c393a42SmrgDescription 48352c393a42Smrg 4836a6844aabSmrgAllocates memory, copies s, converting upper case letters to lower case and 4837a6844aabSmrgreturns the allocated buffer. 48382c393a42Smrg 48392c393a42SmrgVersion 48402c393a42Smrg 4841a6844aabSmrgFontconfig version 2.8.0 48422c393a42Smrg 48432c393a42SmrgFcStrCopyFilename 48442c393a42Smrg 48452c393a42SmrgName 48462c393a42Smrg 4847a6844aabSmrgFcStrCopyFilename -- create a complete path from a filename 48482c393a42Smrg 48492c393a42SmrgSynopsis 48502c393a42Smrg 48512c393a42Smrg#include <fontconfig.h> 48522c393a42Smrg 4853a6844aabSmrg 4854a6844aabSmrgFcChar8 * FcStrCopyFilename(const FcChar8 *s); 48552c393a42Smrg 48562c393a42SmrgDescription 48572c393a42Smrg 4858a6844aabSmrgFcStrCopyFilename constructs an absolute pathname from s. It converts any 4859a6844aabSmrgleading '~' characters in to the value of the HOME environment variable, and 4860a6844aabSmrgany relative paths are converted to absolute paths using the current working 4861a6844aabSmrgdirectory. Sequences of '/' characters are converted to a single '/', and names 4862a6844aabSmrgcontaining the current directory '.' or parent directory '..' are correctly 4863a6844aabSmrgreconstructed. Returns NULL if '~' is the leading character and HOME is unset 4864a6844aabSmrgor disabled (see FcConfigEnableHome). 48652c393a42Smrg 48662c393a42SmrgVersion 48672c393a42Smrg 4868a6844aabSmrgFontconfig version 2.8.0 48692c393a42Smrg 48702c393a42SmrgFcStrCmp 48712c393a42Smrg 48722c393a42SmrgName 48732c393a42Smrg 4874a6844aabSmrgFcStrCmp -- compare UTF-8 strings 48752c393a42Smrg 48762c393a42SmrgSynopsis 48772c393a42Smrg 48782c393a42Smrg#include <fontconfig.h> 48792c393a42Smrg 4880a6844aabSmrg 4881a6844aabSmrgint FcStrCmp(const FcChar8 *s1, const FcChar8 *s2); 48822c393a42Smrg 48832c393a42SmrgDescription 48842c393a42Smrg 4885a6844aabSmrgReturns the usual <0, 0, >0 result of comparing s1 and s2. 48862c393a42Smrg 48872c393a42SmrgVersion 48882c393a42Smrg 4889a6844aabSmrgFontconfig version 2.8.0 48902c393a42Smrg 48912c393a42SmrgFcStrCmpIgnoreCase 48922c393a42Smrg 48932c393a42SmrgName 48942c393a42Smrg 4895a6844aabSmrgFcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case 48962c393a42Smrg 48972c393a42SmrgSynopsis 48982c393a42Smrg 48992c393a42Smrg#include <fontconfig.h> 49002c393a42Smrg 4901a6844aabSmrg 4902a6844aabSmrgint FcStrCmpIgnoreCase(const FcChar8 *s1, const FcChar8 *s2); 49032c393a42Smrg 49042c393a42SmrgDescription 49052c393a42Smrg 4906a6844aabSmrgReturns the usual <0, 0, >0 result of comparing s1 and s2. This test is 4907a6844aabSmrgcase-insensitive for all proper UTF-8 encoded strings. 49082c393a42Smrg 49092c393a42SmrgVersion 49102c393a42Smrg 4911a6844aabSmrgFontconfig version 2.8.0 49122c393a42Smrg 49132c393a42SmrgFcStrStr 49142c393a42Smrg 49152c393a42SmrgName 49162c393a42Smrg 4917a6844aabSmrgFcStrStr -- locate UTF-8 substring 49182c393a42Smrg 49192c393a42SmrgSynopsis 49202c393a42Smrg 49212c393a42Smrg#include <fontconfig.h> 49222c393a42Smrg 4923a6844aabSmrg 4924a6844aabSmrgFcChar8 * FcStrStr(const FcChar8 *s1, const FcChar8 *s2); 49252c393a42Smrg 49262c393a42SmrgDescription 49272c393a42Smrg 4928a6844aabSmrgReturns the location of s2 in s1. Returns NULL if s2 is not present in s1. This 4929a6844aabSmrgtest will operate properly with UTF8 encoded strings. 49302c393a42Smrg 49312c393a42SmrgVersion 49322c393a42Smrg 4933a6844aabSmrgFontconfig version 2.8.0 49342c393a42Smrg 49352c393a42SmrgFcStrStrIgnoreCase 49362c393a42Smrg 49372c393a42SmrgName 49382c393a42Smrg 4939a6844aabSmrgFcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII case 49402c393a42Smrg 49412c393a42SmrgSynopsis 49422c393a42Smrg 49432c393a42Smrg#include <fontconfig.h> 49442c393a42Smrg 4945a6844aabSmrg 4946a6844aabSmrgFcChar8 * FcStrStrIgnoreCase(const FcChar8 *s1, const FcChar8 *s2); 49472c393a42Smrg 49482c393a42SmrgDescription 49492c393a42Smrg 4950a6844aabSmrgReturns the location of s2 in s1, ignoring case. Returns NULL if s2 is not 4951a6844aabSmrgpresent in s1. This test is case-insensitive for all proper UTF-8 encoded 4952a6844aabSmrgstrings. 49532c393a42Smrg 49542c393a42SmrgVersion 49552c393a42Smrg 4956a6844aabSmrgFontconfig version 2.8.0 49572c393a42Smrg 49582c393a42SmrgFcStrPlus 49592c393a42Smrg 49602c393a42SmrgName 49612c393a42Smrg 4962a6844aabSmrgFcStrPlus -- concatenate two strings 49632c393a42Smrg 49642c393a42SmrgSynopsis 49652c393a42Smrg 49662c393a42Smrg#include <fontconfig.h> 49672c393a42Smrg 4968a6844aabSmrg 4969a6844aabSmrgFcChar8 * FcStrPlus(const FcChar8 *s1, const FcChar8 *s2); 49702c393a42Smrg 49712c393a42SmrgDescription 49722c393a42Smrg 4973a6844aabSmrgThis function allocates new storage and places the concatenation of s1 and s2 4974a6844aabSmrgthere, returning the new string. 49752c393a42Smrg 49762c393a42SmrgVersion 49772c393a42Smrg 4978a6844aabSmrgFontconfig version 2.8.0 49792c393a42Smrg 49802c393a42SmrgFcStrFree 49812c393a42Smrg 49822c393a42SmrgName 49832c393a42Smrg 4984a6844aabSmrgFcStrFree -- free a string 49852c393a42Smrg 49862c393a42SmrgSynopsis 49872c393a42Smrg 49882c393a42Smrg#include <fontconfig.h> 49892c393a42Smrg 4990a6844aabSmrg 4991a6844aabSmrgvoid FcStrFree(FcChar8 *s); 49922c393a42Smrg 49932c393a42SmrgDescription 49942c393a42Smrg 4995a6844aabSmrgThis is just a wrapper around free(3) which helps track memory usage of strings 4996a6844aabSmrgwithin the fontconfig library. 49972c393a42Smrg 49982c393a42SmrgVersion 49992c393a42Smrg 5000a6844aabSmrgFontconfig version 2.8.0 50012c393a42Smrg 50022c393a42SmrgFcStrDirname 50032c393a42Smrg 50042c393a42SmrgName 50052c393a42Smrg 5006a6844aabSmrgFcStrDirname -- directory part of filename 50072c393a42Smrg 50082c393a42SmrgSynopsis 50092c393a42Smrg 50102c393a42Smrg#include <fontconfig.h> 50112c393a42Smrg 5012a6844aabSmrg 5013a6844aabSmrgFcChar8 * FcStrDirname(const FcChar8 *file); 50142c393a42Smrg 50152c393a42SmrgDescription 50162c393a42Smrg 5017a6844aabSmrgReturns the directory containing file. This is returned in newly allocated 5018a6844aabSmrgstorage which should be freed when no longer needed. 50192c393a42Smrg 50202c393a42SmrgVersion 50212c393a42Smrg 5022a6844aabSmrgFontconfig version 2.8.0 50232c393a42Smrg 50242c393a42SmrgFcStrBasename 50252c393a42Smrg 50262c393a42SmrgName 50272c393a42Smrg 5028a6844aabSmrgFcStrBasename -- last component of filename 50292c393a42Smrg 50302c393a42SmrgSynopsis 50312c393a42Smrg 50322c393a42Smrg#include <fontconfig.h> 50332c393a42Smrg 5034a6844aabSmrg 5035a6844aabSmrgFcChar8 * FcStrBasename(const FcChar8 *file); 50362c393a42Smrg 50372c393a42SmrgDescription 50382c393a42Smrg 5039a6844aabSmrgReturns the filename of file stripped of any leading directory names. This is 5040a6844aabSmrgreturned in newly allocated storage which should be freed when no longer 5041a6844aabSmrgneeded. 50422c393a42Smrg 50432c393a42SmrgVersion 50442c393a42Smrg 5045a6844aabSmrgFontconfig version 2.8.0 5046a6844aabSmrg 5047