1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<HTML 3><HEAD 4><TITLE 5>Datatypes</TITLE 6><META 7NAME="GENERATOR" 8CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK 9REL="HOME" 10HREF="t1.html"><LINK 11REL="PREVIOUS" 12TITLE="FUNCTIONAL OVERVIEW" 13HREF="x19.html"><LINK 14REL="NEXT" 15TITLE="FUNCTIONS" 16HREF="x103.html"></HEAD 17><BODY 18CLASS="SECT1" 19BGCOLOR="#FFFFFF" 20TEXT="#000000" 21LINK="#0000FF" 22VLINK="#840084" 23ALINK="#0000FF" 24><DIV 25CLASS="NAVHEADER" 26><TABLE 27SUMMARY="Header navigation table" 28WIDTH="100%" 29BORDER="0" 30CELLPADDING="0" 31CELLSPACING="0" 32><TR 33><TH 34COLSPAN="3" 35ALIGN="center" 36></TH 37></TR 38><TR 39><TD 40WIDTH="10%" 41ALIGN="left" 42VALIGN="bottom" 43><A 44HREF="x19.html" 45ACCESSKEY="P" 46><<< Previous</A 47></TD 48><TD 49WIDTH="80%" 50ALIGN="center" 51VALIGN="bottom" 52></TD 53><TD 54WIDTH="10%" 55ALIGN="right" 56VALIGN="bottom" 57><A 58HREF="x103.html" 59ACCESSKEY="N" 60>Next >>></A 61></TD 62></TR 63></TABLE 64><HR 65ALIGN="LEFT" 66WIDTH="100%"></DIV 67><DIV 68CLASS="SECT1" 69><H1 70CLASS="SECT1" 71><A 72NAME="AEN31" 73>Datatypes</A 74></H1 75><P 76>Fontconfig uses abstract data types to hide internal implementation details 77for most data structures. A few structures are exposed where appropriate. 78 </P 79><DIV 80CLASS="SECT2" 81><H2 82CLASS="SECT2" 83><A 84NAME="AEN34" 85>FcChar8, FcChar16, FcChar32, FcBool</A 86></H2 87><P 88>These are primitive data types; the FcChar* types hold precisely the number 89of bits stated (if supported by the C implementation). FcBool holds 90one of two C preprocessor symbols: FcFalse or FcTrue. 91 </P 92></DIV 93><DIV 94CLASS="SECT2" 95><H2 96CLASS="SECT2" 97><A 98NAME="AEN37" 99>FcMatrix</A 100></H2 101><P 102>An FcMatrix holds an affine transformation, usually used to reshape glyphs. 103A small set of matrix operations are provided to manipulate these. 104 <TABLE 105BORDER="0" 106BGCOLOR="#E0E0E0" 107WIDTH="100%" 108><TR 109><TD 110><PRE 111CLASS="PROGRAMLISTING" 112> typedef struct _FcMatrix { 113 double xx, xy, yx, yy; 114 } FcMatrix; 115 </PRE 116></TD 117></TR 118></TABLE 119> 120 </P 121></DIV 122><DIV 123CLASS="SECT2" 124><H2 125CLASS="SECT2" 126><A 127NAME="AEN41" 128>FcCharSet</A 129></H2 130><P 131>An FcCharSet is an abstract type that holds the set of encoded Unicode chars 132in a font. Operations to build and compare these sets are provided. 133 </P 134></DIV 135><DIV 136CLASS="SECT2" 137><H2 138CLASS="SECT2" 139><A 140NAME="AEN44" 141>FcLangSet</A 142></H2 143><P 144>An FcLangSet is an abstract type that holds the set of languages supported 145by a font. Operations to build and compare these sets are provided. These 146are computed for a font based on orthographic information built into the 147fontconfig library. Fontconfig has orthographies for all of the ISO 639-1 148languages except for MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA. If 149you have orthographic information for any of these languages, please submit 150them. 151 </P 152></DIV 153><DIV 154CLASS="SECT2" 155><H2 156CLASS="SECT2" 157><A 158NAME="AEN47" 159>FcLangResult</A 160></H2 161><P 162>An FcLangResult is an enumeration used to return the results of comparing 163two language strings or FcLangSet objects. FcLangEqual means the 164objects match language and territory. FcLangDifferentTerritory means 165the objects match in language but differ in territory. 166FcLangDifferentLang means the objects differ in language. 167 </P 168></DIV 169><DIV 170CLASS="SECT2" 171><H2 172CLASS="SECT2" 173><A 174NAME="AEN50" 175>FcType</A 176></H2 177><P 178>Tags the kind of data stored in an FcValue. 179 </P 180></DIV 181><DIV 182CLASS="SECT2" 183><H2 184CLASS="SECT2" 185><A 186NAME="AEN53" 187>FcValue</A 188></H2 189><P 190>An FcValue object holds a single value with one of a number of different 191types. The 'type' tag indicates which member is valid. 192 <TABLE 193BORDER="0" 194BGCOLOR="#E0E0E0" 195WIDTH="100%" 196><TR 197><TD 198><PRE 199CLASS="PROGRAMLISTING" 200> typedef struct _FcValue { 201 FcType type; 202 union { 203 const FcChar8 *s; 204 int i; 205 FcBool b; 206 double d; 207 const FcMatrix *m; 208 const FcCharSet *c; 209 void *f; 210 const FcLangSet *l; 211 const FcRange *r; 212 } u; 213 } FcValue; 214 </PRE 215></TD 216></TR 217></TABLE 218> 219 <TABLE 220BORDER="0" 221BGCOLOR="#E0E0E0" 222WIDTH="100%" 223><TR 224><TD 225><PRE 226CLASS="PROGRAMLISTING" 227> FcValue Members 228 229 Type Union member Datatype 230 -------------------------------- 231 FcTypeVoid (none) (none) 232 FcTypeInteger i int 233 FcTypeDouble d double 234 FcTypeString s FcChar8 * 235 FcTypeBool b b 236 FcTypeMatrix m FcMatrix * 237 FcTypeCharSet c FcCharSet * 238 FcTypeFTFace f void * (FT_Face) 239 FcTypeLangSet l FcLangSet * 240 FcTypeRange r FcRange * 241 </PRE 242></TD 243></TR 244></TABLE 245> 246 </P 247></DIV 248><DIV 249CLASS="SECT2" 250><H2 251CLASS="SECT2" 252><A 253NAME="AEN58" 254>FcPattern, FcPatternIter</A 255></H2 256><P 257>An FcPattern holds a set of names with associated value lists; each name refers to a 258property of a font. FcPatterns are used as inputs to the matching code as 259well as holding information about specific fonts. Each property can hold 260one or more values; conventionally all of the same type, although the 261interface doesn't demand that. An FcPatternIter is used during iteration to 262access properties in FcPattern. 263 </P 264></DIV 265><DIV 266CLASS="SECT2" 267><H2 268CLASS="SECT2" 269><A 270NAME="AEN61" 271>FcFontSet</A 272></H2 273><P 274> <TABLE 275BORDER="0" 276BGCOLOR="#E0E0E0" 277WIDTH="100%" 278><TR 279><TD 280><PRE 281CLASS="PROGRAMLISTING" 282> typedef struct _FcFontSet { 283 int nfont; 284 int sfont; 285 FcPattern **fonts; 286 } FcFontSet; 287 </PRE 288></TD 289></TR 290></TABLE 291> 292An FcFontSet contains a list of FcPatterns. Internally fontconfig uses this 293data structure to hold sets of fonts. Externally, fontconfig returns the 294results of listing fonts in this format. 'nfont' holds the number of 295patterns in the 'fonts' array; 'sfont' is used to indicate the size of that 296array. 297 </P 298></DIV 299><DIV 300CLASS="SECT2" 301><H2 302CLASS="SECT2" 303><A 304NAME="AEN65" 305>FcStrSet, FcStrList</A 306></H2 307><P 308>FcStrSet holds a list of strings that can be appended to and enumerated. 309Its unique characteristic is that the enumeration works even while strings 310are appended during enumeration. FcStrList is used during enumeration to 311safely and correctly walk the list of strings even while that list is edited 312in the middle of enumeration. 313 </P 314></DIV 315><DIV 316CLASS="SECT2" 317><H2 318CLASS="SECT2" 319><A 320NAME="AEN68" 321>FcObjectSet</A 322></H2 323><P 324> <TABLE 325BORDER="0" 326BGCOLOR="#E0E0E0" 327WIDTH="100%" 328><TR 329><TD 330><PRE 331CLASS="PROGRAMLISTING" 332> typedef struct _FcObjectSet { 333 int nobject; 334 int sobject; 335 const char **objects; 336 } FcObjectSet; 337 </PRE 338></TD 339></TR 340></TABLE 341> 342holds a set of names and is used to specify which fields from fonts are 343placed in the the list of returned patterns when listing fonts. 344 </P 345></DIV 346><DIV 347CLASS="SECT2" 348><H2 349CLASS="SECT2" 350><A 351NAME="AEN72" 352>FcObjectType</A 353></H2 354><P 355> <TABLE 356BORDER="0" 357BGCOLOR="#E0E0E0" 358WIDTH="100%" 359><TR 360><TD 361><PRE 362CLASS="PROGRAMLISTING" 363> typedef struct _FcObjectType { 364 const char *object; 365 FcType type; 366 } FcObjectType; 367 </PRE 368></TD 369></TR 370></TABLE 371> 372marks the type of a pattern element generated when parsing font names. 373Applications can add new object types so that font names may contain the new 374elements. 375 </P 376></DIV 377><DIV 378CLASS="SECT2" 379><H2 380CLASS="SECT2" 381><A 382NAME="AEN76" 383>FcConstant</A 384></H2 385><P 386> <TABLE 387BORDER="0" 388BGCOLOR="#E0E0E0" 389WIDTH="100%" 390><TR 391><TD 392><PRE 393CLASS="PROGRAMLISTING" 394> typedef struct _FcConstant { 395 const FcChar8 *name; 396 const char *object; 397 int value; 398 } FcConstant; 399 </PRE 400></TD 401></TR 402></TABLE 403> 404Provides for symbolic constants for new pattern elements. When 'name' is 405seen in a font name, an 'object' element is created with value 'value'. 406 </P 407></DIV 408><DIV 409CLASS="SECT2" 410><H2 411CLASS="SECT2" 412><A 413NAME="AEN80" 414>FcBlanks</A 415></H2 416><P 417>holds a list of Unicode chars which are expected to be blank; unexpectedly 418blank chars are assumed to be invalid and are elided from the charset 419associated with the font. 420 </P 421><P 422> FcBlanks is deprecated and should not be used in newly written code. 423 It is still accepted by some functions for compatibility with 424 older code but will be removed in the future. 425 </P 426></DIV 427><DIV 428CLASS="SECT2" 429><H2 430CLASS="SECT2" 431><A 432NAME="AEN84" 433>FcFileCache</A 434></H2 435><P 436>holds the per-user cache information for use while loading the font 437database. This is built automatically for the current configuration when 438that is loaded. Applications must always pass '0' when one is requested. 439 </P 440></DIV 441><DIV 442CLASS="SECT2" 443><H2 444CLASS="SECT2" 445><A 446NAME="AEN87" 447>FcConfig</A 448></H2 449><P 450>holds a complete configuration of the library; there is one default 451configuration, other can be constructed from XML data structures. All 452public entry points that need global data can take an optional FcConfig* 453argument; passing 0 uses the default configuration. FcConfig objects hold two 454sets of fonts, the first contains those specified by the configuration, the 455second set holds those added by the application at run-time. Interfaces 456that need to reference a particular set use one of the FcSetName enumerated 457values. 458 </P 459></DIV 460><DIV 461CLASS="SECT2" 462><H2 463CLASS="SECT2" 464><A 465NAME="AEN90" 466>FcSetName</A 467></H2 468><P 469>Specifies one of the two sets of fonts available in a configuration; 470FcSetSystem for those fonts specified in the configuration and 471FcSetApplication which holds fonts provided by the application. 472 </P 473></DIV 474><DIV 475CLASS="SECT2" 476><H2 477CLASS="SECT2" 478><A 479NAME="AEN93" 480>FcResult</A 481></H2 482><P 483>Used as a return type for functions manipulating FcPattern objects. 484 <TABLE 485BORDER="0" 486BGCOLOR="#E0E0E0" 487WIDTH="100%" 488><TR 489><TD 490><PRE 491CLASS="PROGRAMLISTING" 492> FcResult Values 493 Result Code Meaning 494 ----------------------------------------------------------- 495 FcResultMatch Object exists with the specified ID 496 FcResultNoMatch Object doesn't exist at all 497 FcResultTypeMismatch Object exists, but the type doesn't match 498 FcResultNoId Object exists, but has fewer values 499 than specified 500 FcResultOutOfMemory malloc failed 501 </PRE 502></TD 503></TR 504></TABLE 505> 506 </P 507></DIV 508><DIV 509CLASS="SECT2" 510><H2 511CLASS="SECT2" 512><A 513NAME="AEN97" 514>FcAtomic</A 515></H2 516><P 517>Used for locking access to configuration files. Provides a safe way to update 518configuration files. 519 </P 520></DIV 521><DIV 522CLASS="SECT2" 523><H2 524CLASS="SECT2" 525><A 526NAME="AEN100" 527>FcCache</A 528></H2 529><P 530>Holds information about the fonts contained in a single directory. Normal 531applications need not worry about this as caches for font access are 532automatically managed by the library. Applications dealing with cache 533management may want to use some of these objects in their work, however the 534included 'fc-cache' program generally suffices for all of that. 535 </P 536></DIV 537></DIV 538><DIV 539CLASS="NAVFOOTER" 540><HR 541ALIGN="LEFT" 542WIDTH="100%"><TABLE 543SUMMARY="Footer navigation table" 544WIDTH="100%" 545BORDER="0" 546CELLPADDING="0" 547CELLSPACING="0" 548><TR 549><TD 550WIDTH="33%" 551ALIGN="left" 552VALIGN="top" 553><A 554HREF="x19.html" 555ACCESSKEY="P" 556><<< Previous</A 557></TD 558><TD 559WIDTH="34%" 560ALIGN="center" 561VALIGN="top" 562><A 563HREF="t1.html" 564ACCESSKEY="H" 565>Home</A 566></TD 567><TD 568WIDTH="33%" 569ALIGN="right" 570VALIGN="top" 571><A 572HREF="x103.html" 573ACCESSKEY="N" 574>Next >>></A 575></TD 576></TR 577><TR 578><TD 579WIDTH="33%" 580ALIGN="left" 581VALIGN="top" 582>FUNCTIONAL OVERVIEW</TD 583><TD 584WIDTH="34%" 585ALIGN="center" 586VALIGN="top" 587> </TD 588><TD 589WIDTH="33%" 590ALIGN="right" 591VALIGN="top" 592>FUNCTIONS</TD 593></TR 594></TABLE 595></DIV 596></BODY 597></HTML 598>