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