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