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