x31.html revision 2c393a42
12c393a42Smrg<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> 22c393a42Smrg<HTML 32c393a42Smrg><HEAD 42c393a42Smrg><TITLE 52c393a42Smrg>Datatypes</TITLE 62c393a42Smrg><META 72c393a42SmrgNAME="GENERATOR" 82c393a42SmrgCONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK 92c393a42SmrgREL="HOME" 102c393a42SmrgHREF="index.html"><LINK 112c393a42SmrgREL="PREVIOUS" 122c393a42SmrgTITLE="FUNCTIONAL OVERVIEW" 132c393a42SmrgHREF="x19.html"><LINK 142c393a42SmrgREL="NEXT" 152c393a42SmrgTITLE="FUNCTIONS" 162c393a42SmrgHREF="x102.html"></HEAD 172c393a42Smrg><BODY 182c393a42SmrgCLASS="SECT1" 192c393a42SmrgBGCOLOR="#FFFFFF" 202c393a42SmrgTEXT="#000000" 212c393a42SmrgLINK="#0000FF" 222c393a42SmrgVLINK="#840084" 232c393a42SmrgALINK="#0000FF" 242c393a42Smrg><DIV 252c393a42SmrgCLASS="NAVHEADER" 262c393a42Smrg><TABLE 272c393a42SmrgSUMMARY="Header navigation table" 282c393a42SmrgWIDTH="100%" 292c393a42SmrgBORDER="0" 302c393a42SmrgCELLPADDING="0" 312c393a42SmrgCELLSPACING="0" 322c393a42Smrg><TR 332c393a42Smrg><TH 342c393a42SmrgCOLSPAN="3" 352c393a42SmrgALIGN="center" 362c393a42Smrg></TH 372c393a42Smrg></TR 382c393a42Smrg><TR 392c393a42Smrg><TD 402c393a42SmrgWIDTH="10%" 412c393a42SmrgALIGN="left" 422c393a42SmrgVALIGN="bottom" 432c393a42Smrg><A 442c393a42SmrgHREF="x19.html" 452c393a42SmrgACCESSKEY="P" 462c393a42Smrg>Prev</A 472c393a42Smrg></TD 482c393a42Smrg><TD 492c393a42SmrgWIDTH="80%" 502c393a42SmrgALIGN="center" 512c393a42SmrgVALIGN="bottom" 522c393a42Smrg></TD 532c393a42Smrg><TD 542c393a42SmrgWIDTH="10%" 552c393a42SmrgALIGN="right" 562c393a42SmrgVALIGN="bottom" 572c393a42Smrg><A 582c393a42SmrgHREF="x102.html" 592c393a42SmrgACCESSKEY="N" 602c393a42Smrg>Next</A 612c393a42Smrg></TD 622c393a42Smrg></TR 632c393a42Smrg></TABLE 642c393a42Smrg><HR 652c393a42SmrgALIGN="LEFT" 662c393a42SmrgWIDTH="100%"></DIV 672c393a42Smrg><DIV 682c393a42SmrgCLASS="SECT1" 692c393a42Smrg><H1 702c393a42SmrgCLASS="SECT1" 712c393a42Smrg><A 722c393a42SmrgNAME="AEN31" 732c393a42Smrg>3. Datatypes</A 742c393a42Smrg></H1 752c393a42Smrg><P 762c393a42Smrg>Fontconfig uses abstract datatypes to hide internal implementation details 772c393a42Smrgfor most data structures. A few structures are exposed where appropriate. 782c393a42Smrg </P 792c393a42Smrg><DIV 802c393a42SmrgCLASS="SECT2" 812c393a42Smrg><H2 822c393a42SmrgCLASS="SECT2" 832c393a42Smrg><A 842c393a42SmrgNAME="AEN34" 852c393a42Smrg>3.1. FcChar8, FcChar16, FcChar32, FcBool</A 862c393a42Smrg></H2 872c393a42Smrg><P 882c393a42Smrg>These are primitive datatypes; the FcChar* types hold precisely the number 892c393a42Smrgof bits stated (if supported by the C implementation). FcBool holds 902c393a42Smrgone of two CPP symbols: FcFalse or FcTrue. 912c393a42Smrg </P 922c393a42Smrg></DIV 932c393a42Smrg><DIV 942c393a42SmrgCLASS="SECT2" 952c393a42Smrg><H2 962c393a42SmrgCLASS="SECT2" 972c393a42Smrg><A 982c393a42SmrgNAME="AEN37" 992c393a42Smrg>3.2. FcMatrix</A 1002c393a42Smrg></H2 1012c393a42Smrg><P 1022c393a42Smrg>An FcMatrix holds an affine transformation, usually used to reshape glyphs. 1032c393a42SmrgA small set of matrix operations are provided to manipulate these. 1042c393a42Smrg <PRE 1052c393a42SmrgCLASS="PROGRAMLISTING" 1062c393a42Smrg> typedef struct _FcMatrix { 1072c393a42Smrg double xx, xy, yx, yy; 1082c393a42Smrg } FcMatrix; 1092c393a42Smrg </PRE 1102c393a42Smrg> 1112c393a42Smrg </P 1122c393a42Smrg></DIV 1132c393a42Smrg><DIV 1142c393a42SmrgCLASS="SECT2" 1152c393a42Smrg><H2 1162c393a42SmrgCLASS="SECT2" 1172c393a42Smrg><A 1182c393a42SmrgNAME="AEN41" 1192c393a42Smrg>3.3. FcCharSet</A 1202c393a42Smrg></H2 1212c393a42Smrg><P 1222c393a42Smrg>An FcCharSet is an abstract type that holds the set of encoded unicode chars 1232c393a42Smrgin a font. Operations to build and compare these sets are provided. 1242c393a42Smrg </P 1252c393a42Smrg></DIV 1262c393a42Smrg><DIV 1272c393a42SmrgCLASS="SECT2" 1282c393a42Smrg><H2 1292c393a42SmrgCLASS="SECT2" 1302c393a42Smrg><A 1312c393a42SmrgNAME="AEN44" 1322c393a42Smrg>3.4. FcLangSet</A 1332c393a42Smrg></H2 1342c393a42Smrg><P 1352c393a42Smrg>An FcLangSet is an abstract type that holds the set of languages supported 1362c393a42Smrgby a font. Operations to build and compare these sets are provided. These 1372c393a42Smrgare computed for a font based on orthographic information built into the 1382c393a42Smrgfontconfig library. Fontconfig has orthographies for all of the ISO 639-1 1392c393a42Smrglanguages except for MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA. If 1402c393a42Smrgyou have orthographic information for any of these languages, please submit 1412c393a42Smrgthem. 1422c393a42Smrg </P 1432c393a42Smrg></DIV 1442c393a42Smrg><DIV 1452c393a42SmrgCLASS="SECT2" 1462c393a42Smrg><H2 1472c393a42SmrgCLASS="SECT2" 1482c393a42Smrg><A 1492c393a42SmrgNAME="AEN47" 1502c393a42Smrg>3.5. FcLangResult</A 1512c393a42Smrg></H2 1522c393a42Smrg><P 1532c393a42Smrg>An FcLangResult is an enumeration used to return the results of comparing 1542c393a42Smrgtwo language strings or FcLangSet objects. FcLangEqual means the 1552c393a42Smrgobjects match language and territory. FcLangDifferentTerritory means 1562c393a42Smrgthe objects match in language but differ in territory. 1572c393a42SmrgFcLangDifferentLang means the objects differ in language. 1582c393a42Smrg </P 1592c393a42Smrg></DIV 1602c393a42Smrg><DIV 1612c393a42SmrgCLASS="SECT2" 1622c393a42Smrg><H2 1632c393a42SmrgCLASS="SECT2" 1642c393a42Smrg><A 1652c393a42SmrgNAME="AEN50" 1662c393a42Smrg>3.6. FcType</A 1672c393a42Smrg></H2 1682c393a42Smrg><P 1692c393a42Smrg>Tags the kind of data stored in an FcValue. 1702c393a42Smrg </P 1712c393a42Smrg></DIV 1722c393a42Smrg><DIV 1732c393a42SmrgCLASS="SECT2" 1742c393a42Smrg><H2 1752c393a42SmrgCLASS="SECT2" 1762c393a42Smrg><A 1772c393a42SmrgNAME="AEN53" 1782c393a42Smrg>3.7. FcValue</A 1792c393a42Smrg></H2 1802c393a42Smrg><P 1812c393a42Smrg>An FcValue object holds a single value with one of a number of different 1822c393a42Smrgtypes. The 'type' tag indicates which member is valid. 1832c393a42Smrg <PRE 1842c393a42SmrgCLASS="PROGRAMLISTING" 1852c393a42Smrg> typedef struct _FcValue { 1862c393a42Smrg FcType type; 1872c393a42Smrg union { 1882c393a42Smrg const FcChar8 *s; 1892c393a42Smrg int i; 1902c393a42Smrg FcBool b; 1912c393a42Smrg double d; 1922c393a42Smrg const FcMatrix *m; 1932c393a42Smrg const FcCharSet *c; 1942c393a42Smrg void *f; 1952c393a42Smrg const FcLangSet *l; 1962c393a42Smrg } u; 1972c393a42Smrg } FcValue; 1982c393a42Smrg </PRE 1992c393a42Smrg> 2002c393a42Smrg <PRE 2012c393a42SmrgCLASS="PROGRAMLISTING" 2022c393a42Smrg> FcValue Members 2032c393a42Smrg 2042c393a42Smrg Type Union member Datatype 2052c393a42Smrg -------------------------------- 2062c393a42Smrg FcTypeVoid (none) (none) 2072c393a42Smrg FcTypeInteger i int 2082c393a42Smrg FcTypeDouble d double 2092c393a42Smrg FcTypeString s FcChar8 * 2102c393a42Smrg FcTypeBool b b 2112c393a42Smrg FcTypeMatrix m FcMatrix * 2122c393a42Smrg FcTypeCharSet c FcCharSet * 2132c393a42Smrg FcTypeFTFace f void * (FT_Face) 2142c393a42Smrg FcTypeLangSet l FcLangSet * 2152c393a42Smrg </PRE 2162c393a42Smrg> 2172c393a42Smrg </P 2182c393a42Smrg></DIV 2192c393a42Smrg><DIV 2202c393a42SmrgCLASS="SECT2" 2212c393a42Smrg><H2 2222c393a42SmrgCLASS="SECT2" 2232c393a42Smrg><A 2242c393a42SmrgNAME="AEN58" 2252c393a42Smrg>3.8. FcPattern</A 2262c393a42Smrg></H2 2272c393a42Smrg><P 2282c393a42Smrg>holds a set of names with associated value lists; each name refers to a 2292c393a42Smrgproperty of a font. FcPatterns are used as inputs to the matching code as 2302c393a42Smrgwell as holding information about specific fonts. Each property can hold 2312c393a42Smrgone or more values; conventionally all of the same type, although the 2322c393a42Smrginterface doesn't demand that. 2332c393a42Smrg </P 2342c393a42Smrg></DIV 2352c393a42Smrg><DIV 2362c393a42SmrgCLASS="SECT2" 2372c393a42Smrg><H2 2382c393a42SmrgCLASS="SECT2" 2392c393a42Smrg><A 2402c393a42SmrgNAME="AEN61" 2412c393a42Smrg>3.9. FcFontSet</A 2422c393a42Smrg></H2 2432c393a42Smrg><P 2442c393a42Smrg> <PRE 2452c393a42SmrgCLASS="PROGRAMLISTING" 2462c393a42Smrg> typedef struct _FcFontSet { 2472c393a42Smrg int nfont; 2482c393a42Smrg int sfont; 2492c393a42Smrg FcPattern **fonts; 2502c393a42Smrg } FcFontSet; 2512c393a42Smrg </PRE 2522c393a42Smrg> 2532c393a42SmrgAn FcFontSet contains a list of FcPatterns. Internally fontconfig uses this 2542c393a42Smrgdata structure to hold sets of fonts. Externally, fontconfig returns the 2552c393a42Smrgresults of listing fonts in this format. 'nfont' holds the number of 2562c393a42Smrgpatterns in the 'fonts' array; 'sfont' is used to indicate the size of that 2572c393a42Smrgarray. 2582c393a42Smrg </P 2592c393a42Smrg></DIV 2602c393a42Smrg><DIV 2612c393a42SmrgCLASS="SECT2" 2622c393a42Smrg><H2 2632c393a42SmrgCLASS="SECT2" 2642c393a42Smrg><A 2652c393a42SmrgNAME="AEN65" 2662c393a42Smrg>3.10. FcStrSet, FcStrList</A 2672c393a42Smrg></H2 2682c393a42Smrg><P 2692c393a42Smrg>FcStrSet holds a list of strings that can be appended to and enumerated. 2702c393a42SmrgIts unique characteristic is that the enumeration works even while strings 2712c393a42Smrgare appended during enumeration. FcStrList is used during enumeration to 2722c393a42Smrgsafely and correctly walk the list of strings even while that list is edited 2732c393a42Smrgin the middle of enumeration. 2742c393a42Smrg </P 2752c393a42Smrg></DIV 2762c393a42Smrg><DIV 2772c393a42SmrgCLASS="SECT2" 2782c393a42Smrg><H2 2792c393a42SmrgCLASS="SECT2" 2802c393a42Smrg><A 2812c393a42SmrgNAME="AEN68" 2822c393a42Smrg>3.11. FcObjectSet</A 2832c393a42Smrg></H2 2842c393a42Smrg><P 2852c393a42Smrg> <PRE 2862c393a42SmrgCLASS="PROGRAMLISTING" 2872c393a42Smrg> typedef struct _FcObjectSet { 2882c393a42Smrg int nobject; 2892c393a42Smrg int sobject; 2902c393a42Smrg const char **objects; 2912c393a42Smrg } FcObjectSet; 2922c393a42Smrg </PRE 2932c393a42Smrg> 2942c393a42Smrgholds a set of names and is used to specify which fields from fonts are 2952c393a42Smrgplaced in the the list of returned patterns when listing fonts. 2962c393a42Smrg </P 2972c393a42Smrg></DIV 2982c393a42Smrg><DIV 2992c393a42SmrgCLASS="SECT2" 3002c393a42Smrg><H2 3012c393a42SmrgCLASS="SECT2" 3022c393a42Smrg><A 3032c393a42SmrgNAME="AEN72" 3042c393a42Smrg>3.12. FcObjectType</A 3052c393a42Smrg></H2 3062c393a42Smrg><P 3072c393a42Smrg> <PRE 3082c393a42SmrgCLASS="PROGRAMLISTING" 3092c393a42Smrg> typedef struct _FcObjectType { 3102c393a42Smrg const char *object; 3112c393a42Smrg FcType type; 3122c393a42Smrg } FcObjectType; 3132c393a42Smrg </PRE 3142c393a42Smrg> 3152c393a42Smrgmarks the type of a pattern element generated when parsing font names. 3162c393a42SmrgApplications can add new object types so that font names may contain the new 3172c393a42Smrgelements. 3182c393a42Smrg </P 3192c393a42Smrg></DIV 3202c393a42Smrg><DIV 3212c393a42SmrgCLASS="SECT2" 3222c393a42Smrg><H2 3232c393a42SmrgCLASS="SECT2" 3242c393a42Smrg><A 3252c393a42SmrgNAME="AEN76" 3262c393a42Smrg>3.13. FcConstant</A 3272c393a42Smrg></H2 3282c393a42Smrg><P 3292c393a42Smrg> <PRE 3302c393a42SmrgCLASS="PROGRAMLISTING" 3312c393a42Smrg> typedef struct _FcConstant { 3322c393a42Smrg const FcChar8 *name; 3332c393a42Smrg const char *object; 3342c393a42Smrg int value; 3352c393a42Smrg } FcConstant; 3362c393a42Smrg </PRE 3372c393a42Smrg> 3382c393a42SmrgProvides for symbolic constants for new pattern elements. When 'name' is 3392c393a42Smrgseen in a font name, an 'object' element is created with value 'value'. 3402c393a42Smrg </P 3412c393a42Smrg></DIV 3422c393a42Smrg><DIV 3432c393a42SmrgCLASS="SECT2" 3442c393a42Smrg><H2 3452c393a42SmrgCLASS="SECT2" 3462c393a42Smrg><A 3472c393a42SmrgNAME="AEN80" 3482c393a42Smrg>3.14. FcBlanks</A 3492c393a42Smrg></H2 3502c393a42Smrg><P 3512c393a42Smrg>holds a list of Unicode chars which are expected to be blank; unexpectedly 3522c393a42Smrgblank chars are assumed to be invalid and are elided from the charset 3532c393a42Smrgassociated with the font. 3542c393a42Smrg </P 3552c393a42Smrg></DIV 3562c393a42Smrg><DIV 3572c393a42SmrgCLASS="SECT2" 3582c393a42Smrg><H2 3592c393a42SmrgCLASS="SECT2" 3602c393a42Smrg><A 3612c393a42SmrgNAME="AEN83" 3622c393a42Smrg>3.15. FcFileCache</A 3632c393a42Smrg></H2 3642c393a42Smrg><P 3652c393a42Smrg>holds the per-user cache information for use while loading the font 3662c393a42Smrgdatabase. This is built automatically for the current configuration when 3672c393a42Smrgthat is loaded. Applications must always pass '0' when one is requested. 3682c393a42Smrg </P 3692c393a42Smrg></DIV 3702c393a42Smrg><DIV 3712c393a42SmrgCLASS="SECT2" 3722c393a42Smrg><H2 3732c393a42SmrgCLASS="SECT2" 3742c393a42Smrg><A 3752c393a42SmrgNAME="AEN86" 3762c393a42Smrg>3.16. FcConfig</A 3772c393a42Smrg></H2 3782c393a42Smrg><P 3792c393a42Smrg>holds a complete configuration of the library; there is one default 3802c393a42Smrgconfiguration, other can be constructed from XML data structures. All 3812c393a42Smrgpublic entry points that need global data can take an optional FcConfig* 3822c393a42Smrgargument; passing 0 uses the default configuration. FcConfig objects hold two 3832c393a42Smrgsets of fonts, the first contains those specified by the configuration, the 3842c393a42Smrgsecond set holds those added by the application at run-time. Interfaces 3852c393a42Smrgthat need to reference a particulat set use one of the FcSetName enumerated 3862c393a42Smrgvalues. 3872c393a42Smrg </P 3882c393a42Smrg></DIV 3892c393a42Smrg><DIV 3902c393a42SmrgCLASS="SECT2" 3912c393a42Smrg><H2 3922c393a42SmrgCLASS="SECT2" 3932c393a42Smrg><A 3942c393a42SmrgNAME="AEN89" 3952c393a42Smrg>3.17. FcSetName</A 3962c393a42Smrg></H2 3972c393a42Smrg><P 3982c393a42Smrg>Specifies one of the two sets of fonts available in a configuration; 3992c393a42SmrgFcSetSystem for those fonts specified in the configuration and 4002c393a42SmrgFcSetApplication which holds fonts provided by the application. 4012c393a42Smrg </P 4022c393a42Smrg></DIV 4032c393a42Smrg><DIV 4042c393a42SmrgCLASS="SECT2" 4052c393a42Smrg><H2 4062c393a42SmrgCLASS="SECT2" 4072c393a42Smrg><A 4082c393a42SmrgNAME="AEN92" 4092c393a42Smrg>3.18. FcResult</A 4102c393a42Smrg></H2 4112c393a42Smrg><P 4122c393a42Smrg>Used as a return type for functions manipulating FcPattern objects. 4132c393a42Smrg <PRE 4142c393a42SmrgCLASS="PROGRAMLISTING" 4152c393a42Smrg> FcResult Values 4162c393a42Smrg Result Code Meaning 4172c393a42Smrg ----------------------------------------------------------- 4182c393a42Smrg FcResultMatch Object exists with the specified ID 4192c393a42Smrg FcResultNoMatch Object doesn't exist at all 4202c393a42Smrg FcResultTypeMismatch Object exists, but the type doesn't match 4212c393a42Smrg FcResultNoId Object exists, but has fewer values 4222c393a42Smrg than specified 4232c393a42Smrg FcResultOutOfMemory Malloc failed 4242c393a42Smrg </PRE 4252c393a42Smrg> 4262c393a42Smrg </P 4272c393a42Smrg></DIV 4282c393a42Smrg><DIV 4292c393a42SmrgCLASS="SECT2" 4302c393a42Smrg><H2 4312c393a42SmrgCLASS="SECT2" 4322c393a42Smrg><A 4332c393a42SmrgNAME="AEN96" 4342c393a42Smrg>3.19. FcAtomic</A 4352c393a42Smrg></H2 4362c393a42Smrg><P 4372c393a42Smrg>Used for locking access to config files. Provides a safe way to update 4382c393a42Smrgconfiguration files. 4392c393a42Smrg </P 4402c393a42Smrg></DIV 4412c393a42Smrg><DIV 4422c393a42SmrgCLASS="SECT2" 4432c393a42Smrg><H2 4442c393a42SmrgCLASS="SECT2" 4452c393a42Smrg><A 4462c393a42SmrgNAME="AEN99" 4472c393a42Smrg>3.20. FcCache</A 4482c393a42Smrg></H2 4492c393a42Smrg><P 4502c393a42Smrg>Holds information about the fonts contained in a single directory. Normal 4512c393a42Smrgapplications need not worry about this as caches for font access are 4522c393a42Smrgautomatically managed by the library. Applications dealing with cache 4532c393a42Smrgmanagement may want to use some of these objects in their work, however the 4542c393a42Smrgincluded 'fc-cache' program generally suffices for all of that. 4552c393a42Smrg </P 4562c393a42Smrg></DIV 4572c393a42Smrg></DIV 4582c393a42Smrg><DIV 4592c393a42SmrgCLASS="NAVFOOTER" 4602c393a42Smrg><HR 4612c393a42SmrgALIGN="LEFT" 4622c393a42SmrgWIDTH="100%"><TABLE 4632c393a42SmrgSUMMARY="Footer navigation table" 4642c393a42SmrgWIDTH="100%" 4652c393a42SmrgBORDER="0" 4662c393a42SmrgCELLPADDING="0" 4672c393a42SmrgCELLSPACING="0" 4682c393a42Smrg><TR 4692c393a42Smrg><TD 4702c393a42SmrgWIDTH="33%" 4712c393a42SmrgALIGN="left" 4722c393a42SmrgVALIGN="top" 4732c393a42Smrg><A 4742c393a42SmrgHREF="x19.html" 4752c393a42SmrgACCESSKEY="P" 4762c393a42Smrg>Prev</A 4772c393a42Smrg></TD 4782c393a42Smrg><TD 4792c393a42SmrgWIDTH="34%" 4802c393a42SmrgALIGN="center" 4812c393a42SmrgVALIGN="top" 4822c393a42Smrg><A 4832c393a42SmrgHREF="index.html" 4842c393a42SmrgACCESSKEY="H" 4852c393a42Smrg>Home</A 4862c393a42Smrg></TD 4872c393a42Smrg><TD 4882c393a42SmrgWIDTH="33%" 4892c393a42SmrgALIGN="right" 4902c393a42SmrgVALIGN="top" 4912c393a42Smrg><A 4922c393a42SmrgHREF="x102.html" 4932c393a42SmrgACCESSKEY="N" 4942c393a42Smrg>Next</A 4952c393a42Smrg></TD 4962c393a42Smrg></TR 4972c393a42Smrg><TR 4982c393a42Smrg><TD 4992c393a42SmrgWIDTH="33%" 5002c393a42SmrgALIGN="left" 5012c393a42SmrgVALIGN="top" 5022c393a42Smrg>FUNCTIONAL OVERVIEW</TD 5032c393a42Smrg><TD 5042c393a42SmrgWIDTH="34%" 5052c393a42SmrgALIGN="center" 5062c393a42SmrgVALIGN="top" 5072c393a42Smrg> </TD 5082c393a42Smrg><TD 5092c393a42SmrgWIDTH="33%" 5102c393a42SmrgALIGN="right" 5112c393a42SmrgVALIGN="top" 5122c393a42Smrg>FUNCTIONS</TD 5132c393a42Smrg></TR 5142c393a42Smrg></TABLE 5152c393a42Smrg></DIV 5162c393a42Smrg></BODY 5172c393a42Smrg></HTML 5182c393a42Smrg>