x31.html revision 2c393a42
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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="index.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>Prev</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>3. 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>3.1. 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>3.2. 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    <PRE
105CLASS="PROGRAMLISTING"
106>        typedef struct _FcMatrix {
107                double xx, xy, yx, yy;
108        } FcMatrix;
109    </PRE
110>
111    </P
112></DIV
113><DIV
114CLASS="SECT2"
115><H2
116CLASS="SECT2"
117><A
118NAME="AEN41"
119>3.3. FcCharSet</A
120></H2
121><P
122>An FcCharSet is an abstract type that holds the set of encoded unicode chars
123in a font.  Operations to build and compare these sets are provided.
124    </P
125></DIV
126><DIV
127CLASS="SECT2"
128><H2
129CLASS="SECT2"
130><A
131NAME="AEN44"
132>3.4. FcLangSet</A
133></H2
134><P
135>An FcLangSet is an abstract type that holds the set of languages supported
136by a font.  Operations to build and compare these sets are provided. These
137are computed for a font based on orthographic information built into the
138fontconfig library. Fontconfig has orthographies for all of the ISO 639-1
139languages except for MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA. If
140you have orthographic information for any of these languages, please submit
141them.
142    </P
143></DIV
144><DIV
145CLASS="SECT2"
146><H2
147CLASS="SECT2"
148><A
149NAME="AEN47"
150>3.5. FcLangResult</A
151></H2
152><P
153>An FcLangResult is an enumeration used to return the results of comparing
154two language strings or FcLangSet objects. FcLangEqual means the
155objects match language and territory. FcLangDifferentTerritory means
156the objects match in language but differ in territory.
157FcLangDifferentLang means the objects differ in language.
158    </P
159></DIV
160><DIV
161CLASS="SECT2"
162><H2
163CLASS="SECT2"
164><A
165NAME="AEN50"
166>3.6. FcType</A
167></H2
168><P
169>Tags the kind of data stored in an FcValue.
170    </P
171></DIV
172><DIV
173CLASS="SECT2"
174><H2
175CLASS="SECT2"
176><A
177NAME="AEN53"
178>3.7. FcValue</A
179></H2
180><P
181>An FcValue object holds a single value with one of a number of different
182types.  The 'type' tag indicates which member is valid.
183    <PRE
184CLASS="PROGRAMLISTING"
185>        typedef struct _FcValue {
186                FcType type;
187                union {
188                        const FcChar8 *s;
189                        int i;
190                        FcBool b;
191                        double d;
192                        const FcMatrix *m;
193                        const FcCharSet *c;
194			void *f;
195			const FcLangSet *l;
196                } u;
197        } FcValue;
198    </PRE
199>
200    <PRE
201CLASS="PROGRAMLISTING"
202>                  FcValue Members
203
204        Type            Union member    Datatype
205        --------------------------------
206        FcTypeVoid      (none)          (none)
207        FcTypeInteger   i               int
208        FcTypeDouble    d               double
209        FcTypeString    s               FcChar8 *
210        FcTypeBool      b               b
211        FcTypeMatrix    m               FcMatrix *
212        FcTypeCharSet   c               FcCharSet *
213	FcTypeFTFace	f		void * (FT_Face)
214	FcTypeLangSet	l		FcLangSet *
215    </PRE
216>
217    </P
218></DIV
219><DIV
220CLASS="SECT2"
221><H2
222CLASS="SECT2"
223><A
224NAME="AEN58"
225>3.8. FcPattern</A
226></H2
227><P
228>holds a set of names with associated value lists; each name refers to a
229property of a font.  FcPatterns are used as inputs to the matching code as
230well as holding information about specific fonts.  Each property can hold
231one or more values; conventionally all of the same type, although the
232interface doesn't demand that.
233    </P
234></DIV
235><DIV
236CLASS="SECT2"
237><H2
238CLASS="SECT2"
239><A
240NAME="AEN61"
241>3.9. FcFontSet</A
242></H2
243><P
244>    <PRE
245CLASS="PROGRAMLISTING"
246>        typedef struct _FcFontSet {
247                int nfont;
248                int sfont;
249                FcPattern **fonts;
250        } FcFontSet;
251    </PRE
252>
253An FcFontSet contains a list of FcPatterns.  Internally fontconfig uses this
254data structure to hold sets of fonts.  Externally, fontconfig returns the
255results of listing fonts in this format.  'nfont' holds the number of
256patterns in the 'fonts' array; 'sfont' is used to indicate the size of that
257array.
258    </P
259></DIV
260><DIV
261CLASS="SECT2"
262><H2
263CLASS="SECT2"
264><A
265NAME="AEN65"
266>3.10. FcStrSet, FcStrList</A
267></H2
268><P
269>FcStrSet holds a list of strings that can be appended to and enumerated.
270Its unique characteristic is that the enumeration works even while strings
271are appended during enumeration.  FcStrList is used during enumeration to
272safely and correctly walk the list of strings even while that list is edited
273in the middle of enumeration.
274    </P
275></DIV
276><DIV
277CLASS="SECT2"
278><H2
279CLASS="SECT2"
280><A
281NAME="AEN68"
282>3.11. FcObjectSet</A
283></H2
284><P
285>      <PRE
286CLASS="PROGRAMLISTING"
287>        typedef struct _FcObjectSet {
288                int nobject;
289                int sobject;
290                const char **objects;
291        } FcObjectSet;
292      </PRE
293>
294holds a set of names and is used to specify which fields from fonts are
295placed in the the list of returned patterns when listing fonts.
296    </P
297></DIV
298><DIV
299CLASS="SECT2"
300><H2
301CLASS="SECT2"
302><A
303NAME="AEN72"
304>3.12. FcObjectType</A
305></H2
306><P
307>      <PRE
308CLASS="PROGRAMLISTING"
309>        typedef struct _FcObjectType {
310                const char *object;
311                FcType type;
312        } FcObjectType;
313      </PRE
314>
315marks the type of a pattern element generated when parsing font names.
316Applications can add new object types so that font names may contain the new
317elements.
318    </P
319></DIV
320><DIV
321CLASS="SECT2"
322><H2
323CLASS="SECT2"
324><A
325NAME="AEN76"
326>3.13. FcConstant</A
327></H2
328><P
329>      <PRE
330CLASS="PROGRAMLISTING"
331>        typedef struct _FcConstant {
332            const FcChar8 *name;
333            const char *object;
334            int value;
335        } FcConstant;
336      </PRE
337>
338Provides for symbolic constants for new pattern elements.  When 'name' is
339seen in a font name, an 'object' element is created with value 'value'.
340    </P
341></DIV
342><DIV
343CLASS="SECT2"
344><H2
345CLASS="SECT2"
346><A
347NAME="AEN80"
348>3.14. FcBlanks</A
349></H2
350><P
351>holds a list of Unicode chars which are expected to be blank; unexpectedly
352blank chars are assumed to be invalid and are elided from the charset
353associated with the font.
354    </P
355></DIV
356><DIV
357CLASS="SECT2"
358><H2
359CLASS="SECT2"
360><A
361NAME="AEN83"
362>3.15. FcFileCache</A
363></H2
364><P
365>holds the per-user cache information for use while loading the font
366database. This is built automatically for the current configuration when
367that is loaded.  Applications must always pass '0' when one is requested.
368    </P
369></DIV
370><DIV
371CLASS="SECT2"
372><H2
373CLASS="SECT2"
374><A
375NAME="AEN86"
376>3.16. FcConfig</A
377></H2
378><P
379>holds a complete configuration of the library; there is one default
380configuration, other can be constructed from XML data structures.  All
381public entry points that need global data can take an optional FcConfig*
382argument; passing 0 uses the default configuration.  FcConfig objects hold two
383sets of fonts, the first contains those specified by the configuration, the
384second set holds those added by the application at run-time.  Interfaces
385that need to reference a particulat set use one of the FcSetName enumerated
386values.
387    </P
388></DIV
389><DIV
390CLASS="SECT2"
391><H2
392CLASS="SECT2"
393><A
394NAME="AEN89"
395>3.17. FcSetName</A
396></H2
397><P
398>Specifies one of the two sets of fonts available in a configuration;
399FcSetSystem for those fonts specified in the configuration and
400FcSetApplication which holds fonts provided by the application.
401    </P
402></DIV
403><DIV
404CLASS="SECT2"
405><H2
406CLASS="SECT2"
407><A
408NAME="AEN92"
409>3.18. FcResult</A
410></H2
411><P
412>Used as a return type for functions manipulating FcPattern objects.
413    <PRE
414CLASS="PROGRAMLISTING"
415>      FcResult Values
416        Result Code             Meaning
417        -----------------------------------------------------------
418        FcResultMatch           Object exists with the specified ID
419        FcResultNoMatch         Object doesn't exist at all
420        FcResultTypeMismatch    Object exists, but the type doesn't match
421        FcResultNoId            Object exists, but has fewer values
422                                than specified
423        FcResultOutOfMemory     Malloc failed
424    </PRE
425>
426    </P
427></DIV
428><DIV
429CLASS="SECT2"
430><H2
431CLASS="SECT2"
432><A
433NAME="AEN96"
434>3.19. FcAtomic</A
435></H2
436><P
437>Used for locking access to config files.  Provides a safe way to update
438configuration files.
439    </P
440></DIV
441><DIV
442CLASS="SECT2"
443><H2
444CLASS="SECT2"
445><A
446NAME="AEN99"
447>3.20. FcCache</A
448></H2
449><P
450>Holds information about the fonts contained in a single directory. Normal
451applications need not worry about this as caches for font access are
452automatically managed by the library. Applications dealing with cache
453management may want to use some of these objects in their work, however the
454included 'fc-cache' program generally suffices for all of that.
455    </P
456></DIV
457></DIV
458><DIV
459CLASS="NAVFOOTER"
460><HR
461ALIGN="LEFT"
462WIDTH="100%"><TABLE
463SUMMARY="Footer navigation table"
464WIDTH="100%"
465BORDER="0"
466CELLPADDING="0"
467CELLSPACING="0"
468><TR
469><TD
470WIDTH="33%"
471ALIGN="left"
472VALIGN="top"
473><A
474HREF="x19.html"
475ACCESSKEY="P"
476>Prev</A
477></TD
478><TD
479WIDTH="34%"
480ALIGN="center"
481VALIGN="top"
482><A
483HREF="index.html"
484ACCESSKEY="H"
485>Home</A
486></TD
487><TD
488WIDTH="33%"
489ALIGN="right"
490VALIGN="top"
491><A
492HREF="x102.html"
493ACCESSKEY="N"
494>Next</A
495></TD
496></TR
497><TR
498><TD
499WIDTH="33%"
500ALIGN="left"
501VALIGN="top"
502>FUNCTIONAL OVERVIEW</TD
503><TD
504WIDTH="34%"
505ALIGN="center"
506VALIGN="top"
507>&nbsp;</TD
508><TD
509WIDTH="33%"
510ALIGN="right"
511VALIGN="top"
512>FUNCTIONS</TD
513></TR
514></TABLE
515></DIV
516></BODY
517></HTML
518>