x31.html revision a6844aab
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="x102.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="x102.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 datatypes 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 datatypes; the FcChar* types hold precisely the number 89of bits stated (if supported by the C implementation). FcBool holds 90one of two CPP 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 } u; 212 } FcValue; 213 </PRE 214></TD 215></TR 216></TABLE 217> 218 <TABLE 219BORDER="0" 220BGCOLOR="#E0E0E0" 221WIDTH="100%" 222><TR 223><TD 224><PRE 225CLASS="PROGRAMLISTING" 226> FcValue Members 227 228 Type Union member Datatype 229 -------------------------------- 230 FcTypeVoid (none) (none) 231 FcTypeInteger i int 232 FcTypeDouble d double 233 FcTypeString s FcChar8 * 234 FcTypeBool b b 235 FcTypeMatrix m FcMatrix * 236 FcTypeCharSet c FcCharSet * 237 FcTypeFTFace f void * (FT_Face) 238 FcTypeLangSet l FcLangSet * 239 </PRE 240></TD 241></TR 242></TABLE 243> 244 </P 245></DIV 246><DIV 247CLASS="SECT2" 248><H2 249CLASS="SECT2" 250><A 251NAME="AEN58" 252>FcPattern</A 253></H2 254><P 255>holds a set of names with associated value lists; each name refers to a 256property of a font. FcPatterns are used as inputs to the matching code as 257well as holding information about specific fonts. Each property can hold 258one or more values; conventionally all of the same type, although the 259interface doesn't demand that. 260 </P 261></DIV 262><DIV 263CLASS="SECT2" 264><H2 265CLASS="SECT2" 266><A 267NAME="AEN61" 268>FcFontSet</A 269></H2 270><P 271> <TABLE 272BORDER="0" 273BGCOLOR="#E0E0E0" 274WIDTH="100%" 275><TR 276><TD 277><PRE 278CLASS="PROGRAMLISTING" 279> typedef struct _FcFontSet { 280 int nfont; 281 int sfont; 282 FcPattern **fonts; 283 } FcFontSet; 284 </PRE 285></TD 286></TR 287></TABLE 288> 289An FcFontSet contains a list of FcPatterns. Internally fontconfig uses this 290data structure to hold sets of fonts. Externally, fontconfig returns the 291results of listing fonts in this format. 'nfont' holds the number of 292patterns in the 'fonts' array; 'sfont' is used to indicate the size of that 293array. 294 </P 295></DIV 296><DIV 297CLASS="SECT2" 298><H2 299CLASS="SECT2" 300><A 301NAME="AEN65" 302>FcStrSet, FcStrList</A 303></H2 304><P 305>FcStrSet holds a list of strings that can be appended to and enumerated. 306Its unique characteristic is that the enumeration works even while strings 307are appended during enumeration. FcStrList is used during enumeration to 308safely and correctly walk the list of strings even while that list is edited 309in the middle of enumeration. 310 </P 311></DIV 312><DIV 313CLASS="SECT2" 314><H2 315CLASS="SECT2" 316><A 317NAME="AEN68" 318>FcObjectSet</A 319></H2 320><P 321> <TABLE 322BORDER="0" 323BGCOLOR="#E0E0E0" 324WIDTH="100%" 325><TR 326><TD 327><PRE 328CLASS="PROGRAMLISTING" 329> typedef struct _FcObjectSet { 330 int nobject; 331 int sobject; 332 const char **objects; 333 } FcObjectSet; 334 </PRE 335></TD 336></TR 337></TABLE 338> 339holds a set of names and is used to specify which fields from fonts are 340placed in the the list of returned patterns when listing fonts. 341 </P 342></DIV 343><DIV 344CLASS="SECT2" 345><H2 346CLASS="SECT2" 347><A 348NAME="AEN72" 349>FcObjectType</A 350></H2 351><P 352> <TABLE 353BORDER="0" 354BGCOLOR="#E0E0E0" 355WIDTH="100%" 356><TR 357><TD 358><PRE 359CLASS="PROGRAMLISTING" 360> typedef struct _FcObjectType { 361 const char *object; 362 FcType type; 363 } FcObjectType; 364 </PRE 365></TD 366></TR 367></TABLE 368> 369marks the type of a pattern element generated when parsing font names. 370Applications can add new object types so that font names may contain the new 371elements. 372 </P 373></DIV 374><DIV 375CLASS="SECT2" 376><H2 377CLASS="SECT2" 378><A 379NAME="AEN76" 380>FcConstant</A 381></H2 382><P 383> <TABLE 384BORDER="0" 385BGCOLOR="#E0E0E0" 386WIDTH="100%" 387><TR 388><TD 389><PRE 390CLASS="PROGRAMLISTING" 391> typedef struct _FcConstant { 392 const FcChar8 *name; 393 const char *object; 394 int value; 395 } FcConstant; 396 </PRE 397></TD 398></TR 399></TABLE 400> 401Provides for symbolic constants for new pattern elements. When 'name' is 402seen in a font name, an 'object' element is created with value 'value'. 403 </P 404></DIV 405><DIV 406CLASS="SECT2" 407><H2 408CLASS="SECT2" 409><A 410NAME="AEN80" 411>FcBlanks</A 412></H2 413><P 414>holds a list of Unicode chars which are expected to be blank; unexpectedly 415blank chars are assumed to be invalid and are elided from the charset 416associated with the font. 417 </P 418></DIV 419><DIV 420CLASS="SECT2" 421><H2 422CLASS="SECT2" 423><A 424NAME="AEN83" 425>FcFileCache</A 426></H2 427><P 428>holds the per-user cache information for use while loading the font 429database. This is built automatically for the current configuration when 430that is loaded. Applications must always pass '0' when one is requested. 431 </P 432></DIV 433><DIV 434CLASS="SECT2" 435><H2 436CLASS="SECT2" 437><A 438NAME="AEN86" 439>FcConfig</A 440></H2 441><P 442>holds a complete configuration of the library; there is one default 443configuration, other can be constructed from XML data structures. All 444public entry points that need global data can take an optional FcConfig* 445argument; passing 0 uses the default configuration. FcConfig objects hold two 446sets of fonts, the first contains those specified by the configuration, the 447second set holds those added by the application at run-time. Interfaces 448that need to reference a particulat set use one of the FcSetName enumerated 449values. 450 </P 451></DIV 452><DIV 453CLASS="SECT2" 454><H2 455CLASS="SECT2" 456><A 457NAME="AEN89" 458>FcSetName</A 459></H2 460><P 461>Specifies one of the two sets of fonts available in a configuration; 462FcSetSystem for those fonts specified in the configuration and 463FcSetApplication which holds fonts provided by the application. 464 </P 465></DIV 466><DIV 467CLASS="SECT2" 468><H2 469CLASS="SECT2" 470><A 471NAME="AEN92" 472>FcResult</A 473></H2 474><P 475>Used as a return type for functions manipulating FcPattern objects. 476 <TABLE 477BORDER="0" 478BGCOLOR="#E0E0E0" 479WIDTH="100%" 480><TR 481><TD 482><PRE 483CLASS="PROGRAMLISTING" 484> FcResult Values 485 Result Code Meaning 486 ----------------------------------------------------------- 487 FcResultMatch Object exists with the specified ID 488 FcResultNoMatch Object doesn't exist at all 489 FcResultTypeMismatch Object exists, but the type doesn't match 490 FcResultNoId Object exists, but has fewer values 491 than specified 492 FcResultOutOfMemory Malloc failed 493 </PRE 494></TD 495></TR 496></TABLE 497> 498 </P 499></DIV 500><DIV 501CLASS="SECT2" 502><H2 503CLASS="SECT2" 504><A 505NAME="AEN96" 506>FcAtomic</A 507></H2 508><P 509>Used for locking access to config files. Provides a safe way to update 510configuration files. 511 </P 512></DIV 513><DIV 514CLASS="SECT2" 515><H2 516CLASS="SECT2" 517><A 518NAME="AEN99" 519>FcCache</A 520></H2 521><P 522>Holds information about the fonts contained in a single directory. Normal 523applications need not worry about this as caches for font access are 524automatically managed by the library. Applications dealing with cache 525management may want to use some of these objects in their work, however the 526included 'fc-cache' program generally suffices for all of that. 527 </P 528></DIV 529></DIV 530><DIV 531CLASS="NAVFOOTER" 532><HR 533ALIGN="LEFT" 534WIDTH="100%"><TABLE 535SUMMARY="Footer navigation table" 536WIDTH="100%" 537BORDER="0" 538CELLPADDING="0" 539CELLSPACING="0" 540><TR 541><TD 542WIDTH="33%" 543ALIGN="left" 544VALIGN="top" 545><A 546HREF="x19.html" 547ACCESSKEY="P" 548><<< Previous</A 549></TD 550><TD 551WIDTH="34%" 552ALIGN="center" 553VALIGN="top" 554><A 555HREF="t1.html" 556ACCESSKEY="H" 557>Home</A 558></TD 559><TD 560WIDTH="33%" 561ALIGN="right" 562VALIGN="top" 563><A 564HREF="x102.html" 565ACCESSKEY="N" 566>Next >>></A 567></TD 568></TR 569><TR 570><TD 571WIDTH="33%" 572ALIGN="left" 573VALIGN="top" 574>FUNCTIONAL OVERVIEW</TD 575><TD 576WIDTH="34%" 577ALIGN="center" 578VALIGN="top" 579> </TD 580><TD 581WIDTH="33%" 582ALIGN="right" 583VALIGN="top" 584>FUNCTIONS</TD 585></TR 586></TABLE 587></DIV 588></BODY 589></HTML 590>