1 | /***************************************************************************/ |
---|
2 | /* */ |
---|
3 | /* freetype.h */ |
---|
4 | /* */ |
---|
5 | /* FreeType high-level API and common types (specification only). */ |
---|
6 | /* */ |
---|
7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ |
---|
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
---|
9 | /* */ |
---|
10 | /* This file is part of the FreeType project, and may only be used, */ |
---|
11 | /* modified, and distributed under the terms of the FreeType project */ |
---|
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
---|
13 | /* this file you indicate that you have read the license and */ |
---|
14 | /* understand and accept it fully. */ |
---|
15 | /* */ |
---|
16 | /***************************************************************************/ |
---|
17 | |
---|
18 | |
---|
19 | #ifndef FT_FREETYPE_H |
---|
20 | #error "`ft2build.h' hasn't been included yet!" |
---|
21 | #error "Please always use macros to include FreeType header files." |
---|
22 | #error "Example:" |
---|
23 | #error " #include <ft2build.h>" |
---|
24 | #error " #include FT_FREETYPE_H" |
---|
25 | #endif |
---|
26 | |
---|
27 | |
---|
28 | /*************************************************************************/ |
---|
29 | /* */ |
---|
30 | /* The `raster' component duplicates some of the declarations in */ |
---|
31 | /* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */ |
---|
32 | /* */ |
---|
33 | /*************************************************************************/ |
---|
34 | |
---|
35 | |
---|
36 | #ifndef __FREETYPE_H__ |
---|
37 | #define __FREETYPE_H__ |
---|
38 | |
---|
39 | |
---|
40 | #include <ft2build.h> |
---|
41 | #include FT_CONFIG_CONFIG_H |
---|
42 | #include FT_ERRORS_H |
---|
43 | #include FT_TYPES_H |
---|
44 | |
---|
45 | |
---|
46 | FT_BEGIN_HEADER |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | /*************************************************************************/ |
---|
51 | /* */ |
---|
52 | /* <Section> */ |
---|
53 | /* user_allocation */ |
---|
54 | /* */ |
---|
55 | /* <Title> */ |
---|
56 | /* User allocation */ |
---|
57 | /* */ |
---|
58 | /* <Abstract> */ |
---|
59 | /* How client applications should allocate FreeType data structures. */ |
---|
60 | /* */ |
---|
61 | /* <Description> */ |
---|
62 | /* FreeType assumes that structures allocated by the user and passed */ |
---|
63 | /* as arguments are zeroed out except for the actual data. In other */ |
---|
64 | /* words, it is recommended to use `calloc' (or variants of it) */ |
---|
65 | /* instead of `malloc' for allocation. */ |
---|
66 | /* */ |
---|
67 | /*************************************************************************/ |
---|
68 | |
---|
69 | |
---|
70 | |
---|
71 | /*************************************************************************/ |
---|
72 | /*************************************************************************/ |
---|
73 | /* */ |
---|
74 | /* B A S I C T Y P E S */ |
---|
75 | /* */ |
---|
76 | /*************************************************************************/ |
---|
77 | /*************************************************************************/ |
---|
78 | |
---|
79 | |
---|
80 | /*************************************************************************/ |
---|
81 | /* */ |
---|
82 | /* <Section> */ |
---|
83 | /* base_interface */ |
---|
84 | /* */ |
---|
85 | /* <Title> */ |
---|
86 | /* Base Interface */ |
---|
87 | /* */ |
---|
88 | /* <Abstract> */ |
---|
89 | /* The FreeType~2 base font interface. */ |
---|
90 | /* */ |
---|
91 | /* <Description> */ |
---|
92 | /* This section describes the public high-level API of FreeType~2. */ |
---|
93 | /* */ |
---|
94 | /* <Order> */ |
---|
95 | /* FT_Library */ |
---|
96 | /* FT_Face */ |
---|
97 | /* FT_Size */ |
---|
98 | /* FT_GlyphSlot */ |
---|
99 | /* FT_CharMap */ |
---|
100 | /* FT_Encoding */ |
---|
101 | /* */ |
---|
102 | /* FT_FaceRec */ |
---|
103 | /* */ |
---|
104 | /* FT_FACE_FLAG_SCALABLE */ |
---|
105 | /* FT_FACE_FLAG_FIXED_SIZES */ |
---|
106 | /* FT_FACE_FLAG_FIXED_WIDTH */ |
---|
107 | /* FT_FACE_FLAG_HORIZONTAL */ |
---|
108 | /* FT_FACE_FLAG_VERTICAL */ |
---|
109 | /* FT_FACE_FLAG_SFNT */ |
---|
110 | /* FT_FACE_FLAG_KERNING */ |
---|
111 | /* FT_FACE_FLAG_MULTIPLE_MASTERS */ |
---|
112 | /* FT_FACE_FLAG_GLYPH_NAMES */ |
---|
113 | /* FT_FACE_FLAG_EXTERNAL_STREAM */ |
---|
114 | /* FT_FACE_FLAG_FAST_GLYPHS */ |
---|
115 | /* FT_FACE_FLAG_HINTER */ |
---|
116 | /* */ |
---|
117 | /* FT_STYLE_FLAG_BOLD */ |
---|
118 | /* FT_STYLE_FLAG_ITALIC */ |
---|
119 | /* */ |
---|
120 | /* FT_SizeRec */ |
---|
121 | /* FT_Size_Metrics */ |
---|
122 | /* */ |
---|
123 | /* FT_GlyphSlotRec */ |
---|
124 | /* FT_Glyph_Metrics */ |
---|
125 | /* FT_SubGlyph */ |
---|
126 | /* */ |
---|
127 | /* FT_Bitmap_Size */ |
---|
128 | /* */ |
---|
129 | /* FT_Init_FreeType */ |
---|
130 | /* FT_Done_FreeType */ |
---|
131 | /* */ |
---|
132 | /* FT_New_Face */ |
---|
133 | /* FT_Done_Face */ |
---|
134 | /* FT_New_Memory_Face */ |
---|
135 | /* FT_Open_Face */ |
---|
136 | /* FT_Open_Args */ |
---|
137 | /* FT_Parameter */ |
---|
138 | /* FT_Attach_File */ |
---|
139 | /* FT_Attach_Stream */ |
---|
140 | /* */ |
---|
141 | /* FT_Set_Char_Size */ |
---|
142 | /* FT_Set_Pixel_Sizes */ |
---|
143 | /* FT_Request_Size */ |
---|
144 | /* FT_Select_Size */ |
---|
145 | /* FT_Size_Request_Type */ |
---|
146 | /* FT_Size_Request */ |
---|
147 | /* FT_Set_Transform */ |
---|
148 | /* FT_Load_Glyph */ |
---|
149 | /* FT_Get_Char_Index */ |
---|
150 | /* FT_Get_Name_Index */ |
---|
151 | /* FT_Load_Char */ |
---|
152 | /* */ |
---|
153 | /* FT_OPEN_MEMORY */ |
---|
154 | /* FT_OPEN_STREAM */ |
---|
155 | /* FT_OPEN_PATHNAME */ |
---|
156 | /* FT_OPEN_DRIVER */ |
---|
157 | /* FT_OPEN_PARAMS */ |
---|
158 | /* */ |
---|
159 | /* FT_LOAD_DEFAULT */ |
---|
160 | /* FT_LOAD_RENDER */ |
---|
161 | /* FT_LOAD_MONOCHROME */ |
---|
162 | /* FT_LOAD_LINEAR_DESIGN */ |
---|
163 | /* FT_LOAD_NO_SCALE */ |
---|
164 | /* FT_LOAD_NO_HINTING */ |
---|
165 | /* FT_LOAD_NO_BITMAP */ |
---|
166 | /* FT_LOAD_CROP_BITMAP */ |
---|
167 | /* */ |
---|
168 | /* FT_LOAD_VERTICAL_LAYOUT */ |
---|
169 | /* FT_LOAD_IGNORE_TRANSFORM */ |
---|
170 | /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ |
---|
171 | /* FT_LOAD_FORCE_AUTOHINT */ |
---|
172 | /* FT_LOAD_NO_RECURSE */ |
---|
173 | /* FT_LOAD_PEDANTIC */ |
---|
174 | /* */ |
---|
175 | /* FT_LOAD_TARGET_NORMAL */ |
---|
176 | /* FT_LOAD_TARGET_LIGHT */ |
---|
177 | /* FT_LOAD_TARGET_MONO */ |
---|
178 | /* FT_LOAD_TARGET_LCD */ |
---|
179 | /* FT_LOAD_TARGET_LCD_V */ |
---|
180 | /* */ |
---|
181 | /* FT_Render_Glyph */ |
---|
182 | /* FT_Render_Mode */ |
---|
183 | /* FT_Get_Kerning */ |
---|
184 | /* FT_Kerning_Mode */ |
---|
185 | /* FT_Get_Track_Kerning */ |
---|
186 | /* FT_Get_Glyph_Name */ |
---|
187 | /* FT_Get_Postscript_Name */ |
---|
188 | /* */ |
---|
189 | /* FT_CharMapRec */ |
---|
190 | /* FT_Select_Charmap */ |
---|
191 | /* FT_Set_Charmap */ |
---|
192 | /* FT_Get_Charmap_Index */ |
---|
193 | /* */ |
---|
194 | /* FT_FSTYPE_INSTALLABLE_EMBEDDING */ |
---|
195 | /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */ |
---|
196 | /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */ |
---|
197 | /* FT_FSTYPE_EDITABLE_EMBEDDING */ |
---|
198 | /* FT_FSTYPE_NO_SUBSETTING */ |
---|
199 | /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */ |
---|
200 | /* */ |
---|
201 | /* FT_Get_FSType_Flags */ |
---|
202 | /* */ |
---|
203 | /*************************************************************************/ |
---|
204 | |
---|
205 | |
---|
206 | /*************************************************************************/ |
---|
207 | /* */ |
---|
208 | /* <Struct> */ |
---|
209 | /* FT_Glyph_Metrics */ |
---|
210 | /* */ |
---|
211 | /* <Description> */ |
---|
212 | /* A structure used to model the metrics of a single glyph. The */ |
---|
213 | /* values are expressed in 26.6 fractional pixel format; if the flag */ |
---|
214 | /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */ |
---|
215 | /* are expressed in font units instead. */ |
---|
216 | /* */ |
---|
217 | /* <Fields> */ |
---|
218 | /* width :: */ |
---|
219 | /* The glyph's width. */ |
---|
220 | /* */ |
---|
221 | /* height :: */ |
---|
222 | /* The glyph's height. */ |
---|
223 | /* */ |
---|
224 | /* horiBearingX :: */ |
---|
225 | /* Left side bearing for horizontal layout. */ |
---|
226 | /* */ |
---|
227 | /* horiBearingY :: */ |
---|
228 | /* Top side bearing for horizontal layout. */ |
---|
229 | /* */ |
---|
230 | /* horiAdvance :: */ |
---|
231 | /* Advance width for horizontal layout. */ |
---|
232 | /* */ |
---|
233 | /* vertBearingX :: */ |
---|
234 | /* Left side bearing for vertical layout. */ |
---|
235 | /* */ |
---|
236 | /* vertBearingY :: */ |
---|
237 | /* Top side bearing for vertical layout. */ |
---|
238 | /* */ |
---|
239 | /* vertAdvance :: */ |
---|
240 | /* Advance height for vertical layout. */ |
---|
241 | /* */ |
---|
242 | typedef struct FT_Glyph_Metrics_ |
---|
243 | { |
---|
244 | FT_Pos width; |
---|
245 | FT_Pos height; |
---|
246 | |
---|
247 | FT_Pos horiBearingX; |
---|
248 | FT_Pos horiBearingY; |
---|
249 | FT_Pos horiAdvance; |
---|
250 | |
---|
251 | FT_Pos vertBearingX; |
---|
252 | FT_Pos vertBearingY; |
---|
253 | FT_Pos vertAdvance; |
---|
254 | |
---|
255 | } FT_Glyph_Metrics; |
---|
256 | |
---|
257 | |
---|
258 | /*************************************************************************/ |
---|
259 | /* */ |
---|
260 | /* <Struct> */ |
---|
261 | /* FT_Bitmap_Size */ |
---|
262 | /* */ |
---|
263 | /* <Description> */ |
---|
264 | /* This structure models the metrics of a bitmap strike (i.e., a set */ |
---|
265 | /* of glyphs for a given point size and resolution) in a bitmap font. */ |
---|
266 | /* It is used for the `available_sizes' field of @FT_Face. */ |
---|
267 | /* */ |
---|
268 | /* <Fields> */ |
---|
269 | /* height :: The vertical distance, in pixels, between two */ |
---|
270 | /* consecutive baselines. It is always positive. */ |
---|
271 | /* */ |
---|
272 | /* width :: The average width, in pixels, of all glyphs in the */ |
---|
273 | /* strike. */ |
---|
274 | /* */ |
---|
275 | /* size :: The nominal size of the strike in 26.6 fractional */ |
---|
276 | /* points. This field is not very useful. */ |
---|
277 | /* */ |
---|
278 | /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */ |
---|
279 | /* pixels. */ |
---|
280 | /* */ |
---|
281 | /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */ |
---|
282 | /* pixels. */ |
---|
283 | /* */ |
---|
284 | /* <Note> */ |
---|
285 | /* Windows FNT: */ |
---|
286 | /* The nominal size given in a FNT font is not reliable. Thus when */ |
---|
287 | /* the driver finds it incorrect, it sets `size' to some calculated */ |
---|
288 | /* values and sets `x_ppem' and `y_ppem' to the pixel width and */ |
---|
289 | /* height given in the font, respectively. */ |
---|
290 | /* */ |
---|
291 | /* TrueType embedded bitmaps: */ |
---|
292 | /* `size', `width', and `height' values are not contained in the */ |
---|
293 | /* bitmap strike itself. They are computed from the global font */ |
---|
294 | /* parameters. */ |
---|
295 | /* */ |
---|
296 | typedef struct FT_Bitmap_Size_ |
---|
297 | { |
---|
298 | FT_Short height; |
---|
299 | FT_Short width; |
---|
300 | |
---|
301 | FT_Pos size; |
---|
302 | |
---|
303 | FT_Pos x_ppem; |
---|
304 | FT_Pos y_ppem; |
---|
305 | |
---|
306 | } FT_Bitmap_Size; |
---|
307 | |
---|
308 | |
---|
309 | /*************************************************************************/ |
---|
310 | /*************************************************************************/ |
---|
311 | /* */ |
---|
312 | /* O B J E C T C L A S S E S */ |
---|
313 | /* */ |
---|
314 | /*************************************************************************/ |
---|
315 | /*************************************************************************/ |
---|
316 | |
---|
317 | /*************************************************************************/ |
---|
318 | /* */ |
---|
319 | /* <Type> */ |
---|
320 | /* FT_Library */ |
---|
321 | /* */ |
---|
322 | /* <Description> */ |
---|
323 | /* A handle to a FreeType library instance. Each `library' is */ |
---|
324 | /* completely independent from the others; it is the `root' of a set */ |
---|
325 | /* of objects like fonts, faces, sizes, etc. */ |
---|
326 | /* */ |
---|
327 | /* It also embeds a memory manager (see @FT_Memory), as well as a */ |
---|
328 | /* scan-line converter object (see @FT_Raster). */ |
---|
329 | /* */ |
---|
330 | /* For multi-threading applications each thread should have its own */ |
---|
331 | /* FT_Library object. */ |
---|
332 | /* */ |
---|
333 | /* <Note> */ |
---|
334 | /* Library objects are normally created by @FT_Init_FreeType, and */ |
---|
335 | /* destroyed with @FT_Done_FreeType. */ |
---|
336 | /* */ |
---|
337 | typedef struct FT_LibraryRec_ *FT_Library; |
---|
338 | |
---|
339 | |
---|
340 | /*************************************************************************/ |
---|
341 | /* */ |
---|
342 | /* <Type> */ |
---|
343 | /* FT_Module */ |
---|
344 | /* */ |
---|
345 | /* <Description> */ |
---|
346 | /* A handle to a given FreeType module object. Each module can be a */ |
---|
347 | /* font driver, a renderer, or anything else that provides services */ |
---|
348 | /* to the formers. */ |
---|
349 | /* */ |
---|
350 | typedef struct FT_ModuleRec_* FT_Module; |
---|
351 | |
---|
352 | |
---|
353 | /*************************************************************************/ |
---|
354 | /* */ |
---|
355 | /* <Type> */ |
---|
356 | /* FT_Driver */ |
---|
357 | /* */ |
---|
358 | /* <Description> */ |
---|
359 | /* A handle to a given FreeType font driver object. Each font driver */ |
---|
360 | /* is a special module capable of creating faces from font files. */ |
---|
361 | /* */ |
---|
362 | typedef struct FT_DriverRec_* FT_Driver; |
---|
363 | |
---|
364 | |
---|
365 | /*************************************************************************/ |
---|
366 | /* */ |
---|
367 | /* <Type> */ |
---|
368 | /* FT_Renderer */ |
---|
369 | /* */ |
---|
370 | /* <Description> */ |
---|
371 | /* A handle to a given FreeType renderer. A renderer is a special */ |
---|
372 | /* module in charge of converting a glyph image to a bitmap, when */ |
---|
373 | /* necessary. Each renderer supports a given glyph image format, and */ |
---|
374 | /* one or more target surface depths. */ |
---|
375 | /* */ |
---|
376 | typedef struct FT_RendererRec_* FT_Renderer; |
---|
377 | |
---|
378 | |
---|
379 | /*************************************************************************/ |
---|
380 | /* */ |
---|
381 | /* <Type> */ |
---|
382 | /* FT_Face */ |
---|
383 | /* */ |
---|
384 | /* <Description> */ |
---|
385 | /* A handle to a given typographic face object. A face object models */ |
---|
386 | /* a given typeface, in a given style. */ |
---|
387 | /* */ |
---|
388 | /* <Note> */ |
---|
389 | /* Each face object also owns a single @FT_GlyphSlot object, as well */ |
---|
390 | /* as one or more @FT_Size objects. */ |
---|
391 | /* */ |
---|
392 | /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */ |
---|
393 | /* a given filepathname or a custom input stream. */ |
---|
394 | /* */ |
---|
395 | /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ |
---|
396 | /* */ |
---|
397 | /* <Also> */ |
---|
398 | /* The @FT_FaceRec details the publicly accessible fields of a given */ |
---|
399 | /* face object. */ |
---|
400 | /* */ |
---|
401 | typedef struct FT_FaceRec_* FT_Face; |
---|
402 | |
---|
403 | |
---|
404 | /*************************************************************************/ |
---|
405 | /* */ |
---|
406 | /* <Type> */ |
---|
407 | /* FT_Size */ |
---|
408 | /* */ |
---|
409 | /* <Description> */ |
---|
410 | /* A handle to an object used to model a face scaled to a given */ |
---|
411 | /* character size. */ |
---|
412 | /* */ |
---|
413 | /* <Note> */ |
---|
414 | /* Each @FT_Face has an _active_ @FT_Size object that is used by */ |
---|
415 | /* functions like @FT_Load_Glyph to determine the scaling */ |
---|
416 | /* transformation which is used to load and hint glyphs and metrics. */ |
---|
417 | /* */ |
---|
418 | /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */ |
---|
419 | /* @FT_Request_Size or even @FT_Select_Size to change the content */ |
---|
420 | /* (i.e., the scaling values) of the active @FT_Size. */ |
---|
421 | /* */ |
---|
422 | /* You can use @FT_New_Size to create additional size objects for a */ |
---|
423 | /* given @FT_Face, but they won't be used by other functions until */ |
---|
424 | /* you activate it through @FT_Activate_Size. Only one size can be */ |
---|
425 | /* activated at any given time per face. */ |
---|
426 | /* */ |
---|
427 | /* <Also> */ |
---|
428 | /* The @FT_SizeRec structure details the publicly accessible fields */ |
---|
429 | /* of a given size object. */ |
---|
430 | /* */ |
---|
431 | typedef struct FT_SizeRec_* FT_Size; |
---|
432 | |
---|
433 | |
---|
434 | /*************************************************************************/ |
---|
435 | /* */ |
---|
436 | /* <Type> */ |
---|
437 | /* FT_GlyphSlot */ |
---|
438 | /* */ |
---|
439 | /* <Description> */ |
---|
440 | /* A handle to a given `glyph slot'. A slot is a container where it */ |
---|
441 | /* is possible to load any one of the glyphs contained in its parent */ |
---|
442 | /* face. */ |
---|
443 | /* */ |
---|
444 | /* In other words, each time you call @FT_Load_Glyph or */ |
---|
445 | /* @FT_Load_Char, the slot's content is erased by the new glyph data, */ |
---|
446 | /* i.e., the glyph's metrics, its image (bitmap or outline), and */ |
---|
447 | /* other control information. */ |
---|
448 | /* */ |
---|
449 | /* <Also> */ |
---|
450 | /* @FT_GlyphSlotRec details the publicly accessible glyph fields. */ |
---|
451 | /* */ |
---|
452 | typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; |
---|
453 | |
---|
454 | |
---|
455 | /*************************************************************************/ |
---|
456 | /* */ |
---|
457 | /* <Type> */ |
---|
458 | /* FT_CharMap */ |
---|
459 | /* */ |
---|
460 | /* <Description> */ |
---|
461 | /* A handle to a given character map. A charmap is used to translate */ |
---|
462 | /* character codes in a given encoding into glyph indexes for its */ |
---|
463 | /* parent's face. Some font formats may provide several charmaps per */ |
---|
464 | /* font. */ |
---|
465 | /* */ |
---|
466 | /* Each face object owns zero or more charmaps, but only one of them */ |
---|
467 | /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */ |
---|
468 | /* */ |
---|
469 | /* The list of available charmaps in a face is available through the */ |
---|
470 | /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */ |
---|
471 | /* */ |
---|
472 | /* The currently active charmap is available as `face->charmap'. */ |
---|
473 | /* You should call @FT_Set_Charmap to change it. */ |
---|
474 | /* */ |
---|
475 | /* <Note> */ |
---|
476 | /* When a new face is created (either through @FT_New_Face or */ |
---|
477 | /* @FT_Open_Face), the library looks for a Unicode charmap within */ |
---|
478 | /* the list and automatically activates it. */ |
---|
479 | /* */ |
---|
480 | /* <Also> */ |
---|
481 | /* The @FT_CharMapRec details the publicly accessible fields of a */ |
---|
482 | /* given character map. */ |
---|
483 | /* */ |
---|
484 | typedef struct FT_CharMapRec_* FT_CharMap; |
---|
485 | |
---|
486 | |
---|
487 | /*************************************************************************/ |
---|
488 | /* */ |
---|
489 | /* <Macro> */ |
---|
490 | /* FT_ENC_TAG */ |
---|
491 | /* */ |
---|
492 | /* <Description> */ |
---|
493 | /* This macro converts four-letter tags into an unsigned long. It is */ |
---|
494 | /* used to define `encoding' identifiers (see @FT_Encoding). */ |
---|
495 | /* */ |
---|
496 | /* <Note> */ |
---|
497 | /* Since many 16-bit compilers don't like 32-bit enumerations, you */ |
---|
498 | /* should redefine this macro in case of problems to something like */ |
---|
499 | /* this: */ |
---|
500 | /* */ |
---|
501 | /* { */ |
---|
502 | /* #define FT_ENC_TAG( value, a, b, c, d ) value */ |
---|
503 | /* } */ |
---|
504 | /* */ |
---|
505 | /* to get a simple enumeration without assigning special numbers. */ |
---|
506 | /* */ |
---|
507 | |
---|
508 | #ifndef FT_ENC_TAG |
---|
509 | #define FT_ENC_TAG( value, a, b, c, d ) \ |
---|
510 | value = ( ( (FT_UInt32)(a) << 24 ) | \ |
---|
511 | ( (FT_UInt32)(b) << 16 ) | \ |
---|
512 | ( (FT_UInt32)(c) << 8 ) | \ |
---|
513 | (FT_UInt32)(d) ) |
---|
514 | |
---|
515 | #endif /* FT_ENC_TAG */ |
---|
516 | |
---|
517 | |
---|
518 | /*************************************************************************/ |
---|
519 | /* */ |
---|
520 | /* <Enum> */ |
---|
521 | /* FT_Encoding */ |
---|
522 | /* */ |
---|
523 | /* <Description> */ |
---|
524 | /* An enumeration used to specify character sets supported by */ |
---|
525 | /* charmaps. Used in the @FT_Select_Charmap API function. */ |
---|
526 | /* */ |
---|
527 | /* <Note> */ |
---|
528 | /* Despite the name, this enumeration lists specific character */ |
---|
529 | /* repertories (i.e., charsets), and not text encoding methods (e.g., */ |
---|
530 | /* UTF-8, UTF-16, GB2312_EUC, etc.). */ |
---|
531 | /* */ |
---|
532 | /* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */ |
---|
533 | /* all character codes must be expressed as FT_Longs. */ |
---|
534 | /* */ |
---|
535 | /* Other encodings might be defined in the future. */ |
---|
536 | /* */ |
---|
537 | /* <Values> */ |
---|
538 | /* FT_ENCODING_NONE :: */ |
---|
539 | /* The encoding value~0 is reserved. */ |
---|
540 | /* */ |
---|
541 | /* FT_ENCODING_UNICODE :: */ |
---|
542 | /* Corresponds to the Unicode character set. This value covers */ |
---|
543 | /* all versions of the Unicode repertoire, including ASCII and */ |
---|
544 | /* Latin-1. Most fonts include a Unicode charmap, but not all */ |
---|
545 | /* of them. */ |
---|
546 | /* */ |
---|
547 | /* FT_ENCODING_MS_SYMBOL :: */ |
---|
548 | /* Corresponds to the Microsoft Symbol encoding, used to encode */ |
---|
549 | /* mathematical symbols in the 32..255 character code range. For */ |
---|
550 | /* more information, see `http://www.ceviz.net/symbol.htm'. */ |
---|
551 | /* */ |
---|
552 | /* FT_ENCODING_SJIS :: */ |
---|
553 | /* Corresponds to Japanese SJIS encoding. More info at */ |
---|
554 | /* at `http://langsupport.japanreference.com/encoding.shtml'. */ |
---|
555 | /* See note on multi-byte encodings below. */ |
---|
556 | /* */ |
---|
557 | /* FT_ENCODING_GB2312 :: */ |
---|
558 | /* Corresponds to an encoding system for Simplified Chinese as used */ |
---|
559 | /* used in mainland China. */ |
---|
560 | /* */ |
---|
561 | /* FT_ENCODING_BIG5 :: */ |
---|
562 | /* Corresponds to an encoding system for Traditional Chinese as used */ |
---|
563 | /* in Taiwan and Hong Kong. */ |
---|
564 | /* */ |
---|
565 | /* FT_ENCODING_WANSUNG :: */ |
---|
566 | /* Corresponds to the Korean encoding system known as Wansung. */ |
---|
567 | /* For more information see */ |
---|
568 | /* `http://www.microsoft.com/typography/unicode/949.txt'. */ |
---|
569 | /* */ |
---|
570 | /* FT_ENCODING_JOHAB :: */ |
---|
571 | /* The Korean standard character set (KS~C 5601-1992), which */ |
---|
572 | /* corresponds to MS Windows code page 1361. This character set */ |
---|
573 | /* includes all possible Hangeul character combinations. */ |
---|
574 | /* */ |
---|
575 | /* FT_ENCODING_ADOBE_LATIN_1 :: */ |
---|
576 | /* Corresponds to a Latin-1 encoding as defined in a Type~1 */ |
---|
577 | /* PostScript font. It is limited to 256 character codes. */ |
---|
578 | /* */ |
---|
579 | /* FT_ENCODING_ADOBE_STANDARD :: */ |
---|
580 | /* Corresponds to the Adobe Standard encoding, as found in Type~1, */ |
---|
581 | /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ |
---|
582 | /* codes. */ |
---|
583 | /* */ |
---|
584 | /* FT_ENCODING_ADOBE_EXPERT :: */ |
---|
585 | /* Corresponds to the Adobe Expert encoding, as found in Type~1, */ |
---|
586 | /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ |
---|
587 | /* codes. */ |
---|
588 | /* */ |
---|
589 | /* FT_ENCODING_ADOBE_CUSTOM :: */ |
---|
590 | /* Corresponds to a custom encoding, as found in Type~1, CFF, and */ |
---|
591 | /* OpenType/CFF fonts. It is limited to 256 character codes. */ |
---|
592 | /* */ |
---|
593 | /* FT_ENCODING_APPLE_ROMAN :: */ |
---|
594 | /* Corresponds to the 8-bit Apple roman encoding. Many TrueType and */ |
---|
595 | /* OpenType fonts contain a charmap for this encoding, since older */ |
---|
596 | /* versions of Mac OS are able to use it. */ |
---|
597 | /* */ |
---|
598 | /* FT_ENCODING_OLD_LATIN_2 :: */ |
---|
599 | /* This value is deprecated and was never used nor reported by */ |
---|
600 | /* FreeType. Don't use or test for it. */ |
---|
601 | /* */ |
---|
602 | /* FT_ENCODING_MS_SJIS :: */ |
---|
603 | /* Same as FT_ENCODING_SJIS. Deprecated. */ |
---|
604 | /* */ |
---|
605 | /* FT_ENCODING_MS_GB2312 :: */ |
---|
606 | /* Same as FT_ENCODING_GB2312. Deprecated. */ |
---|
607 | /* */ |
---|
608 | /* FT_ENCODING_MS_BIG5 :: */ |
---|
609 | /* Same as FT_ENCODING_BIG5. Deprecated. */ |
---|
610 | /* */ |
---|
611 | /* FT_ENCODING_MS_WANSUNG :: */ |
---|
612 | /* Same as FT_ENCODING_WANSUNG. Deprecated. */ |
---|
613 | /* */ |
---|
614 | /* FT_ENCODING_MS_JOHAB :: */ |
---|
615 | /* Same as FT_ENCODING_JOHAB. Deprecated. */ |
---|
616 | /* */ |
---|
617 | /* <Note> */ |
---|
618 | /* By default, FreeType automatically synthesizes a Unicode charmap */ |
---|
619 | /* for PostScript fonts, using their glyph names dictionaries. */ |
---|
620 | /* However, it also reports the encodings defined explicitly in the */ |
---|
621 | /* font file, for the cases when they are needed, with the Adobe */ |
---|
622 | /* values as well. */ |
---|
623 | /* */ |
---|
624 | /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ |
---|
625 | /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ |
---|
626 | /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out which */ |
---|
627 | /* encoding is really present. If, for example, the `cs_registry' */ |
---|
628 | /* field is `KOI8' and the `cs_encoding' field is `R', the font is */ |
---|
629 | /* encoded in KOI8-R. */ |
---|
630 | /* */ |
---|
631 | /* FT_ENCODING_NONE is always set (with a single exception) by the */ |
---|
632 | /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ |
---|
633 | /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ |
---|
634 | /* which encoding is really present. For example, */ |
---|
635 | /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ |
---|
636 | /* Russian). */ |
---|
637 | /* */ |
---|
638 | /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ |
---|
639 | /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ |
---|
640 | /* FT_ENCODING_APPLE_ROMAN). */ |
---|
641 | /* */ |
---|
642 | /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ |
---|
643 | /* @FT_Get_CMap_Language_ID to query the Mac language ID which may be */ |
---|
644 | /* needed to be able to distinguish Apple encoding variants. See */ |
---|
645 | /* */ |
---|
646 | /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ |
---|
647 | /* */ |
---|
648 | /* to get an idea how to do that. Basically, if the language ID is~0, */ |
---|
649 | /* don't use it, otherwise subtract 1 from the language ID. Then */ |
---|
650 | /* examine `encoding_id'. If, for example, `encoding_id' is */ |
---|
651 | /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */ |
---|
652 | /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ |
---|
653 | /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ |
---|
654 | /* variant the Arabic encoding. */ |
---|
655 | /* */ |
---|
656 | typedef enum FT_Encoding_ |
---|
657 | { |
---|
658 | FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), |
---|
659 | |
---|
660 | FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ), |
---|
661 | FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ), |
---|
662 | |
---|
663 | FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ), |
---|
664 | FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ), |
---|
665 | FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ), |
---|
666 | FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ), |
---|
667 | FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ), |
---|
668 | |
---|
669 | /* for backwards compatibility */ |
---|
670 | FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS, |
---|
671 | FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312, |
---|
672 | FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5, |
---|
673 | FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG, |
---|
674 | FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB, |
---|
675 | |
---|
676 | FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ), |
---|
677 | FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ), |
---|
678 | FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ), |
---|
679 | FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ), |
---|
680 | |
---|
681 | FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ), |
---|
682 | |
---|
683 | FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' ) |
---|
684 | |
---|
685 | } FT_Encoding; |
---|
686 | |
---|
687 | |
---|
688 | /*************************************************************************/ |
---|
689 | /* */ |
---|
690 | /* <Enum> */ |
---|
691 | /* ft_encoding_xxx */ |
---|
692 | /* */ |
---|
693 | /* <Description> */ |
---|
694 | /* These constants are deprecated; use the corresponding @FT_Encoding */ |
---|
695 | /* values instead. */ |
---|
696 | /* */ |
---|
697 | #define ft_encoding_none FT_ENCODING_NONE |
---|
698 | #define ft_encoding_unicode FT_ENCODING_UNICODE |
---|
699 | #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL |
---|
700 | #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 |
---|
701 | #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 |
---|
702 | #define ft_encoding_sjis FT_ENCODING_SJIS |
---|
703 | #define ft_encoding_gb2312 FT_ENCODING_GB2312 |
---|
704 | #define ft_encoding_big5 FT_ENCODING_BIG5 |
---|
705 | #define ft_encoding_wansung FT_ENCODING_WANSUNG |
---|
706 | #define ft_encoding_johab FT_ENCODING_JOHAB |
---|
707 | |
---|
708 | #define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD |
---|
709 | #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT |
---|
710 | #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM |
---|
711 | #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN |
---|
712 | |
---|
713 | |
---|
714 | /*************************************************************************/ |
---|
715 | /* */ |
---|
716 | /* <Struct> */ |
---|
717 | /* FT_CharMapRec */ |
---|
718 | /* */ |
---|
719 | /* <Description> */ |
---|
720 | /* The base charmap structure. */ |
---|
721 | /* */ |
---|
722 | /* <Fields> */ |
---|
723 | /* face :: A handle to the parent face object. */ |
---|
724 | /* */ |
---|
725 | /* encoding :: An @FT_Encoding tag identifying the charmap. Use */ |
---|
726 | /* this with @FT_Select_Charmap. */ |
---|
727 | /* */ |
---|
728 | /* platform_id :: An ID number describing the platform for the */ |
---|
729 | /* following encoding ID. This comes directly from */ |
---|
730 | /* the TrueType specification and should be emulated */ |
---|
731 | /* for other formats. */ |
---|
732 | /* */ |
---|
733 | /* encoding_id :: A platform specific encoding number. This also */ |
---|
734 | /* comes from the TrueType specification and should be */ |
---|
735 | /* emulated similarly. */ |
---|
736 | /* */ |
---|
737 | typedef struct FT_CharMapRec_ |
---|
738 | { |
---|
739 | FT_Face face; |
---|
740 | FT_Encoding encoding; |
---|
741 | FT_UShort platform_id; |
---|
742 | FT_UShort encoding_id; |
---|
743 | |
---|
744 | } FT_CharMapRec; |
---|
745 | |
---|
746 | |
---|
747 | /*************************************************************************/ |
---|
748 | /*************************************************************************/ |
---|
749 | /* */ |
---|
750 | /* B A S E O B J E C T C L A S S E S */ |
---|
751 | /* */ |
---|
752 | /*************************************************************************/ |
---|
753 | /*************************************************************************/ |
---|
754 | |
---|
755 | |
---|
756 | /*************************************************************************/ |
---|
757 | /* */ |
---|
758 | /* <Type> */ |
---|
759 | /* FT_Face_Internal */ |
---|
760 | /* */ |
---|
761 | /* <Description> */ |
---|
762 | /* An opaque handle to an `FT_Face_InternalRec' structure, used to */ |
---|
763 | /* model private data of a given @FT_Face object. */ |
---|
764 | /* */ |
---|
765 | /* This structure might change between releases of FreeType~2 and is */ |
---|
766 | /* not generally available to client applications. */ |
---|
767 | /* */ |
---|
768 | typedef struct FT_Face_InternalRec_* FT_Face_Internal; |
---|
769 | |
---|
770 | |
---|
771 | /*************************************************************************/ |
---|
772 | /* */ |
---|
773 | /* <Struct> */ |
---|
774 | /* FT_FaceRec */ |
---|
775 | /* */ |
---|
776 | /* <Description> */ |
---|
777 | /* FreeType root face class structure. A face object models a */ |
---|
778 | /* typeface in a font file. */ |
---|
779 | /* */ |
---|
780 | /* <Fields> */ |
---|
781 | /* num_faces :: The number of faces in the font file. Some */ |
---|
782 | /* font formats can have multiple faces in */ |
---|
783 | /* a font file. */ |
---|
784 | /* */ |
---|
785 | /* face_index :: The index of the face in the font file. It */ |
---|
786 | /* is set to~0 if there is only one face in */ |
---|
787 | /* the font file. */ |
---|
788 | /* */ |
---|
789 | /* face_flags :: A set of bit flags that give important */ |
---|
790 | /* information about the face; see */ |
---|
791 | /* @FT_FACE_FLAG_XXX for the details. */ |
---|
792 | /* */ |
---|
793 | /* style_flags :: A set of bit flags indicating the style of */ |
---|
794 | /* the face; see @FT_STYLE_FLAG_XXX for the */ |
---|
795 | /* details. */ |
---|
796 | /* */ |
---|
797 | /* num_glyphs :: The number of glyphs in the face. If the */ |
---|
798 | /* face is scalable and has sbits (see */ |
---|
799 | /* `num_fixed_sizes'), it is set to the number */ |
---|
800 | /* of outline glyphs. */ |
---|
801 | /* */ |
---|
802 | /* For CID-keyed fonts, this value gives the */ |
---|
803 | /* highest CID used in the font. */ |
---|
804 | /* */ |
---|
805 | /* family_name :: The face's family name. This is an ASCII */ |
---|
806 | /* string, usually in English, which describes */ |
---|
807 | /* the typeface's family (like `Times New */ |
---|
808 | /* Roman', `Bodoni', `Garamond', etc). This */ |
---|
809 | /* is a least common denominator used to list */ |
---|
810 | /* fonts. Some formats (TrueType & OpenType) */ |
---|
811 | /* provide localized and Unicode versions of */ |
---|
812 | /* this string. Applications should use the */ |
---|
813 | /* format specific interface to access them. */ |
---|
814 | /* Can be NULL (e.g., in fonts embedded in a */ |
---|
815 | /* PDF file). */ |
---|
816 | /* */ |
---|
817 | /* style_name :: The face's style name. This is an ASCII */ |
---|
818 | /* string, usually in English, which describes */ |
---|
819 | /* the typeface's style (like `Italic', */ |
---|
820 | /* `Bold', `Condensed', etc). Not all font */ |
---|
821 | /* formats provide a style name, so this field */ |
---|
822 | /* is optional, and can be set to NULL. As */ |
---|
823 | /* for `family_name', some formats provide */ |
---|
824 | /* localized and Unicode versions of this */ |
---|
825 | /* string. Applications should use the format */ |
---|
826 | /* specific interface to access them. */ |
---|
827 | /* */ |
---|
828 | /* num_fixed_sizes :: The number of bitmap strikes in the face. */ |
---|
829 | /* Even if the face is scalable, there might */ |
---|
830 | /* still be bitmap strikes, which are called */ |
---|
831 | /* `sbits' in that case. */ |
---|
832 | /* */ |
---|
833 | /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */ |
---|
834 | /* strikes in the face. It is set to NULL if */ |
---|
835 | /* there is no bitmap strike. */ |
---|
836 | /* */ |
---|
837 | /* num_charmaps :: The number of charmaps in the face. */ |
---|
838 | /* */ |
---|
839 | /* charmaps :: An array of the charmaps of the face. */ |
---|
840 | /* */ |
---|
841 | /* generic :: A field reserved for client uses. See the */ |
---|
842 | /* @FT_Generic type description. */ |
---|
843 | /* */ |
---|
844 | /* bbox :: The font bounding box. Coordinates are */ |
---|
845 | /* expressed in font units (see */ |
---|
846 | /* `units_per_EM'). The box is large enough */ |
---|
847 | /* to contain any glyph from the font. Thus, */ |
---|
848 | /* `bbox.yMax' can be seen as the `maximal */ |
---|
849 | /* ascender', and `bbox.yMin' as the `minimal */ |
---|
850 | /* descender'. Only relevant for scalable */ |
---|
851 | /* formats. */ |
---|
852 | /* */ |
---|
853 | /* Note that the bounding box might be off by */ |
---|
854 | /* (at least) one pixel for hinted fonts. See */ |
---|
855 | /* @FT_Size_Metrics for further discussion. */ |
---|
856 | /* */ |
---|
857 | /* units_per_EM :: The number of font units per EM square for */ |
---|
858 | /* this face. This is typically 2048 for */ |
---|
859 | /* TrueType fonts, and 1000 for Type~1 fonts. */ |
---|
860 | /* Only relevant for scalable formats. */ |
---|
861 | /* */ |
---|
862 | /* ascender :: The typographic ascender of the face, */ |
---|
863 | /* expressed in font units. For font formats */ |
---|
864 | /* not having this information, it is set to */ |
---|
865 | /* `bbox.yMax'. Only relevant for scalable */ |
---|
866 | /* formats. */ |
---|
867 | /* */ |
---|
868 | /* descender :: The typographic descender of the face, */ |
---|
869 | /* expressed in font units. For font formats */ |
---|
870 | /* not having this information, it is set to */ |
---|
871 | /* `bbox.yMin'. Note that this field is */ |
---|
872 | /* usually negative. Only relevant for */ |
---|
873 | /* scalable formats. */ |
---|
874 | /* */ |
---|
875 | /* height :: The height is the vertical distance */ |
---|
876 | /* between two consecutive baselines, */ |
---|
877 | /* expressed in font units. It is always */ |
---|
878 | /* positive. Only relevant for scalable */ |
---|
879 | /* formats. */ |
---|
880 | /* */ |
---|
881 | /* max_advance_width :: The maximal advance width, in font units, */ |
---|
882 | /* for all glyphs in this face. This can be */ |
---|
883 | /* used to make word wrapping computations */ |
---|
884 | /* faster. Only relevant for scalable */ |
---|
885 | /* formats. */ |
---|
886 | /* */ |
---|
887 | /* max_advance_height :: The maximal advance height, in font units, */ |
---|
888 | /* for all glyphs in this face. This is only */ |
---|
889 | /* relevant for vertical layouts, and is set */ |
---|
890 | /* to `height' for fonts that do not provide */ |
---|
891 | /* vertical metrics. Only relevant for */ |
---|
892 | /* scalable formats. */ |
---|
893 | /* */ |
---|
894 | /* underline_position :: The position, in font units, of the */ |
---|
895 | /* underline line for this face. It is the */ |
---|
896 | /* center of the underlining stem. Only */ |
---|
897 | /* relevant for scalable formats. */ |
---|
898 | /* */ |
---|
899 | /* underline_thickness :: The thickness, in font units, of the */ |
---|
900 | /* underline for this face. Only relevant for */ |
---|
901 | /* scalable formats. */ |
---|
902 | /* */ |
---|
903 | /* glyph :: The face's associated glyph slot(s). */ |
---|
904 | /* */ |
---|
905 | /* size :: The current active size for this face. */ |
---|
906 | /* */ |
---|
907 | /* charmap :: The current active charmap for this face. */ |
---|
908 | /* */ |
---|
909 | /* <Note> */ |
---|
910 | /* Fields may be changed after a call to @FT_Attach_File or */ |
---|
911 | /* @FT_Attach_Stream. */ |
---|
912 | /* */ |
---|
913 | typedef struct FT_FaceRec_ |
---|
914 | { |
---|
915 | FT_Long num_faces; |
---|
916 | FT_Long face_index; |
---|
917 | |
---|
918 | FT_Long face_flags; |
---|
919 | FT_Long style_flags; |
---|
920 | |
---|
921 | FT_Long num_glyphs; |
---|
922 | |
---|
923 | FT_String* family_name; |
---|
924 | FT_String* style_name; |
---|
925 | |
---|
926 | FT_Int num_fixed_sizes; |
---|
927 | FT_Bitmap_Size* available_sizes; |
---|
928 | |
---|
929 | FT_Int num_charmaps; |
---|
930 | FT_CharMap* charmaps; |
---|
931 | |
---|
932 | FT_Generic generic; |
---|
933 | |
---|
934 | /*# The following member variables (down to `underline_thickness') */ |
---|
935 | /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ |
---|
936 | /*# for bitmap fonts. */ |
---|
937 | FT_BBox bbox; |
---|
938 | |
---|
939 | FT_UShort units_per_EM; |
---|
940 | FT_Short ascender; |
---|
941 | FT_Short descender; |
---|
942 | FT_Short height; |
---|
943 | |
---|
944 | FT_Short max_advance_width; |
---|
945 | FT_Short max_advance_height; |
---|
946 | |
---|
947 | FT_Short underline_position; |
---|
948 | FT_Short underline_thickness; |
---|
949 | |
---|
950 | FT_GlyphSlot glyph; |
---|
951 | FT_Size size; |
---|
952 | FT_CharMap charmap; |
---|
953 | |
---|
954 | /*@private begin */ |
---|
955 | |
---|
956 | FT_Driver driver; |
---|
957 | FT_Memory memory; |
---|
958 | FT_Stream stream; |
---|
959 | |
---|
960 | FT_ListRec sizes_list; |
---|
961 | |
---|
962 | FT_Generic autohint; |
---|
963 | void* extensions; |
---|
964 | |
---|
965 | FT_Face_Internal internal; |
---|
966 | |
---|
967 | /*@private end */ |
---|
968 | |
---|
969 | } FT_FaceRec; |
---|
970 | |
---|
971 | |
---|
972 | /*************************************************************************/ |
---|
973 | /* */ |
---|
974 | /* <Enum> */ |
---|
975 | /* FT_FACE_FLAG_XXX */ |
---|
976 | /* */ |
---|
977 | /* <Description> */ |
---|
978 | /* A list of bit flags used in the `face_flags' field of the */ |
---|
979 | /* @FT_FaceRec structure. They inform client applications of */ |
---|
980 | /* properties of the corresponding face. */ |
---|
981 | /* */ |
---|
982 | /* <Values> */ |
---|
983 | /* FT_FACE_FLAG_SCALABLE :: */ |
---|
984 | /* Indicates that the face contains outline glyphs. This doesn't */ |
---|
985 | /* prevent bitmap strikes, i.e., a face can have both this and */ |
---|
986 | /* and @FT_FACE_FLAG_FIXED_SIZES set. */ |
---|
987 | /* */ |
---|
988 | /* FT_FACE_FLAG_FIXED_SIZES :: */ |
---|
989 | /* Indicates that the face contains bitmap strikes. See also the */ |
---|
990 | /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */ |
---|
991 | /* */ |
---|
992 | /* FT_FACE_FLAG_FIXED_WIDTH :: */ |
---|
993 | /* Indicates that the face contains fixed-width characters (like */ |
---|
994 | /* Courier, Lucido, MonoType, etc.). */ |
---|
995 | /* */ |
---|
996 | /* FT_FACE_FLAG_SFNT :: */ |
---|
997 | /* Indicates that the face uses the `sfnt' storage scheme. For */ |
---|
998 | /* now, this means TrueType and OpenType. */ |
---|
999 | /* */ |
---|
1000 | /* FT_FACE_FLAG_HORIZONTAL :: */ |
---|
1001 | /* Indicates that the face contains horizontal glyph metrics. This */ |
---|
1002 | /* should be set for all common formats. */ |
---|
1003 | /* */ |
---|
1004 | /* FT_FACE_FLAG_VERTICAL :: */ |
---|
1005 | /* Indicates that the face contains vertical glyph metrics. This */ |
---|
1006 | /* is only available in some formats, not all of them. */ |
---|
1007 | /* */ |
---|
1008 | /* FT_FACE_FLAG_KERNING :: */ |
---|
1009 | /* Indicates that the face contains kerning information. If set, */ |
---|
1010 | /* the kerning distance can be retrieved through the function */ |
---|
1011 | /* @FT_Get_Kerning. Otherwise the function always return the */ |
---|
1012 | /* vector (0,0). Note that FreeType doesn't handle kerning data */ |
---|
1013 | /* from the `GPOS' table (as present in some OpenType fonts). */ |
---|
1014 | /* */ |
---|
1015 | /* FT_FACE_FLAG_FAST_GLYPHS :: */ |
---|
1016 | /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */ |
---|
1017 | /* */ |
---|
1018 | /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */ |
---|
1019 | /* Indicates that the font contains multiple masters and is capable */ |
---|
1020 | /* of interpolating between them. See the multiple-masters */ |
---|
1021 | /* specific API for details. */ |
---|
1022 | /* */ |
---|
1023 | /* FT_FACE_FLAG_GLYPH_NAMES :: */ |
---|
1024 | /* Indicates that the font contains glyph names that can be */ |
---|
1025 | /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */ |
---|
1026 | /* fonts contain broken glyph name tables. Use the function */ |
---|
1027 | /* @FT_Has_PS_Glyph_Names when needed. */ |
---|
1028 | /* */ |
---|
1029 | /* FT_FACE_FLAG_EXTERNAL_STREAM :: */ |
---|
1030 | /* Used internally by FreeType to indicate that a face's stream was */ |
---|
1031 | /* provided by the client application and should not be destroyed */ |
---|
1032 | /* when @FT_Done_Face is called. Don't read or test this flag. */ |
---|
1033 | /* */ |
---|
1034 | /* FT_FACE_FLAG_HINTER :: */ |
---|
1035 | /* Set if the font driver has a hinting machine of its own. For */ |
---|
1036 | /* example, with TrueType fonts, it makes sense to use data from */ |
---|
1037 | /* the SFNT `gasp' table only if the native TrueType hinting engine */ |
---|
1038 | /* (with the bytecode interpreter) is available and active. */ |
---|
1039 | /* */ |
---|
1040 | /* FT_FACE_FLAG_CID_KEYED :: */ |
---|
1041 | /* Set if the font is CID-keyed. In that case, the font is not */ |
---|
1042 | /* accessed by glyph indices but by CID values. For subsetted */ |
---|
1043 | /* CID-keyed fonts this has the consequence that not all index */ |
---|
1044 | /* values are a valid argument to FT_Load_Glyph. Only the CID */ |
---|
1045 | /* values for which corresponding glyphs in the subsetted font */ |
---|
1046 | /* exist make FT_Load_Glyph return successfully; in all other cases */ |
---|
1047 | /* you get an `FT_Err_Invalid_Argument' error. */ |
---|
1048 | /* */ |
---|
1049 | /* Note that CID-keyed fonts which are in an SFNT wrapper don't */ |
---|
1050 | /* have this flag set since the glyphs are accessed in the normal */ |
---|
1051 | /* way (using contiguous indices); the `CID-ness' isn't visible to */ |
---|
1052 | /* the application. */ |
---|
1053 | /* */ |
---|
1054 | /* FT_FACE_FLAG_TRICKY :: */ |
---|
1055 | /* Set if the font is `tricky', this is, it always needs the */ |
---|
1056 | /* font format's native hinting engine to get a reasonable result. */ |
---|
1057 | /* A typical example is the Chinese font `mingli.ttf' which uses */ |
---|
1058 | /* TrueType bytecode instructions to move and scale all of its */ |
---|
1059 | /* subglyphs. */ |
---|
1060 | /* */ |
---|
1061 | /* It is not possible to autohint such fonts using */ |
---|
1062 | /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */ |
---|
1063 | /* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */ |
---|
1064 | /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */ |
---|
1065 | /* probably never want this except for demonstration purposes. */ |
---|
1066 | /* */ |
---|
1067 | /* Currently, there are six TrueType fonts in the list of tricky */ |
---|
1068 | /* fonts; they are hard-coded in file `ttobjs.c'. */ |
---|
1069 | /* */ |
---|
1070 | #define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) |
---|
1071 | #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) |
---|
1072 | #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) |
---|
1073 | #define FT_FACE_FLAG_SFNT ( 1L << 3 ) |
---|
1074 | #define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) |
---|
1075 | #define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) |
---|
1076 | #define FT_FACE_FLAG_KERNING ( 1L << 6 ) |
---|
1077 | #define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) |
---|
1078 | #define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) |
---|
1079 | #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) |
---|
1080 | #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) |
---|
1081 | #define FT_FACE_FLAG_HINTER ( 1L << 11 ) |
---|
1082 | #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) |
---|
1083 | #define FT_FACE_FLAG_TRICKY ( 1L << 13 ) |
---|
1084 | |
---|
1085 | |
---|
1086 | /************************************************************************* |
---|
1087 | * |
---|
1088 | * @macro: |
---|
1089 | * FT_HAS_HORIZONTAL( face ) |
---|
1090 | * |
---|
1091 | * @description: |
---|
1092 | * A macro that returns true whenever a face object contains |
---|
1093 | * horizontal metrics (this is true for all font formats though). |
---|
1094 | * |
---|
1095 | * @also: |
---|
1096 | * @FT_HAS_VERTICAL can be used to check for vertical metrics. |
---|
1097 | * |
---|
1098 | */ |
---|
1099 | #define FT_HAS_HORIZONTAL( face ) \ |
---|
1100 | ( face->face_flags & FT_FACE_FLAG_HORIZONTAL ) |
---|
1101 | |
---|
1102 | |
---|
1103 | /************************************************************************* |
---|
1104 | * |
---|
1105 | * @macro: |
---|
1106 | * FT_HAS_VERTICAL( face ) |
---|
1107 | * |
---|
1108 | * @description: |
---|
1109 | * A macro that returns true whenever a face object contains vertical |
---|
1110 | * metrics. |
---|
1111 | * |
---|
1112 | */ |
---|
1113 | #define FT_HAS_VERTICAL( face ) \ |
---|
1114 | ( face->face_flags & FT_FACE_FLAG_VERTICAL ) |
---|
1115 | |
---|
1116 | |
---|
1117 | /************************************************************************* |
---|
1118 | * |
---|
1119 | * @macro: |
---|
1120 | * FT_HAS_KERNING( face ) |
---|
1121 | * |
---|
1122 | * @description: |
---|
1123 | * A macro that returns true whenever a face object contains kerning |
---|
1124 | * data that can be accessed with @FT_Get_Kerning. |
---|
1125 | * |
---|
1126 | */ |
---|
1127 | #define FT_HAS_KERNING( face ) \ |
---|
1128 | ( face->face_flags & FT_FACE_FLAG_KERNING ) |
---|
1129 | |
---|
1130 | |
---|
1131 | /************************************************************************* |
---|
1132 | * |
---|
1133 | * @macro: |
---|
1134 | * FT_IS_SCALABLE( face ) |
---|
1135 | * |
---|
1136 | * @description: |
---|
1137 | * A macro that returns true whenever a face object contains a scalable |
---|
1138 | * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF, |
---|
1139 | * and PFR font formats. |
---|
1140 | * |
---|
1141 | */ |
---|
1142 | #define FT_IS_SCALABLE( face ) \ |
---|
1143 | ( face->face_flags & FT_FACE_FLAG_SCALABLE ) |
---|
1144 | |
---|
1145 | |
---|
1146 | /************************************************************************* |
---|
1147 | * |
---|
1148 | * @macro: |
---|
1149 | * FT_IS_SFNT( face ) |
---|
1150 | * |
---|
1151 | * @description: |
---|
1152 | * A macro that returns true whenever a face object contains a font |
---|
1153 | * whose format is based on the SFNT storage scheme. This usually |
---|
1154 | * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded |
---|
1155 | * bitmap fonts. |
---|
1156 | * |
---|
1157 | * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and |
---|
1158 | * @FT_TRUETYPE_TABLES_H are available. |
---|
1159 | * |
---|
1160 | */ |
---|
1161 | #define FT_IS_SFNT( face ) \ |
---|
1162 | ( face->face_flags & FT_FACE_FLAG_SFNT ) |
---|
1163 | |
---|
1164 | |
---|
1165 | /************************************************************************* |
---|
1166 | * |
---|
1167 | * @macro: |
---|
1168 | * FT_IS_FIXED_WIDTH( face ) |
---|
1169 | * |
---|
1170 | * @description: |
---|
1171 | * A macro that returns true whenever a face object contains a font face |
---|
1172 | * that contains fixed-width (or `monospace', `fixed-pitch', etc.) |
---|
1173 | * glyphs. |
---|
1174 | * |
---|
1175 | */ |
---|
1176 | #define FT_IS_FIXED_WIDTH( face ) \ |
---|
1177 | ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) |
---|
1178 | |
---|
1179 | |
---|
1180 | /************************************************************************* |
---|
1181 | * |
---|
1182 | * @macro: |
---|
1183 | * FT_HAS_FIXED_SIZES( face ) |
---|
1184 | * |
---|
1185 | * @description: |
---|
1186 | * A macro that returns true whenever a face object contains some |
---|
1187 | * embedded bitmaps. See the `available_sizes' field of the |
---|
1188 | * @FT_FaceRec structure. |
---|
1189 | * |
---|
1190 | */ |
---|
1191 | #define FT_HAS_FIXED_SIZES( face ) \ |
---|
1192 | ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) |
---|
1193 | |
---|
1194 | |
---|
1195 | /************************************************************************* |
---|
1196 | * |
---|
1197 | * @macro: |
---|
1198 | * FT_HAS_FAST_GLYPHS( face ) |
---|
1199 | * |
---|
1200 | * @description: |
---|
1201 | * Deprecated. |
---|
1202 | * |
---|
1203 | */ |
---|
1204 | #define FT_HAS_FAST_GLYPHS( face ) 0 |
---|
1205 | |
---|
1206 | |
---|
1207 | /************************************************************************* |
---|
1208 | * |
---|
1209 | * @macro: |
---|
1210 | * FT_HAS_GLYPH_NAMES( face ) |
---|
1211 | * |
---|
1212 | * @description: |
---|
1213 | * A macro that returns true whenever a face object contains some glyph |
---|
1214 | * names that can be accessed through @FT_Get_Glyph_Name. |
---|
1215 | * |
---|
1216 | */ |
---|
1217 | #define FT_HAS_GLYPH_NAMES( face ) \ |
---|
1218 | ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) |
---|
1219 | |
---|
1220 | |
---|
1221 | /************************************************************************* |
---|
1222 | * |
---|
1223 | * @macro: |
---|
1224 | * FT_HAS_MULTIPLE_MASTERS( face ) |
---|
1225 | * |
---|
1226 | * @description: |
---|
1227 | * A macro that returns true whenever a face object contains some |
---|
1228 | * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H |
---|
1229 | * are then available to choose the exact design you want. |
---|
1230 | * |
---|
1231 | */ |
---|
1232 | #define FT_HAS_MULTIPLE_MASTERS( face ) \ |
---|
1233 | ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) |
---|
1234 | |
---|
1235 | |
---|
1236 | /************************************************************************* |
---|
1237 | * |
---|
1238 | * @macro: |
---|
1239 | * FT_IS_CID_KEYED( face ) |
---|
1240 | * |
---|
1241 | * @description: |
---|
1242 | * A macro that returns true whenever a face object contains a CID-keyed |
---|
1243 | * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more |
---|
1244 | * details. |
---|
1245 | * |
---|
1246 | * If this macro is true, all functions defined in @FT_CID_H are |
---|
1247 | * available. |
---|
1248 | * |
---|
1249 | */ |
---|
1250 | #define FT_IS_CID_KEYED( face ) \ |
---|
1251 | ( face->face_flags & FT_FACE_FLAG_CID_KEYED ) |
---|
1252 | |
---|
1253 | |
---|
1254 | /************************************************************************* |
---|
1255 | * |
---|
1256 | * @macro: |
---|
1257 | * FT_IS_TRICKY( face ) |
---|
1258 | * |
---|
1259 | * @description: |
---|
1260 | * A macro that returns true whenever a face represents a `tricky' font. |
---|
1261 | * See the discussion of @FT_FACE_FLAG_TRICKY for more details. |
---|
1262 | * |
---|
1263 | */ |
---|
1264 | #define FT_IS_TRICKY( face ) \ |
---|
1265 | ( face->face_flags & FT_FACE_FLAG_TRICKY ) |
---|
1266 | |
---|
1267 | |
---|
1268 | /*************************************************************************/ |
---|
1269 | /* */ |
---|
1270 | /* <Const> */ |
---|
1271 | /* FT_STYLE_FLAG_XXX */ |
---|
1272 | /* */ |
---|
1273 | /* <Description> */ |
---|
1274 | /* A list of bit-flags used to indicate the style of a given face. */ |
---|
1275 | /* These are used in the `style_flags' field of @FT_FaceRec. */ |
---|
1276 | /* */ |
---|
1277 | /* <Values> */ |
---|
1278 | /* FT_STYLE_FLAG_ITALIC :: */ |
---|
1279 | /* Indicates that a given face style is italic or oblique. */ |
---|
1280 | /* */ |
---|
1281 | /* FT_STYLE_FLAG_BOLD :: */ |
---|
1282 | /* Indicates that a given face is bold. */ |
---|
1283 | /* */ |
---|
1284 | /* <Note> */ |
---|
1285 | /* The style information as provided by FreeType is very basic. More */ |
---|
1286 | /* details are beyond the scope and should be done on a higher level */ |
---|
1287 | /* (for example, by analyzing various fields of the `OS/2' table in */ |
---|
1288 | /* SFNT based fonts). */ |
---|
1289 | /* */ |
---|
1290 | #define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) |
---|
1291 | #define FT_STYLE_FLAG_BOLD ( 1 << 1 ) |
---|
1292 | |
---|
1293 | |
---|
1294 | /*************************************************************************/ |
---|
1295 | /* */ |
---|
1296 | /* <Type> */ |
---|
1297 | /* FT_Size_Internal */ |
---|
1298 | /* */ |
---|
1299 | /* <Description> */ |
---|
1300 | /* An opaque handle to an `FT_Size_InternalRec' structure, used to */ |
---|
1301 | /* model private data of a given @FT_Size object. */ |
---|
1302 | /* */ |
---|
1303 | typedef struct FT_Size_InternalRec_* FT_Size_Internal; |
---|
1304 | |
---|
1305 | |
---|
1306 | /*************************************************************************/ |
---|
1307 | /* */ |
---|
1308 | /* <Struct> */ |
---|
1309 | /* FT_Size_Metrics */ |
---|
1310 | /* */ |
---|
1311 | /* <Description> */ |
---|
1312 | /* The size metrics structure gives the metrics of a size object. */ |
---|
1313 | /* */ |
---|
1314 | /* <Fields> */ |
---|
1315 | /* x_ppem :: The width of the scaled EM square in pixels, hence */ |
---|
1316 | /* the term `ppem' (pixels per EM). It is also */ |
---|
1317 | /* referred to as `nominal width'. */ |
---|
1318 | /* */ |
---|
1319 | /* y_ppem :: The height of the scaled EM square in pixels, */ |
---|
1320 | /* hence the term `ppem' (pixels per EM). It is also */ |
---|
1321 | /* referred to as `nominal height'. */ |
---|
1322 | /* */ |
---|
1323 | /* x_scale :: A 16.16 fractional scaling value used to convert */ |
---|
1324 | /* horizontal metrics from font units to 26.6 */ |
---|
1325 | /* fractional pixels. Only relevant for scalable */ |
---|
1326 | /* font formats. */ |
---|
1327 | /* */ |
---|
1328 | /* y_scale :: A 16.16 fractional scaling value used to convert */ |
---|
1329 | /* vertical metrics from font units to 26.6 */ |
---|
1330 | /* fractional pixels. Only relevant for scalable */ |
---|
1331 | /* font formats. */ |
---|
1332 | /* */ |
---|
1333 | /* ascender :: The ascender in 26.6 fractional pixels. See */ |
---|
1334 | /* @FT_FaceRec for the details. */ |
---|
1335 | /* */ |
---|
1336 | /* descender :: The descender in 26.6 fractional pixels. See */ |
---|
1337 | /* @FT_FaceRec for the details. */ |
---|
1338 | /* */ |
---|
1339 | /* height :: The height in 26.6 fractional pixels. See */ |
---|
1340 | /* @FT_FaceRec for the details. */ |
---|
1341 | /* */ |
---|
1342 | /* max_advance :: The maximal advance width in 26.6 fractional */ |
---|
1343 | /* pixels. See @FT_FaceRec for the details. */ |
---|
1344 | /* */ |
---|
1345 | /* <Note> */ |
---|
1346 | /* The scaling values, if relevant, are determined first during a */ |
---|
1347 | /* size changing operation. The remaining fields are then set by the */ |
---|
1348 | /* driver. For scalable formats, they are usually set to scaled */ |
---|
1349 | /* values of the corresponding fields in @FT_FaceRec. */ |
---|
1350 | /* */ |
---|
1351 | /* Note that due to glyph hinting, these values might not be exact */ |
---|
1352 | /* for certain fonts. Thus they must be treated as unreliable */ |
---|
1353 | /* with an error margin of at least one pixel! */ |
---|
1354 | /* */ |
---|
1355 | /* Indeed, the only way to get the exact metrics is to render _all_ */ |
---|
1356 | /* glyphs. As this would be a definite performance hit, it is up to */ |
---|
1357 | /* client applications to perform such computations. */ |
---|
1358 | /* */ |
---|
1359 | /* The FT_Size_Metrics structure is valid for bitmap fonts also. */ |
---|
1360 | /* */ |
---|
1361 | typedef struct FT_Size_Metrics_ |
---|
1362 | { |
---|
1363 | FT_UShort x_ppem; /* horizontal pixels per EM */ |
---|
1364 | FT_UShort y_ppem; /* vertical pixels per EM */ |
---|
1365 | |
---|
1366 | FT_Fixed x_scale; /* scaling values used to convert font */ |
---|
1367 | FT_Fixed y_scale; /* units to 26.6 fractional pixels */ |
---|
1368 | |
---|
1369 | FT_Pos ascender; /* ascender in 26.6 frac. pixels */ |
---|
1370 | FT_Pos descender; /* descender in 26.6 frac. pixels */ |
---|
1371 | FT_Pos height; /* text height in 26.6 frac. pixels */ |
---|
1372 | FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */ |
---|
1373 | |
---|
1374 | } FT_Size_Metrics; |
---|
1375 | |
---|
1376 | |
---|
1377 | /*************************************************************************/ |
---|
1378 | /* */ |
---|
1379 | /* <Struct> */ |
---|
1380 | /* FT_SizeRec */ |
---|
1381 | /* */ |
---|
1382 | /* <Description> */ |
---|
1383 | /* FreeType root size class structure. A size object models a face */ |
---|
1384 | /* object at a given size. */ |
---|
1385 | /* */ |
---|
1386 | /* <Fields> */ |
---|
1387 | /* face :: Handle to the parent face object. */ |
---|
1388 | /* */ |
---|
1389 | /* generic :: A typeless pointer, which is unused by the FreeType */ |
---|
1390 | /* library or any of its drivers. It can be used by */ |
---|
1391 | /* client applications to link their own data to each size */ |
---|
1392 | /* object. */ |
---|
1393 | /* */ |
---|
1394 | /* metrics :: Metrics for this size object. This field is read-only. */ |
---|
1395 | /* */ |
---|
1396 | typedef struct FT_SizeRec_ |
---|
1397 | { |
---|
1398 | FT_Face face; /* parent face object */ |
---|
1399 | FT_Generic generic; /* generic pointer for client uses */ |
---|
1400 | FT_Size_Metrics metrics; /* size metrics */ |
---|
1401 | FT_Size_Internal internal; |
---|
1402 | |
---|
1403 | } FT_SizeRec; |
---|
1404 | |
---|
1405 | |
---|
1406 | /*************************************************************************/ |
---|
1407 | /* */ |
---|
1408 | /* <Struct> */ |
---|
1409 | /* FT_SubGlyph */ |
---|
1410 | /* */ |
---|
1411 | /* <Description> */ |
---|
1412 | /* The subglyph structure is an internal object used to describe */ |
---|
1413 | /* subglyphs (for example, in the case of composites). */ |
---|
1414 | /* */ |
---|
1415 | /* <Note> */ |
---|
1416 | /* The subglyph implementation is not part of the high-level API, */ |
---|
1417 | /* hence the forward structure declaration. */ |
---|
1418 | /* */ |
---|
1419 | /* You can however retrieve subglyph information with */ |
---|
1420 | /* @FT_Get_SubGlyph_Info. */ |
---|
1421 | /* */ |
---|
1422 | typedef struct FT_SubGlyphRec_* FT_SubGlyph; |
---|
1423 | |
---|
1424 | |
---|
1425 | /*************************************************************************/ |
---|
1426 | /* */ |
---|
1427 | /* <Type> */ |
---|
1428 | /* FT_Slot_Internal */ |
---|
1429 | /* */ |
---|
1430 | /* <Description> */ |
---|
1431 | /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */ |
---|
1432 | /* model private data of a given @FT_GlyphSlot object. */ |
---|
1433 | /* */ |
---|
1434 | typedef struct FT_Slot_InternalRec_* FT_Slot_Internal; |
---|
1435 | |
---|
1436 | |
---|
1437 | /*************************************************************************/ |
---|
1438 | /* */ |
---|
1439 | /* <Struct> */ |
---|
1440 | /* FT_GlyphSlotRec */ |
---|
1441 | /* */ |
---|
1442 | /* <Description> */ |
---|
1443 | /* FreeType root glyph slot class structure. A glyph slot is a */ |
---|
1444 | /* container where individual glyphs can be loaded, be they in */ |
---|
1445 | /* outline or bitmap format. */ |
---|
1446 | /* */ |
---|
1447 | /* <Fields> */ |
---|
1448 | /* library :: A handle to the FreeType library instance */ |
---|
1449 | /* this slot belongs to. */ |
---|
1450 | /* */ |
---|
1451 | /* face :: A handle to the parent face object. */ |
---|
1452 | /* */ |
---|
1453 | /* next :: In some cases (like some font tools), several */ |
---|
1454 | /* glyph slots per face object can be a good */ |
---|
1455 | /* thing. As this is rare, the glyph slots are */ |
---|
1456 | /* listed through a direct, single-linked list */ |
---|
1457 | /* using its `next' field. */ |
---|
1458 | /* */ |
---|
1459 | /* generic :: A typeless pointer which is unused by the */ |
---|
1460 | /* FreeType library or any of its drivers. It */ |
---|
1461 | /* can be used by client applications to link */ |
---|
1462 | /* their own data to each glyph slot object. */ |
---|
1463 | /* */ |
---|
1464 | /* metrics :: The metrics of the last loaded glyph in the */ |
---|
1465 | /* slot. The returned values depend on the last */ |
---|
1466 | /* load flags (see the @FT_Load_Glyph API */ |
---|
1467 | /* function) and can be expressed either in 26.6 */ |
---|
1468 | /* fractional pixels or font units. */ |
---|
1469 | /* */ |
---|
1470 | /* Note that even when the glyph image is */ |
---|
1471 | /* transformed, the metrics are not. */ |
---|
1472 | /* */ |
---|
1473 | /* linearHoriAdvance :: The advance width of the unhinted glyph. */ |
---|
1474 | /* Its value is expressed in 16.16 fractional */ |
---|
1475 | /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ |
---|
1476 | /* when loading the glyph. This field can be */ |
---|
1477 | /* important to perform correct WYSIWYG layout. */ |
---|
1478 | /* Only relevant for outline glyphs. */ |
---|
1479 | /* */ |
---|
1480 | /* linearVertAdvance :: The advance height of the unhinted glyph. */ |
---|
1481 | /* Its value is expressed in 16.16 fractional */ |
---|
1482 | /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ |
---|
1483 | /* when loading the glyph. This field can be */ |
---|
1484 | /* important to perform correct WYSIWYG layout. */ |
---|
1485 | /* Only relevant for outline glyphs. */ |
---|
1486 | /* */ |
---|
1487 | /* advance :: This is the transformed advance width for the */ |
---|
1488 | /* glyph. */ |
---|
1489 | /* */ |
---|
1490 | /* format :: This field indicates the format of the image */ |
---|
1491 | /* contained in the glyph slot. Typically */ |
---|
1492 | /* @FT_GLYPH_FORMAT_BITMAP, */ |
---|
1493 | /* @FT_GLYPH_FORMAT_OUTLINE, or */ |
---|
1494 | /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */ |
---|
1495 | /* possible. */ |
---|
1496 | /* */ |
---|
1497 | /* bitmap :: This field is used as a bitmap descriptor */ |
---|
1498 | /* when the slot format is */ |
---|
1499 | /* @FT_GLYPH_FORMAT_BITMAP. Note that the */ |
---|
1500 | /* address and content of the bitmap buffer can */ |
---|
1501 | /* change between calls of @FT_Load_Glyph and a */ |
---|
1502 | /* few other functions. */ |
---|
1503 | /* */ |
---|
1504 | /* bitmap_left :: This is the bitmap's left bearing expressed */ |
---|
1505 | /* in integer pixels. Of course, this is only */ |
---|
1506 | /* valid if the format is */ |
---|
1507 | /* @FT_GLYPH_FORMAT_BITMAP. */ |
---|
1508 | /* */ |
---|
1509 | /* bitmap_top :: This is the bitmap's top bearing expressed in */ |
---|
1510 | /* integer pixels. Remember that this is the */ |
---|
1511 | /* distance from the baseline to the top-most */ |
---|
1512 | /* glyph scanline, upwards y~coordinates being */ |
---|
1513 | /* *positive*. */ |
---|
1514 | /* */ |
---|
1515 | /* outline :: The outline descriptor for the current glyph */ |
---|
1516 | /* image if its format is */ |
---|
1517 | /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */ |
---|
1518 | /* loaded, `outline' can be transformed, */ |
---|
1519 | /* distorted, embolded, etc. However, it must */ |
---|
1520 | /* not be freed. */ |
---|
1521 | /* */ |
---|
1522 | /* num_subglyphs :: The number of subglyphs in a composite glyph. */ |
---|
1523 | /* This field is only valid for the composite */ |
---|
1524 | /* glyph format that should normally only be */ |
---|
1525 | /* loaded with the @FT_LOAD_NO_RECURSE flag. */ |
---|
1526 | /* For now this is internal to FreeType. */ |
---|
1527 | /* */ |
---|
1528 | /* subglyphs :: An array of subglyph descriptors for */ |
---|
1529 | /* composite glyphs. There are `num_subglyphs' */ |
---|
1530 | /* elements in there. Currently internal to */ |
---|
1531 | /* FreeType. */ |
---|
1532 | /* */ |
---|
1533 | /* control_data :: Certain font drivers can also return the */ |
---|
1534 | /* control data for a given glyph image (e.g. */ |
---|
1535 | /* TrueType bytecode, Type~1 charstrings, etc.). */ |
---|
1536 | /* This field is a pointer to such data. */ |
---|
1537 | /* */ |
---|
1538 | /* control_len :: This is the length in bytes of the control */ |
---|
1539 | /* data. */ |
---|
1540 | /* */ |
---|
1541 | /* other :: Really wicked formats can use this pointer to */ |
---|
1542 | /* present their own glyph image to client */ |
---|
1543 | /* applications. Note that the application */ |
---|
1544 | /* needs to know about the image format. */ |
---|
1545 | /* */ |
---|
1546 | /* lsb_delta :: The difference between hinted and unhinted */ |
---|
1547 | /* left side bearing while autohinting is */ |
---|
1548 | /* active. Zero otherwise. */ |
---|
1549 | /* */ |
---|
1550 | /* rsb_delta :: The difference between hinted and unhinted */ |
---|
1551 | /* right side bearing while autohinting is */ |
---|
1552 | /* active. Zero otherwise. */ |
---|
1553 | /* */ |
---|
1554 | /* <Note> */ |
---|
1555 | /* If @FT_Load_Glyph is called with default flags (see */ |
---|
1556 | /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ |
---|
1557 | /* its native format (e.g., an outline glyph for TrueType and Type~1 */ |
---|
1558 | /* formats). */ |
---|
1559 | /* */ |
---|
1560 | /* This image can later be converted into a bitmap by calling */ |
---|
1561 | /* @FT_Render_Glyph. This function finds the current renderer for */ |
---|
1562 | /* the native image's format, then invokes it. */ |
---|
1563 | /* */ |
---|
1564 | /* The renderer is in charge of transforming the native image through */ |
---|
1565 | /* the slot's face transformation fields, then converting it into a */ |
---|
1566 | /* bitmap that is returned in `slot->bitmap'. */ |
---|
1567 | /* */ |
---|
1568 | /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */ |
---|
1569 | /* to specify the position of the bitmap relative to the current pen */ |
---|
1570 | /* position (e.g., coordinates (0,0) on the baseline). Of course, */ |
---|
1571 | /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */ |
---|
1572 | /* */ |
---|
1573 | /* <Note> */ |
---|
1574 | /* Here a small pseudo code fragment which shows how to use */ |
---|
1575 | /* `lsb_delta' and `rsb_delta': */ |
---|
1576 | /* */ |
---|
1577 | /* { */ |
---|
1578 | /* FT_Pos origin_x = 0; */ |
---|
1579 | /* FT_Pos prev_rsb_delta = 0; */ |
---|
1580 | /* */ |
---|
1581 | /* */ |
---|
1582 | /* for all glyphs do */ |
---|
1583 | /* <compute kern between current and previous glyph and add it to */ |
---|
1584 | /* `origin_x'> */ |
---|
1585 | /* */ |
---|
1586 | /* <load glyph with `FT_Load_Glyph'> */ |
---|
1587 | /* */ |
---|
1588 | /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */ |
---|
1589 | /* origin_x -= 64; */ |
---|
1590 | /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */ |
---|
1591 | /* origin_x += 64; */ |
---|
1592 | /* */ |
---|
1593 | /* prev_rsb_delta = face->glyph->rsb_delta; */ |
---|
1594 | /* */ |
---|
1595 | /* <save glyph image, or render glyph, or ...> */ |
---|
1596 | /* */ |
---|
1597 | /* origin_x += face->glyph->advance.x; */ |
---|
1598 | /* endfor */ |
---|
1599 | /* } */ |
---|
1600 | /* */ |
---|
1601 | typedef struct FT_GlyphSlotRec_ |
---|
1602 | { |
---|
1603 | FT_Library library; |
---|
1604 | FT_Face face; |
---|
1605 | FT_GlyphSlot next; |
---|
1606 | FT_UInt reserved; /* retained for binary compatibility */ |
---|
1607 | FT_Generic generic; |
---|
1608 | |
---|
1609 | FT_Glyph_Metrics metrics; |
---|
1610 | FT_Fixed linearHoriAdvance; |
---|
1611 | FT_Fixed linearVertAdvance; |
---|
1612 | FT_Vector advance; |
---|
1613 | |
---|
1614 | FT_Glyph_Format format; |
---|
1615 | |
---|
1616 | FT_Bitmap bitmap; |
---|
1617 | FT_Int bitmap_left; |
---|
1618 | FT_Int bitmap_top; |
---|
1619 | |
---|
1620 | FT_Outline outline; |
---|
1621 | |
---|
1622 | FT_UInt num_subglyphs; |
---|
1623 | FT_SubGlyph subglyphs; |
---|
1624 | |
---|
1625 | void* control_data; |
---|
1626 | long control_len; |
---|
1627 | |
---|
1628 | FT_Pos lsb_delta; |
---|
1629 | FT_Pos rsb_delta; |
---|
1630 | |
---|
1631 | void* other; |
---|
1632 | |
---|
1633 | FT_Slot_Internal internal; |
---|
1634 | |
---|
1635 | } FT_GlyphSlotRec; |
---|
1636 | |
---|
1637 | |
---|
1638 | /*************************************************************************/ |
---|
1639 | /*************************************************************************/ |
---|
1640 | /* */ |
---|
1641 | /* F U N C T I O N S */ |
---|
1642 | /* */ |
---|
1643 | /*************************************************************************/ |
---|
1644 | /*************************************************************************/ |
---|
1645 | |
---|
1646 | |
---|
1647 | /*************************************************************************/ |
---|
1648 | /* */ |
---|
1649 | /* <Function> */ |
---|
1650 | /* FT_Init_FreeType */ |
---|
1651 | /* */ |
---|
1652 | /* <Description> */ |
---|
1653 | /* Initialize a new FreeType library object. The set of modules */ |
---|
1654 | /* that are registered by this function is determined at build time. */ |
---|
1655 | /* */ |
---|
1656 | /* <Output> */ |
---|
1657 | /* alibrary :: A handle to a new library object. */ |
---|
1658 | /* */ |
---|
1659 | /* <Return> */ |
---|
1660 | /* FreeType error code. 0~means success. */ |
---|
1661 | /* */ |
---|
1662 | FT_EXPORT( FT_Error ) |
---|
1663 | FT_Init_FreeType( FT_Library *alibrary ); |
---|
1664 | |
---|
1665 | |
---|
1666 | /*************************************************************************/ |
---|
1667 | /* */ |
---|
1668 | /* <Function> */ |
---|
1669 | /* FT_Done_FreeType */ |
---|
1670 | /* */ |
---|
1671 | /* <Description> */ |
---|
1672 | /* Destroy a given FreeType library object and all of its children, */ |
---|
1673 | /* including resources, drivers, faces, sizes, etc. */ |
---|
1674 | /* */ |
---|
1675 | /* <Input> */ |
---|
1676 | /* library :: A handle to the target library object. */ |
---|
1677 | /* */ |
---|
1678 | /* <Return> */ |
---|
1679 | /* FreeType error code. 0~means success. */ |
---|
1680 | /* */ |
---|
1681 | FT_EXPORT( FT_Error ) |
---|
1682 | FT_Done_FreeType( FT_Library library ); |
---|
1683 | |
---|
1684 | |
---|
1685 | /*************************************************************************/ |
---|
1686 | /* */ |
---|
1687 | /* <Enum> */ |
---|
1688 | /* FT_OPEN_XXX */ |
---|
1689 | /* */ |
---|
1690 | /* <Description> */ |
---|
1691 | /* A list of bit-field constants used within the `flags' field of the */ |
---|
1692 | /* @FT_Open_Args structure. */ |
---|
1693 | /* */ |
---|
1694 | /* <Values> */ |
---|
1695 | /* FT_OPEN_MEMORY :: This is a memory-based stream. */ |
---|
1696 | /* */ |
---|
1697 | /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ |
---|
1698 | /* */ |
---|
1699 | /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ |
---|
1700 | /* name. */ |
---|
1701 | /* */ |
---|
1702 | /* FT_OPEN_DRIVER :: Use the `driver' field. */ |
---|
1703 | /* */ |
---|
1704 | /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ |
---|
1705 | /* */ |
---|
1706 | /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ |
---|
1707 | /* */ |
---|
1708 | /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ |
---|
1709 | /* */ |
---|
1710 | /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ |
---|
1711 | /* */ |
---|
1712 | /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ |
---|
1713 | /* */ |
---|
1714 | /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ |
---|
1715 | /* */ |
---|
1716 | /* <Note> */ |
---|
1717 | /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ |
---|
1718 | /* flags are mutually exclusive. */ |
---|
1719 | /* */ |
---|
1720 | #define FT_OPEN_MEMORY 0x1 |
---|
1721 | #define FT_OPEN_STREAM 0x2 |
---|
1722 | #define FT_OPEN_PATHNAME 0x4 |
---|
1723 | #define FT_OPEN_DRIVER 0x8 |
---|
1724 | #define FT_OPEN_PARAMS 0x10 |
---|
1725 | |
---|
1726 | #define ft_open_memory FT_OPEN_MEMORY /* deprecated */ |
---|
1727 | #define ft_open_stream FT_OPEN_STREAM /* deprecated */ |
---|
1728 | #define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */ |
---|
1729 | #define ft_open_driver FT_OPEN_DRIVER /* deprecated */ |
---|
1730 | #define ft_open_params FT_OPEN_PARAMS /* deprecated */ |
---|
1731 | |
---|
1732 | |
---|
1733 | /*************************************************************************/ |
---|
1734 | /* */ |
---|
1735 | /* <Struct> */ |
---|
1736 | /* FT_Parameter */ |
---|
1737 | /* */ |
---|
1738 | /* <Description> */ |
---|
1739 | /* A simple structure used to pass more or less generic parameters */ |
---|
1740 | /* to @FT_Open_Face. */ |
---|
1741 | /* */ |
---|
1742 | /* <Fields> */ |
---|
1743 | /* tag :: A four-byte identification tag. */ |
---|
1744 | /* */ |
---|
1745 | /* data :: A pointer to the parameter data. */ |
---|
1746 | /* */ |
---|
1747 | /* <Note> */ |
---|
1748 | /* The ID and function of parameters are driver-specific. */ |
---|
1749 | /* */ |
---|
1750 | typedef struct FT_Parameter_ |
---|
1751 | { |
---|
1752 | FT_ULong tag; |
---|
1753 | FT_Pointer data; |
---|
1754 | |
---|
1755 | } FT_Parameter; |
---|
1756 | |
---|
1757 | |
---|
1758 | /*************************************************************************/ |
---|
1759 | /* */ |
---|
1760 | /* <Struct> */ |
---|
1761 | /* FT_Open_Args */ |
---|
1762 | /* */ |
---|
1763 | /* <Description> */ |
---|
1764 | /* A structure used to indicate how to open a new font file or */ |
---|
1765 | /* stream. A pointer to such a structure can be used as a parameter */ |
---|
1766 | /* for the functions @FT_Open_Face and @FT_Attach_Stream. */ |
---|
1767 | /* */ |
---|
1768 | /* <Fields> */ |
---|
1769 | /* flags :: A set of bit flags indicating how to use the */ |
---|
1770 | /* structure. */ |
---|
1771 | /* */ |
---|
1772 | /* memory_base :: The first byte of the file in memory. */ |
---|
1773 | /* */ |
---|
1774 | /* memory_size :: The size in bytes of the file in memory. */ |
---|
1775 | /* */ |
---|
1776 | /* pathname :: A pointer to an 8-bit file pathname. */ |
---|
1777 | /* */ |
---|
1778 | /* stream :: A handle to a source stream object. */ |
---|
1779 | /* */ |
---|
1780 | /* driver :: This field is exclusively used by @FT_Open_Face; */ |
---|
1781 | /* it simply specifies the font driver to use to open */ |
---|
1782 | /* the face. If set to~0, FreeType tries to load the */ |
---|
1783 | /* face with each one of the drivers in its list. */ |
---|
1784 | /* */ |
---|
1785 | /* num_params :: The number of extra parameters. */ |
---|
1786 | /* */ |
---|
1787 | /* params :: Extra parameters passed to the font driver when */ |
---|
1788 | /* opening a new face. */ |
---|
1789 | /* */ |
---|
1790 | /* <Note> */ |
---|
1791 | /* The stream type is determined by the contents of `flags' which */ |
---|
1792 | /* are tested in the following order by @FT_Open_Face: */ |
---|
1793 | /* */ |
---|
1794 | /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ |
---|
1795 | /* memory file of `memory_size' bytes, located at `memory_address'. */ |
---|
1796 | /* The data are are not copied, and the client is responsible for */ |
---|
1797 | /* releasing and destroying them _after_ the corresponding call to */ |
---|
1798 | /* @FT_Done_Face. */ |
---|
1799 | /* */ |
---|
1800 | /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */ |
---|
1801 | /* custom input stream `stream' is used. */ |
---|
1802 | /* */ |
---|
1803 | /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */ |
---|
1804 | /* is a normal file and use `pathname' to open it. */ |
---|
1805 | /* */ |
---|
1806 | /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */ |
---|
1807 | /* open the file with the driver whose handler is in `driver'. */ |
---|
1808 | /* */ |
---|
1809 | /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */ |
---|
1810 | /* `num_params' and `params' is used. They are ignored otherwise. */ |
---|
1811 | /* */ |
---|
1812 | /* Ideally, both the `pathname' and `params' fields should be tagged */ |
---|
1813 | /* as `const'; this is missing for API backwards compatibility. In */ |
---|
1814 | /* other words, applications should treat them as read-only. */ |
---|
1815 | /* */ |
---|
1816 | typedef struct FT_Open_Args_ |
---|
1817 | { |
---|
1818 | FT_UInt flags; |
---|
1819 | const FT_Byte* memory_base; |
---|
1820 | FT_Long memory_size; |
---|
1821 | FT_String* pathname; |
---|
1822 | FT_Stream stream; |
---|
1823 | FT_Module driver; |
---|
1824 | FT_Int num_params; |
---|
1825 | FT_Parameter* params; |
---|
1826 | |
---|
1827 | } FT_Open_Args; |
---|
1828 | |
---|
1829 | |
---|
1830 | /*************************************************************************/ |
---|
1831 | /* */ |
---|
1832 | /* <Function> */ |
---|
1833 | /* FT_New_Face */ |
---|
1834 | /* */ |
---|
1835 | /* <Description> */ |
---|
1836 | /* This function calls @FT_Open_Face to open a font by its pathname. */ |
---|
1837 | /* */ |
---|
1838 | /* <InOut> */ |
---|
1839 | /* library :: A handle to the library resource. */ |
---|
1840 | /* */ |
---|
1841 | /* <Input> */ |
---|
1842 | /* pathname :: A path to the font file. */ |
---|
1843 | /* */ |
---|
1844 | /* face_index :: The index of the face within the font. The first */ |
---|
1845 | /* face has index~0. */ |
---|
1846 | /* */ |
---|
1847 | /* <Output> */ |
---|
1848 | /* aface :: A handle to a new face object. If `face_index' is */ |
---|
1849 | /* greater than or equal to zero, it must be non-NULL. */ |
---|
1850 | /* See @FT_Open_Face for more details. */ |
---|
1851 | /* */ |
---|
1852 | /* <Return> */ |
---|
1853 | /* FreeType error code. 0~means success. */ |
---|
1854 | /* */ |
---|
1855 | FT_EXPORT( FT_Error ) |
---|
1856 | FT_New_Face( FT_Library library, |
---|
1857 | const char* filepathname, |
---|
1858 | FT_Long face_index, |
---|
1859 | FT_Face *aface ); |
---|
1860 | |
---|
1861 | |
---|
1862 | /*************************************************************************/ |
---|
1863 | /* */ |
---|
1864 | /* <Function> */ |
---|
1865 | /* FT_New_Memory_Face */ |
---|
1866 | /* */ |
---|
1867 | /* <Description> */ |
---|
1868 | /* This function calls @FT_Open_Face to open a font which has been */ |
---|
1869 | /* loaded into memory. */ |
---|
1870 | /* */ |
---|
1871 | /* <InOut> */ |
---|
1872 | /* library :: A handle to the library resource. */ |
---|
1873 | /* */ |
---|
1874 | /* <Input> */ |
---|
1875 | /* file_base :: A pointer to the beginning of the font data. */ |
---|
1876 | /* */ |
---|
1877 | /* file_size :: The size of the memory chunk used by the font data. */ |
---|
1878 | /* */ |
---|
1879 | /* face_index :: The index of the face within the font. The first */ |
---|
1880 | /* face has index~0. */ |
---|
1881 | /* */ |
---|
1882 | /* <Output> */ |
---|
1883 | /* aface :: A handle to a new face object. If `face_index' is */ |
---|
1884 | /* greater than or equal to zero, it must be non-NULL. */ |
---|
1885 | /* See @FT_Open_Face for more details. */ |
---|
1886 | /* */ |
---|
1887 | /* <Return> */ |
---|
1888 | /* FreeType error code. 0~means success. */ |
---|
1889 | /* */ |
---|
1890 | /* <Note> */ |
---|
1891 | /* You must not deallocate the memory before calling @FT_Done_Face. */ |
---|
1892 | /* */ |
---|
1893 | FT_EXPORT( FT_Error ) |
---|
1894 | FT_New_Memory_Face( FT_Library library, |
---|
1895 | const FT_Byte* file_base, |
---|
1896 | FT_Long file_size, |
---|
1897 | FT_Long face_index, |
---|
1898 | FT_Face *aface ); |
---|
1899 | |
---|
1900 | |
---|
1901 | /*************************************************************************/ |
---|
1902 | /* */ |
---|
1903 | /* <Function> */ |
---|
1904 | /* FT_Open_Face */ |
---|
1905 | /* */ |
---|
1906 | /* <Description> */ |
---|
1907 | /* Create a face object from a given resource described by */ |
---|
1908 | /* @FT_Open_Args. */ |
---|
1909 | /* */ |
---|
1910 | /* <InOut> */ |
---|
1911 | /* library :: A handle to the library resource. */ |
---|
1912 | /* */ |
---|
1913 | /* <Input> */ |
---|
1914 | /* args :: A pointer to an `FT_Open_Args' structure which must */ |
---|
1915 | /* be filled by the caller. */ |
---|
1916 | /* */ |
---|
1917 | /* face_index :: The index of the face within the font. The first */ |
---|
1918 | /* face has index~0. */ |
---|
1919 | /* */ |
---|
1920 | /* <Output> */ |
---|
1921 | /* aface :: A handle to a new face object. If `face_index' is */ |
---|
1922 | /* greater than or equal to zero, it must be non-NULL. */ |
---|
1923 | /* See note below. */ |
---|
1924 | /* */ |
---|
1925 | /* <Return> */ |
---|
1926 | /* FreeType error code. 0~means success. */ |
---|
1927 | /* */ |
---|
1928 | /* <Note> */ |
---|
1929 | /* Unlike FreeType 1.x, this function automatically creates a glyph */ |
---|
1930 | /* slot for the face object which can be accessed directly through */ |
---|
1931 | /* `face->glyph'. */ |
---|
1932 | /* */ |
---|
1933 | /* FT_Open_Face can be used to quickly check whether the font */ |
---|
1934 | /* format of a given font resource is supported by FreeType. If the */ |
---|
1935 | /* `face_index' field is negative, the function's return value is~0 */ |
---|
1936 | /* if the font format is recognized, or non-zero otherwise; */ |
---|
1937 | /* the function returns a more or less empty face handle in `*aface' */ |
---|
1938 | /* (if `aface' isn't NULL). The only useful field in this special */ |
---|
1939 | /* case is `face->num_faces' which gives the number of faces within */ |
---|
1940 | /* the font file. After examination, the returned @FT_Face structure */ |
---|
1941 | /* should be deallocated with a call to @FT_Done_Face. */ |
---|
1942 | /* */ |
---|
1943 | /* Each new face object created with this function also owns a */ |
---|
1944 | /* default @FT_Size object, accessible as `face->size'. */ |
---|
1945 | /* */ |
---|
1946 | FT_EXPORT( FT_Error ) |
---|
1947 | FT_Open_Face( FT_Library library, |
---|
1948 | const FT_Open_Args* args, |
---|
1949 | FT_Long face_index, |
---|
1950 | FT_Face *aface ); |
---|
1951 | |
---|
1952 | |
---|
1953 | /*************************************************************************/ |
---|
1954 | /* */ |
---|
1955 | /* <Function> */ |
---|
1956 | /* FT_Attach_File */ |
---|
1957 | /* */ |
---|
1958 | /* <Description> */ |
---|
1959 | /* This function calls @FT_Attach_Stream to attach a file. */ |
---|
1960 | /* */ |
---|
1961 | /* <InOut> */ |
---|
1962 | /* face :: The target face object. */ |
---|
1963 | /* */ |
---|
1964 | /* <Input> */ |
---|
1965 | /* filepathname :: The pathname. */ |
---|
1966 | /* */ |
---|
1967 | /* <Return> */ |
---|
1968 | /* FreeType error code. 0~means success. */ |
---|
1969 | /* */ |
---|
1970 | FT_EXPORT( FT_Error ) |
---|
1971 | FT_Attach_File( FT_Face face, |
---|
1972 | const char* filepathname ); |
---|
1973 | |
---|
1974 | |
---|
1975 | /*************************************************************************/ |
---|
1976 | /* */ |
---|
1977 | /* <Function> */ |
---|
1978 | /* FT_Attach_Stream */ |
---|
1979 | /* */ |
---|
1980 | /* <Description> */ |
---|
1981 | /* `Attach' data to a face object. Normally, this is used to read */ |
---|
1982 | /* additional information for the face object. For example, you can */ |
---|
1983 | /* attach an AFM file that comes with a Type~1 font to get the */ |
---|
1984 | /* kerning values and other metrics. */ |
---|
1985 | /* */ |
---|
1986 | /* <InOut> */ |
---|
1987 | /* face :: The target face object. */ |
---|
1988 | /* */ |
---|
1989 | /* <Input> */ |
---|
1990 | /* parameters :: A pointer to @FT_Open_Args which must be filled by */ |
---|
1991 | /* the caller. */ |
---|
1992 | /* */ |
---|
1993 | /* <Return> */ |
---|
1994 | /* FreeType error code. 0~means success. */ |
---|
1995 | /* */ |
---|
1996 | /* <Note> */ |
---|
1997 | /* The meaning of the `attach' (i.e., what really happens when the */ |
---|
1998 | /* new file is read) is not fixed by FreeType itself. It really */ |
---|
1999 | /* depends on the font format (and thus the font driver). */ |
---|
2000 | /* */ |
---|
2001 | /* Client applications are expected to know what they are doing */ |
---|
2002 | /* when invoking this function. Most drivers simply do not implement */ |
---|
2003 | /* file attachments. */ |
---|
2004 | /* */ |
---|
2005 | FT_EXPORT( FT_Error ) |
---|
2006 | FT_Attach_Stream( FT_Face face, |
---|
2007 | FT_Open_Args* parameters ); |
---|
2008 | |
---|
2009 | |
---|
2010 | /*************************************************************************/ |
---|
2011 | /* */ |
---|
2012 | /* <Function> */ |
---|
2013 | /* FT_Done_Face */ |
---|
2014 | /* */ |
---|
2015 | /* <Description> */ |
---|
2016 | /* Discard a given face object, as well as all of its child slots and */ |
---|
2017 | /* sizes. */ |
---|
2018 | /* */ |
---|
2019 | /* <Input> */ |
---|
2020 | /* face :: A handle to a target face object. */ |
---|
2021 | /* */ |
---|
2022 | /* <Return> */ |
---|
2023 | /* FreeType error code. 0~means success. */ |
---|
2024 | /* */ |
---|
2025 | FT_EXPORT( FT_Error ) |
---|
2026 | FT_Done_Face( FT_Face face ); |
---|
2027 | |
---|
2028 | |
---|
2029 | /*************************************************************************/ |
---|
2030 | /* */ |
---|
2031 | /* <Function> */ |
---|
2032 | /* FT_Select_Size */ |
---|
2033 | /* */ |
---|
2034 | /* <Description> */ |
---|
2035 | /* Select a bitmap strike. */ |
---|
2036 | /* */ |
---|
2037 | /* <InOut> */ |
---|
2038 | /* face :: A handle to a target face object. */ |
---|
2039 | /* */ |
---|
2040 | /* <Input> */ |
---|
2041 | /* strike_index :: The index of the bitmap strike in the */ |
---|
2042 | /* `available_sizes' field of @FT_FaceRec structure. */ |
---|
2043 | /* */ |
---|
2044 | /* <Return> */ |
---|
2045 | /* FreeType error code. 0~means success. */ |
---|
2046 | /* */ |
---|
2047 | FT_EXPORT( FT_Error ) |
---|
2048 | FT_Select_Size( FT_Face face, |
---|
2049 | FT_Int strike_index ); |
---|
2050 | |
---|
2051 | |
---|
2052 | /*************************************************************************/ |
---|
2053 | /* */ |
---|
2054 | /* <Enum> */ |
---|
2055 | /* FT_Size_Request_Type */ |
---|
2056 | /* */ |
---|
2057 | /* <Description> */ |
---|
2058 | /* An enumeration type that lists the supported size request types. */ |
---|
2059 | /* */ |
---|
2060 | /* <Values> */ |
---|
2061 | /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */ |
---|
2062 | /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */ |
---|
2063 | /* used to determine both scaling values. */ |
---|
2064 | /* */ |
---|
2065 | /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */ |
---|
2066 | /* The real dimension. The sum of the the `Ascender' and (minus */ |
---|
2067 | /* of) the `Descender' fields of @FT_FaceRec are used to determine */ |
---|
2068 | /* both scaling values. */ |
---|
2069 | /* */ |
---|
2070 | /* FT_SIZE_REQUEST_TYPE_BBOX :: */ |
---|
2071 | /* The font bounding box. The width and height of the `bbox' field */ |
---|
2072 | /* of @FT_FaceRec are used to determine the horizontal and vertical */ |
---|
2073 | /* scaling value, respectively. */ |
---|
2074 | /* */ |
---|
2075 | /* FT_SIZE_REQUEST_TYPE_CELL :: */ |
---|
2076 | /* The `max_advance_width' field of @FT_FaceRec is used to */ |
---|
2077 | /* determine the horizontal scaling value; the vertical scaling */ |
---|
2078 | /* value is determined the same way as */ |
---|
2079 | /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */ |
---|
2080 | /* values are set to the smaller one. This type is useful if you */ |
---|
2081 | /* want to specify the font size for, say, a window of a given */ |
---|
2082 | /* dimension and 80x24 cells. */ |
---|
2083 | /* */ |
---|
2084 | /* FT_SIZE_REQUEST_TYPE_SCALES :: */ |
---|
2085 | /* Specify the scaling values directly. */ |
---|
2086 | /* */ |
---|
2087 | /* <Note> */ |
---|
2088 | /* The above descriptions only apply to scalable formats. For bitmap */ |
---|
2089 | /* formats, the behaviour is up to the driver. */ |
---|
2090 | /* */ |
---|
2091 | /* See the note section of @FT_Size_Metrics if you wonder how size */ |
---|
2092 | /* requesting relates to scaling values. */ |
---|
2093 | /* */ |
---|
2094 | typedef enum FT_Size_Request_Type_ |
---|
2095 | { |
---|
2096 | FT_SIZE_REQUEST_TYPE_NOMINAL, |
---|
2097 | FT_SIZE_REQUEST_TYPE_REAL_DIM, |
---|
2098 | FT_SIZE_REQUEST_TYPE_BBOX, |
---|
2099 | FT_SIZE_REQUEST_TYPE_CELL, |
---|
2100 | FT_SIZE_REQUEST_TYPE_SCALES, |
---|
2101 | |
---|
2102 | FT_SIZE_REQUEST_TYPE_MAX |
---|
2103 | |
---|
2104 | } FT_Size_Request_Type; |
---|
2105 | |
---|
2106 | |
---|
2107 | /*************************************************************************/ |
---|
2108 | /* */ |
---|
2109 | /* <Struct> */ |
---|
2110 | /* FT_Size_RequestRec */ |
---|
2111 | /* */ |
---|
2112 | /* <Description> */ |
---|
2113 | /* A structure used to model a size request. */ |
---|
2114 | /* */ |
---|
2115 | /* <Fields> */ |
---|
2116 | /* type :: See @FT_Size_Request_Type. */ |
---|
2117 | /* */ |
---|
2118 | /* width :: The desired width. */ |
---|
2119 | /* */ |
---|
2120 | /* height :: The desired height. */ |
---|
2121 | /* */ |
---|
2122 | /* horiResolution :: The horizontal resolution. If set to zero, */ |
---|
2123 | /* `width' is treated as a 26.6 fractional pixel */ |
---|
2124 | /* value. */ |
---|
2125 | /* */ |
---|
2126 | /* vertResolution :: The vertical resolution. If set to zero, */ |
---|
2127 | /* `height' is treated as a 26.6 fractional pixel */ |
---|
2128 | /* value. */ |
---|
2129 | /* */ |
---|
2130 | /* <Note> */ |
---|
2131 | /* If `width' is zero, then the horizontal scaling value is set */ |
---|
2132 | /* equal to the vertical scaling value, and vice versa. */ |
---|
2133 | /* */ |
---|
2134 | typedef struct FT_Size_RequestRec_ |
---|
2135 | { |
---|
2136 | FT_Size_Request_Type type; |
---|
2137 | FT_Long width; |
---|
2138 | FT_Long height; |
---|
2139 | FT_UInt horiResolution; |
---|
2140 | FT_UInt vertResolution; |
---|
2141 | |
---|
2142 | } FT_Size_RequestRec; |
---|
2143 | |
---|
2144 | |
---|
2145 | /*************************************************************************/ |
---|
2146 | /* */ |
---|
2147 | /* <Struct> */ |
---|
2148 | /* FT_Size_Request */ |
---|
2149 | /* */ |
---|
2150 | /* <Description> */ |
---|
2151 | /* A handle to a size request structure. */ |
---|
2152 | /* */ |
---|
2153 | typedef struct FT_Size_RequestRec_ *FT_Size_Request; |
---|
2154 | |
---|
2155 | |
---|
2156 | /*************************************************************************/ |
---|
2157 | /* */ |
---|
2158 | /* <Function> */ |
---|
2159 | /* FT_Request_Size */ |
---|
2160 | /* */ |
---|
2161 | /* <Description> */ |
---|
2162 | /* Resize the scale of the active @FT_Size object in a face. */ |
---|
2163 | /* */ |
---|
2164 | /* <InOut> */ |
---|
2165 | /* face :: A handle to a target face object. */ |
---|
2166 | /* */ |
---|
2167 | /* <Input> */ |
---|
2168 | /* req :: A pointer to a @FT_Size_RequestRec. */ |
---|
2169 | /* */ |
---|
2170 | /* <Return> */ |
---|
2171 | /* FreeType error code. 0~means success. */ |
---|
2172 | /* */ |
---|
2173 | /* <Note> */ |
---|
2174 | /* Although drivers may select the bitmap strike matching the */ |
---|
2175 | /* request, you should not rely on this if you intend to select a */ |
---|
2176 | /* particular bitmap strike. Use @FT_Select_Size instead in that */ |
---|
2177 | /* case. */ |
---|
2178 | /* */ |
---|
2179 | FT_EXPORT( FT_Error ) |
---|
2180 | FT_Request_Size( FT_Face face, |
---|
2181 | FT_Size_Request req ); |
---|
2182 | |
---|
2183 | |
---|
2184 | /*************************************************************************/ |
---|
2185 | /* */ |
---|
2186 | /* <Function> */ |
---|
2187 | /* FT_Set_Char_Size */ |
---|
2188 | /* */ |
---|
2189 | /* <Description> */ |
---|
2190 | /* This function calls @FT_Request_Size to request the nominal size */ |
---|
2191 | /* (in points). */ |
---|
2192 | /* */ |
---|
2193 | /* <InOut> */ |
---|
2194 | /* face :: A handle to a target face object. */ |
---|
2195 | /* */ |
---|
2196 | /* <Input> */ |
---|
2197 | /* char_width :: The nominal width, in 26.6 fractional points. */ |
---|
2198 | /* */ |
---|
2199 | /* char_height :: The nominal height, in 26.6 fractional points. */ |
---|
2200 | /* */ |
---|
2201 | /* horz_resolution :: The horizontal resolution in dpi. */ |
---|
2202 | /* */ |
---|
2203 | /* vert_resolution :: The vertical resolution in dpi. */ |
---|
2204 | /* */ |
---|
2205 | /* <Return> */ |
---|
2206 | /* FreeType error code. 0~means success. */ |
---|
2207 | /* */ |
---|
2208 | /* <Note> */ |
---|
2209 | /* If either the character width or height is zero, it is set equal */ |
---|
2210 | /* to the other value. */ |
---|
2211 | /* */ |
---|
2212 | /* If either the horizontal or vertical resolution is zero, it is set */ |
---|
2213 | /* equal to the other value. */ |
---|
2214 | /* */ |
---|
2215 | /* A character width or height smaller than 1pt is set to 1pt; if */ |
---|
2216 | /* both resolution values are zero, they are set to 72dpi. */ |
---|
2217 | /* */ |
---|
2218 | /* Don't use this function if you are using the FreeType cache API. */ |
---|
2219 | /* */ |
---|
2220 | FT_EXPORT( FT_Error ) |
---|
2221 | FT_Set_Char_Size( FT_Face face, |
---|
2222 | FT_F26Dot6 char_width, |
---|
2223 | FT_F26Dot6 char_height, |
---|
2224 | FT_UInt horz_resolution, |
---|
2225 | FT_UInt vert_resolution ); |
---|
2226 | |
---|
2227 | |
---|
2228 | /*************************************************************************/ |
---|
2229 | /* */ |
---|
2230 | /* <Function> */ |
---|
2231 | /* FT_Set_Pixel_Sizes */ |
---|
2232 | /* */ |
---|
2233 | /* <Description> */ |
---|
2234 | /* This function calls @FT_Request_Size to request the nominal size */ |
---|
2235 | /* (in pixels). */ |
---|
2236 | /* */ |
---|
2237 | /* <InOut> */ |
---|
2238 | /* face :: A handle to the target face object. */ |
---|
2239 | /* */ |
---|
2240 | /* <Input> */ |
---|
2241 | /* pixel_width :: The nominal width, in pixels. */ |
---|
2242 | /* */ |
---|
2243 | /* pixel_height :: The nominal height, in pixels. */ |
---|
2244 | /* */ |
---|
2245 | /* <Return> */ |
---|
2246 | /* FreeType error code. 0~means success. */ |
---|
2247 | /* */ |
---|
2248 | FT_EXPORT( FT_Error ) |
---|
2249 | FT_Set_Pixel_Sizes( FT_Face face, |
---|
2250 | FT_UInt pixel_width, |
---|
2251 | FT_UInt pixel_height ); |
---|
2252 | |
---|
2253 | |
---|
2254 | /*************************************************************************/ |
---|
2255 | /* */ |
---|
2256 | /* <Function> */ |
---|
2257 | /* FT_Load_Glyph */ |
---|
2258 | /* */ |
---|
2259 | /* <Description> */ |
---|
2260 | /* A function used to load a single glyph into the glyph slot of a */ |
---|
2261 | /* face object. */ |
---|
2262 | /* */ |
---|
2263 | /* <InOut> */ |
---|
2264 | /* face :: A handle to the target face object where the glyph */ |
---|
2265 | /* is loaded. */ |
---|
2266 | /* */ |
---|
2267 | /* <Input> */ |
---|
2268 | /* glyph_index :: The index of the glyph in the font file. For */ |
---|
2269 | /* CID-keyed fonts (either in PS or in CFF format) */ |
---|
2270 | /* this argument specifies the CID value. */ |
---|
2271 | /* */ |
---|
2272 | /* load_flags :: A flag indicating what to load for this glyph. The */ |
---|
2273 | /* @FT_LOAD_XXX constants can be used to control the */ |
---|
2274 | /* glyph loading process (e.g., whether the outline */ |
---|
2275 | /* should be scaled, whether to load bitmaps or not, */ |
---|
2276 | /* whether to hint the outline, etc). */ |
---|
2277 | /* */ |
---|
2278 | /* <Return> */ |
---|
2279 | /* FreeType error code. 0~means success. */ |
---|
2280 | /* */ |
---|
2281 | /* <Note> */ |
---|
2282 | /* The loaded glyph may be transformed. See @FT_Set_Transform for */ |
---|
2283 | /* the details. */ |
---|
2284 | /* */ |
---|
2285 | /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */ |
---|
2286 | /* returned for invalid CID values (this is, for CID values which */ |
---|
2287 | /* don't have a corresponding glyph in the font). See the discussion */ |
---|
2288 | /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */ |
---|
2289 | /* */ |
---|
2290 | FT_EXPORT( FT_Error ) |
---|
2291 | FT_Load_Glyph( FT_Face face, |
---|
2292 | FT_UInt glyph_index, |
---|
2293 | FT_Int32 load_flags ); |
---|
2294 | |
---|
2295 | |
---|
2296 | /*************************************************************************/ |
---|
2297 | /* */ |
---|
2298 | /* <Function> */ |
---|
2299 | /* FT_Load_Char */ |
---|
2300 | /* */ |
---|
2301 | /* <Description> */ |
---|
2302 | /* A function used to load a single glyph into the glyph slot of a */ |
---|
2303 | /* face object, according to its character code. */ |
---|
2304 | /* */ |
---|
2305 | /* <InOut> */ |
---|
2306 | /* face :: A handle to a target face object where the glyph */ |
---|
2307 | /* is loaded. */ |
---|
2308 | /* */ |
---|
2309 | /* <Input> */ |
---|
2310 | /* char_code :: The glyph's character code, according to the */ |
---|
2311 | /* current charmap used in the face. */ |
---|
2312 | /* */ |
---|
2313 | /* load_flags :: A flag indicating what to load for this glyph. The */ |
---|
2314 | /* @FT_LOAD_XXX constants can be used to control the */ |
---|
2315 | /* glyph loading process (e.g., whether the outline */ |
---|
2316 | /* should be scaled, whether to load bitmaps or not, */ |
---|
2317 | /* whether to hint the outline, etc). */ |
---|
2318 | /* */ |
---|
2319 | /* <Return> */ |
---|
2320 | /* FreeType error code. 0~means success. */ |
---|
2321 | /* */ |
---|
2322 | /* <Note> */ |
---|
2323 | /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */ |
---|
2324 | /* */ |
---|
2325 | FT_EXPORT( FT_Error ) |
---|
2326 | FT_Load_Char( FT_Face face, |
---|
2327 | FT_ULong char_code, |
---|
2328 | FT_Int32 load_flags ); |
---|
2329 | |
---|
2330 | |
---|
2331 | /************************************************************************* |
---|
2332 | * |
---|
2333 | * @enum: |
---|
2334 | * FT_LOAD_XXX |
---|
2335 | * |
---|
2336 | * @description: |
---|
2337 | * A list of bit-field constants used with @FT_Load_Glyph to indicate |
---|
2338 | * what kind of operations to perform during glyph loading. |
---|
2339 | * |
---|
2340 | * @values: |
---|
2341 | * FT_LOAD_DEFAULT :: |
---|
2342 | * Corresponding to~0, this value is used as the default glyph load |
---|
2343 | * operation. In this case, the following happens: |
---|
2344 | * |
---|
2345 | * 1. FreeType looks for a bitmap for the glyph corresponding to the |
---|
2346 | * face's current size. If one is found, the function returns. |
---|
2347 | * The bitmap data can be accessed from the glyph slot (see note |
---|
2348 | * below). |
---|
2349 | * |
---|
2350 | * 2. If no embedded bitmap is searched or found, FreeType looks for a |
---|
2351 | * scalable outline. If one is found, it is loaded from the font |
---|
2352 | * file, scaled to device pixels, then `hinted' to the pixel grid |
---|
2353 | * in order to optimize it. The outline data can be accessed from |
---|
2354 | * the glyph slot (see note below). |
---|
2355 | * |
---|
2356 | * Note that by default, the glyph loader doesn't render outlines into |
---|
2357 | * bitmaps. The following flags are used to modify this default |
---|
2358 | * behaviour to more specific and useful cases. |
---|
2359 | * |
---|
2360 | * FT_LOAD_NO_SCALE :: |
---|
2361 | * Don't scale the outline glyph loaded, but keep it in font units. |
---|
2362 | * |
---|
2363 | * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and |
---|
2364 | * unsets @FT_LOAD_RENDER. |
---|
2365 | * |
---|
2366 | * FT_LOAD_NO_HINTING :: |
---|
2367 | * Disable hinting. This generally generates `blurrier' bitmap glyph |
---|
2368 | * when the glyph is rendered in any of the anti-aliased modes. See |
---|
2369 | * also the note below. |
---|
2370 | * |
---|
2371 | * This flag is implied by @FT_LOAD_NO_SCALE. |
---|
2372 | * |
---|
2373 | * FT_LOAD_RENDER :: |
---|
2374 | * Call @FT_Render_Glyph after the glyph is loaded. By default, the |
---|
2375 | * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be |
---|
2376 | * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME. |
---|
2377 | * |
---|
2378 | * This flag is unset by @FT_LOAD_NO_SCALE. |
---|
2379 | * |
---|
2380 | * FT_LOAD_NO_BITMAP :: |
---|
2381 | * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this |
---|
2382 | * flag. |
---|
2383 | * |
---|
2384 | * @FT_LOAD_NO_SCALE always sets this flag. |
---|
2385 | * |
---|
2386 | * FT_LOAD_VERTICAL_LAYOUT :: |
---|
2387 | * Load the glyph for vertical text layout. _Don't_ use it as it is |
---|
2388 | * problematic currently. |
---|
2389 | * |
---|
2390 | * FT_LOAD_FORCE_AUTOHINT :: |
---|
2391 | * Indicates that the auto-hinter is preferred over the font's native |
---|
2392 | * hinter. See also the note below. |
---|
2393 | * |
---|
2394 | * FT_LOAD_CROP_BITMAP :: |
---|
2395 | * Indicates that the font driver should crop the loaded bitmap glyph |
---|
2396 | * (i.e., remove all space around its black bits). Not all drivers |
---|
2397 | * implement this. |
---|
2398 | * |
---|
2399 | * FT_LOAD_PEDANTIC :: |
---|
2400 | * Indicates that the font driver should perform pedantic verifications |
---|
2401 | * during glyph loading. This is mostly used to detect broken glyphs |
---|
2402 | * in fonts. By default, FreeType tries to handle broken fonts also. |
---|
2403 | * |
---|
2404 | * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: |
---|
2405 | * Indicates that the font driver should ignore the global advance |
---|
2406 | * width defined in the font. By default, that value is used as the |
---|
2407 | * advance width for all glyphs when the face has |
---|
2408 | * @FT_FACE_FLAG_FIXED_WIDTH set. |
---|
2409 | * |
---|
2410 | * This flag exists for historical reasons (to support buggy CJK |
---|
2411 | * fonts). |
---|
2412 | * |
---|
2413 | * FT_LOAD_NO_RECURSE :: |
---|
2414 | * This flag is only used internally. It merely indicates that the |
---|
2415 | * font driver should not load composite glyphs recursively. Instead, |
---|
2416 | * it should set the `num_subglyph' and `subglyphs' values of the |
---|
2417 | * glyph slot accordingly, and set `glyph->format' to |
---|
2418 | * @FT_GLYPH_FORMAT_COMPOSITE. |
---|
2419 | * |
---|
2420 | * The description of sub-glyphs is not available to client |
---|
2421 | * applications for now. |
---|
2422 | * |
---|
2423 | * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM. |
---|
2424 | * |
---|
2425 | * FT_LOAD_IGNORE_TRANSFORM :: |
---|
2426 | * Indicates that the transform matrix set by @FT_Set_Transform should |
---|
2427 | * be ignored. |
---|
2428 | * |
---|
2429 | * FT_LOAD_MONOCHROME :: |
---|
2430 | * This flag is used with @FT_LOAD_RENDER to indicate that you want to |
---|
2431 | * render an outline glyph to a 1-bit monochrome bitmap glyph, with |
---|
2432 | * 8~pixels packed into each byte of the bitmap data. |
---|
2433 | * |
---|
2434 | * Note that this has no effect on the hinting algorithm used. You |
---|
2435 | * should rather use @FT_LOAD_TARGET_MONO so that the |
---|
2436 | * monochrome-optimized hinting algorithm is used. |
---|
2437 | * |
---|
2438 | * FT_LOAD_LINEAR_DESIGN :: |
---|
2439 | * Indicates that the `linearHoriAdvance' and `linearVertAdvance' |
---|
2440 | * fields of @FT_GlyphSlotRec should be kept in font units. See |
---|
2441 | * @FT_GlyphSlotRec for details. |
---|
2442 | * |
---|
2443 | * FT_LOAD_NO_AUTOHINT :: |
---|
2444 | * Disable auto-hinter. See also the note below. |
---|
2445 | * |
---|
2446 | * @note: |
---|
2447 | * By default, hinting is enabled and the font's native hinter (see |
---|
2448 | * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can |
---|
2449 | * disable hinting by setting @FT_LOAD_NO_HINTING or change the |
---|
2450 | * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set |
---|
2451 | * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be |
---|
2452 | * used at all. |
---|
2453 | * |
---|
2454 | * See the description of @FT_FACE_FLAG_TRICKY for a special exception |
---|
2455 | * (affecting only a handful of Asian fonts). |
---|
2456 | * |
---|
2457 | * Besides deciding which hinter to use, you can also decide which |
---|
2458 | * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. |
---|
2459 | */ |
---|
2460 | #define FT_LOAD_DEFAULT 0x0 |
---|
2461 | #define FT_LOAD_NO_SCALE 0x1 |
---|
2462 | #define FT_LOAD_NO_HINTING 0x2 |
---|
2463 | #define FT_LOAD_RENDER 0x4 |
---|
2464 | #define FT_LOAD_NO_BITMAP 0x8 |
---|
2465 | #define FT_LOAD_VERTICAL_LAYOUT 0x10 |
---|
2466 | #define FT_LOAD_FORCE_AUTOHINT 0x20 |
---|
2467 | #define FT_LOAD_CROP_BITMAP 0x40 |
---|
2468 | #define FT_LOAD_PEDANTIC 0x80 |
---|
2469 | #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 0x200 |
---|
2470 | #define FT_LOAD_NO_RECURSE 0x400 |
---|
2471 | #define FT_LOAD_IGNORE_TRANSFORM 0x800 |
---|
2472 | #define FT_LOAD_MONOCHROME 0x1000 |
---|
2473 | #define FT_LOAD_LINEAR_DESIGN 0x2000 |
---|
2474 | #define FT_LOAD_NO_AUTOHINT 0x8000U |
---|
2475 | |
---|
2476 | /* */ |
---|
2477 | |
---|
2478 | /* used internally only by certain font drivers! */ |
---|
2479 | #define FT_LOAD_ADVANCE_ONLY 0x100 |
---|
2480 | #define FT_LOAD_SBITS_ONLY 0x4000 |
---|
2481 | |
---|
2482 | |
---|
2483 | /************************************************************************** |
---|
2484 | * |
---|
2485 | * @enum: |
---|
2486 | * FT_LOAD_TARGET_XXX |
---|
2487 | * |
---|
2488 | * @description: |
---|
2489 | * A list of values that are used to select a specific hinting algorithm |
---|
2490 | * to use by the hinter. You should OR one of these values to your |
---|
2491 | * `load_flags' when calling @FT_Load_Glyph. |
---|
2492 | * |
---|
2493 | * Note that font's native hinters may ignore the hinting algorithm you |
---|
2494 | * have specified (e.g., the TrueType bytecode interpreter). You can set |
---|
2495 | * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. |
---|
2496 | * |
---|
2497 | * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it |
---|
2498 | * always implies @FT_LOAD_FORCE_AUTOHINT. |
---|
2499 | * |
---|
2500 | * @values: |
---|
2501 | * FT_LOAD_TARGET_NORMAL :: |
---|
2502 | * This corresponds to the default hinting algorithm, optimized for |
---|
2503 | * standard gray-level rendering. For monochrome output, use |
---|
2504 | * @FT_LOAD_TARGET_MONO instead. |
---|
2505 | * |
---|
2506 | * FT_LOAD_TARGET_LIGHT :: |
---|
2507 | * A lighter hinting algorithm for non-monochrome modes. Many |
---|
2508 | * generated glyphs are more fuzzy but better resemble its original |
---|
2509 | * shape. A bit like rendering on Mac OS~X. |
---|
2510 | * |
---|
2511 | * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT. |
---|
2512 | * |
---|
2513 | * FT_LOAD_TARGET_MONO :: |
---|
2514 | * Strong hinting algorithm that should only be used for monochrome |
---|
2515 | * output. The result is probably unpleasant if the glyph is rendered |
---|
2516 | * in non-monochrome modes. |
---|
2517 | * |
---|
2518 | * FT_LOAD_TARGET_LCD :: |
---|
2519 | * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally |
---|
2520 | * decimated LCD displays. |
---|
2521 | * |
---|
2522 | * FT_LOAD_TARGET_LCD_V :: |
---|
2523 | * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically |
---|
2524 | * decimated LCD displays. |
---|
2525 | * |
---|
2526 | * @note: |
---|
2527 | * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your |
---|
2528 | * `load_flags'. They can't be ORed. |
---|
2529 | * |
---|
2530 | * If @FT_LOAD_RENDER is also set, the glyph is rendered in the |
---|
2531 | * corresponding mode (i.e., the mode which matches the used algorithm |
---|
2532 | * best) unless @FT_LOAD_MONOCHROME is set. |
---|
2533 | * |
---|
2534 | * You can use a hinting algorithm that doesn't correspond to the same |
---|
2535 | * rendering mode. As an example, it is possible to use the `light' |
---|
2536 | * hinting algorithm and have the results rendered in horizontal LCD |
---|
2537 | * pixel mode, with code like |
---|
2538 | * |
---|
2539 | * { |
---|
2540 | * FT_Load_Glyph( face, glyph_index, |
---|
2541 | * load_flags | FT_LOAD_TARGET_LIGHT ); |
---|
2542 | * |
---|
2543 | * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); |
---|
2544 | * } |
---|
2545 | */ |
---|
2546 | |
---|
2547 | #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) |
---|
2548 | |
---|
2549 | #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) |
---|
2550 | #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) |
---|
2551 | #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) |
---|
2552 | #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) |
---|
2553 | #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) |
---|
2554 | |
---|
2555 | |
---|
2556 | /************************************************************************** |
---|
2557 | * |
---|
2558 | * @macro: |
---|
2559 | * FT_LOAD_TARGET_MODE |
---|
2560 | * |
---|
2561 | * @description: |
---|
2562 | * Return the @FT_Render_Mode corresponding to a given |
---|
2563 | * @FT_LOAD_TARGET_XXX value. |
---|
2564 | * |
---|
2565 | */ |
---|
2566 | |
---|
2567 | #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) |
---|
2568 | |
---|
2569 | |
---|
2570 | /*************************************************************************/ |
---|
2571 | /* */ |
---|
2572 | /* <Function> */ |
---|
2573 | /* FT_Set_Transform */ |
---|
2574 | /* */ |
---|
2575 | /* <Description> */ |
---|
2576 | /* A function used to set the transformation that is applied to glyph */ |
---|
2577 | /* images when they are loaded into a glyph slot through */ |
---|
2578 | /* @FT_Load_Glyph. */ |
---|
2579 | /* */ |
---|
2580 | /* <InOut> */ |
---|
2581 | /* face :: A handle to the source face object. */ |
---|
2582 | /* */ |
---|
2583 | /* <Input> */ |
---|
2584 | /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */ |
---|
2585 | /* the identity matrix. */ |
---|
2586 | /* delta :: A pointer to the translation vector. Use~0 for the null */ |
---|
2587 | /* vector. */ |
---|
2588 | /* */ |
---|
2589 | /* <Note> */ |
---|
2590 | /* The transformation is only applied to scalable image formats after */ |
---|
2591 | /* the glyph has been loaded. It means that hinting is unaltered by */ |
---|
2592 | /* the transformation and is performed on the character size given in */ |
---|
2593 | /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */ |
---|
2594 | /* */ |
---|
2595 | /* Note that this also transforms the `face.glyph.advance' field, but */ |
---|
2596 | /* *not* the values in `face.glyph.metrics'. */ |
---|
2597 | /* */ |
---|
2598 | FT_EXPORT( void ) |
---|
2599 | FT_Set_Transform( FT_Face face, |
---|
2600 | FT_Matrix* matrix, |
---|
2601 | FT_Vector* delta ); |
---|
2602 | |
---|
2603 | |
---|
2604 | /*************************************************************************/ |
---|
2605 | /* */ |
---|
2606 | /* <Enum> */ |
---|
2607 | /* FT_Render_Mode */ |
---|
2608 | /* */ |
---|
2609 | /* <Description> */ |
---|
2610 | /* An enumeration type that lists the render modes supported by */ |
---|
2611 | /* FreeType~2. Each mode corresponds to a specific type of scanline */ |
---|
2612 | /* conversion performed on the outline. */ |
---|
2613 | /* */ |
---|
2614 | /* For bitmap fonts the `bitmap->pixel_mode' field in the */ |
---|
2615 | /* @FT_GlyphSlotRec structure gives the format of the returned */ |
---|
2616 | /* bitmap. */ |
---|
2617 | /* */ |
---|
2618 | /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */ |
---|
2619 | /* */ |
---|
2620 | /* <Values> */ |
---|
2621 | /* FT_RENDER_MODE_NORMAL :: */ |
---|
2622 | /* This is the default render mode; it corresponds to 8-bit */ |
---|
2623 | /* anti-aliased bitmaps. */ |
---|
2624 | /* */ |
---|
2625 | /* FT_RENDER_MODE_LIGHT :: */ |
---|
2626 | /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */ |
---|
2627 | /* defined as a separate value because render modes are also used */ |
---|
2628 | /* indirectly to define hinting algorithm selectors. See */ |
---|
2629 | /* @FT_LOAD_TARGET_XXX for details. */ |
---|
2630 | /* */ |
---|
2631 | /* FT_RENDER_MODE_MONO :: */ |
---|
2632 | /* This mode corresponds to 1-bit bitmaps (with 2~levels of */ |
---|
2633 | /* opacity). */ |
---|
2634 | /* */ |
---|
2635 | /* FT_RENDER_MODE_LCD :: */ |
---|
2636 | /* This mode corresponds to horizontal RGB and BGR sub-pixel */ |
---|
2637 | /* displays, like LCD-screens. It produces 8-bit bitmaps that are */ |
---|
2638 | /* 3~times the width of the original glyph outline in pixels, and */ |
---|
2639 | /* which use the @FT_PIXEL_MODE_LCD mode. */ |
---|
2640 | /* */ |
---|
2641 | /* FT_RENDER_MODE_LCD_V :: */ |
---|
2642 | /* This mode corresponds to vertical RGB and BGR sub-pixel displays */ |
---|
2643 | /* (like PDA screens, rotated LCD displays, etc.). It produces */ |
---|
2644 | /* 8-bit bitmaps that are 3~times the height of the original */ |
---|
2645 | /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ |
---|
2646 | /* */ |
---|
2647 | /* <Note> */ |
---|
2648 | /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */ |
---|
2649 | /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */ |
---|
2650 | /* (not active in the default builds). It is up to the caller to */ |
---|
2651 | /* either call @FT_Library_SetLcdFilter (if available) or do the */ |
---|
2652 | /* filtering itself. */ |
---|
2653 | /* */ |
---|
2654 | typedef enum FT_Render_Mode_ |
---|
2655 | { |
---|
2656 | FT_RENDER_MODE_NORMAL = 0, |
---|
2657 | FT_RENDER_MODE_LIGHT, |
---|
2658 | FT_RENDER_MODE_MONO, |
---|
2659 | FT_RENDER_MODE_LCD, |
---|
2660 | FT_RENDER_MODE_LCD_V, |
---|
2661 | |
---|
2662 | FT_RENDER_MODE_MAX |
---|
2663 | |
---|
2664 | } FT_Render_Mode; |
---|
2665 | |
---|
2666 | |
---|
2667 | /*************************************************************************/ |
---|
2668 | /* */ |
---|
2669 | /* <Enum> */ |
---|
2670 | /* ft_render_mode_xxx */ |
---|
2671 | /* */ |
---|
2672 | /* <Description> */ |
---|
2673 | /* These constants are deprecated. Use the corresponding */ |
---|
2674 | /* @FT_Render_Mode values instead. */ |
---|
2675 | /* */ |
---|
2676 | /* <Values> */ |
---|
2677 | /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ |
---|
2678 | /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ |
---|
2679 | /* */ |
---|
2680 | #define ft_render_mode_normal FT_RENDER_MODE_NORMAL |
---|
2681 | #define ft_render_mode_mono FT_RENDER_MODE_MONO |
---|
2682 | |
---|
2683 | |
---|
2684 | /*************************************************************************/ |
---|
2685 | /* */ |
---|
2686 | /* <Function> */ |
---|
2687 | /* FT_Render_Glyph */ |
---|
2688 | /* */ |
---|
2689 | /* <Description> */ |
---|
2690 | /* Convert a given glyph image to a bitmap. It does so by inspecting */ |
---|
2691 | /* the glyph image format, finding the relevant renderer, and */ |
---|
2692 | /* invoking it. */ |
---|
2693 | /* */ |
---|
2694 | /* <InOut> */ |
---|
2695 | /* slot :: A handle to the glyph slot containing the image to */ |
---|
2696 | /* convert. */ |
---|
2697 | /* */ |
---|
2698 | /* <Input> */ |
---|
2699 | /* render_mode :: This is the render mode used to render the glyph */ |
---|
2700 | /* image into a bitmap. See @FT_Render_Mode for a */ |
---|
2701 | /* list of possible values. */ |
---|
2702 | /* */ |
---|
2703 | /* <Return> */ |
---|
2704 | /* FreeType error code. 0~means success. */ |
---|
2705 | /* */ |
---|
2706 | FT_EXPORT( FT_Error ) |
---|
2707 | FT_Render_Glyph( FT_GlyphSlot slot, |
---|
2708 | FT_Render_Mode render_mode ); |
---|
2709 | |
---|
2710 | |
---|
2711 | /*************************************************************************/ |
---|
2712 | /* */ |
---|
2713 | /* <Enum> */ |
---|
2714 | /* FT_Kerning_Mode */ |
---|
2715 | /* */ |
---|
2716 | /* <Description> */ |
---|
2717 | /* An enumeration used to specify which kerning values to return in */ |
---|
2718 | /* @FT_Get_Kerning. */ |
---|
2719 | /* */ |
---|
2720 | /* <Values> */ |
---|
2721 | /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */ |
---|
2722 | /* distances (value is~0). */ |
---|
2723 | /* */ |
---|
2724 | /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */ |
---|
2725 | /* distances. */ |
---|
2726 | /* */ |
---|
2727 | /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */ |
---|
2728 | /* units. */ |
---|
2729 | /* */ |
---|
2730 | typedef enum FT_Kerning_Mode_ |
---|
2731 | { |
---|
2732 | FT_KERNING_DEFAULT = 0, |
---|
2733 | FT_KERNING_UNFITTED, |
---|
2734 | FT_KERNING_UNSCALED |
---|
2735 | |
---|
2736 | } FT_Kerning_Mode; |
---|
2737 | |
---|
2738 | |
---|
2739 | /*************************************************************************/ |
---|
2740 | /* */ |
---|
2741 | /* <Const> */ |
---|
2742 | /* ft_kerning_default */ |
---|
2743 | /* */ |
---|
2744 | /* <Description> */ |
---|
2745 | /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */ |
---|
2746 | /* instead. */ |
---|
2747 | /* */ |
---|
2748 | #define ft_kerning_default FT_KERNING_DEFAULT |
---|
2749 | |
---|
2750 | |
---|
2751 | /*************************************************************************/ |
---|
2752 | /* */ |
---|
2753 | /* <Const> */ |
---|
2754 | /* ft_kerning_unfitted */ |
---|
2755 | /* */ |
---|
2756 | /* <Description> */ |
---|
2757 | /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */ |
---|
2758 | /* instead. */ |
---|
2759 | /* */ |
---|
2760 | #define ft_kerning_unfitted FT_KERNING_UNFITTED |
---|
2761 | |
---|
2762 | |
---|
2763 | /*************************************************************************/ |
---|
2764 | /* */ |
---|
2765 | /* <Const> */ |
---|
2766 | /* ft_kerning_unscaled */ |
---|
2767 | /* */ |
---|
2768 | /* <Description> */ |
---|
2769 | /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */ |
---|
2770 | /* instead. */ |
---|
2771 | /* */ |
---|
2772 | #define ft_kerning_unscaled FT_KERNING_UNSCALED |
---|
2773 | |
---|
2774 | |
---|
2775 | /*************************************************************************/ |
---|
2776 | /* */ |
---|
2777 | /* <Function> */ |
---|
2778 | /* FT_Get_Kerning */ |
---|
2779 | /* */ |
---|
2780 | /* <Description> */ |
---|
2781 | /* Return the kerning vector between two glyphs of a same face. */ |
---|
2782 | /* */ |
---|
2783 | /* <Input> */ |
---|
2784 | /* face :: A handle to a source face object. */ |
---|
2785 | /* */ |
---|
2786 | /* left_glyph :: The index of the left glyph in the kern pair. */ |
---|
2787 | /* */ |
---|
2788 | /* right_glyph :: The index of the right glyph in the kern pair. */ |
---|
2789 | /* */ |
---|
2790 | /* kern_mode :: See @FT_Kerning_Mode for more information. */ |
---|
2791 | /* Determines the scale and dimension of the returned */ |
---|
2792 | /* kerning vector. */ |
---|
2793 | /* */ |
---|
2794 | /* <Output> */ |
---|
2795 | /* akerning :: The kerning vector. This is either in font units */ |
---|
2796 | /* or in pixels (26.6 format) for scalable formats, */ |
---|
2797 | /* and in pixels for fixed-sizes formats. */ |
---|
2798 | /* */ |
---|
2799 | /* <Return> */ |
---|
2800 | /* FreeType error code. 0~means success. */ |
---|
2801 | /* */ |
---|
2802 | /* <Note> */ |
---|
2803 | /* Only horizontal layouts (left-to-right & right-to-left) are */ |
---|
2804 | /* supported by this method. Other layouts, or more sophisticated */ |
---|
2805 | /* kernings, are out of the scope of this API function -- they can be */ |
---|
2806 | /* implemented through format-specific interfaces. */ |
---|
2807 | /* */ |
---|
2808 | FT_EXPORT( FT_Error ) |
---|
2809 | FT_Get_Kerning( FT_Face face, |
---|
2810 | FT_UInt left_glyph, |
---|
2811 | FT_UInt right_glyph, |
---|
2812 | FT_UInt kern_mode, |
---|
2813 | FT_Vector *akerning ); |
---|
2814 | |
---|
2815 | |
---|
2816 | /*************************************************************************/ |
---|
2817 | /* */ |
---|
2818 | /* <Function> */ |
---|
2819 | /* FT_Get_Track_Kerning */ |
---|
2820 | /* */ |
---|
2821 | /* <Description> */ |
---|
2822 | /* Return the track kerning for a given face object at a given size. */ |
---|
2823 | /* */ |
---|
2824 | /* <Input> */ |
---|
2825 | /* face :: A handle to a source face object. */ |
---|
2826 | /* */ |
---|
2827 | /* point_size :: The point size in 16.16 fractional points. */ |
---|
2828 | /* */ |
---|
2829 | /* degree :: The degree of tightness. */ |
---|
2830 | /* */ |
---|
2831 | /* <Output> */ |
---|
2832 | /* akerning :: The kerning in 16.16 fractional points. */ |
---|
2833 | /* */ |
---|
2834 | /* <Return> */ |
---|
2835 | /* FreeType error code. 0~means success. */ |
---|
2836 | /* */ |
---|
2837 | FT_EXPORT( FT_Error ) |
---|
2838 | FT_Get_Track_Kerning( FT_Face face, |
---|
2839 | FT_Fixed point_size, |
---|
2840 | FT_Int degree, |
---|
2841 | FT_Fixed* akerning ); |
---|
2842 | |
---|
2843 | |
---|
2844 | /*************************************************************************/ |
---|
2845 | /* */ |
---|
2846 | /* <Function> */ |
---|
2847 | /* FT_Get_Glyph_Name */ |
---|
2848 | /* */ |
---|
2849 | /* <Description> */ |
---|
2850 | /* Retrieve the ASCII name of a given glyph in a face. This only */ |
---|
2851 | /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */ |
---|
2852 | /* */ |
---|
2853 | /* <Input> */ |
---|
2854 | /* face :: A handle to a source face object. */ |
---|
2855 | /* */ |
---|
2856 | /* glyph_index :: The glyph index. */ |
---|
2857 | /* */ |
---|
2858 | /* buffer_max :: The maximal number of bytes available in the */ |
---|
2859 | /* buffer. */ |
---|
2860 | /* */ |
---|
2861 | /* <Output> */ |
---|
2862 | /* buffer :: A pointer to a target buffer where the name is */ |
---|
2863 | /* copied to. */ |
---|
2864 | /* */ |
---|
2865 | /* <Return> */ |
---|
2866 | /* FreeType error code. 0~means success. */ |
---|
2867 | /* */ |
---|
2868 | /* <Note> */ |
---|
2869 | /* An error is returned if the face doesn't provide glyph names or if */ |
---|
2870 | /* the glyph index is invalid. In all cases of failure, the first */ |
---|
2871 | /* byte of `buffer' is set to~0 to indicate an empty name. */ |
---|
2872 | /* */ |
---|
2873 | /* The glyph name is truncated to fit within the buffer if it is too */ |
---|
2874 | /* long. The returned string is always zero-terminated. */ |
---|
2875 | /* */ |
---|
2876 | /* This function is not compiled within the library if the config */ |
---|
2877 | /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */ |
---|
2878 | /* `include/freetype/config/ftoptions.h'. */ |
---|
2879 | /* */ |
---|
2880 | FT_EXPORT( FT_Error ) |
---|
2881 | FT_Get_Glyph_Name( FT_Face face, |
---|
2882 | FT_UInt glyph_index, |
---|
2883 | FT_Pointer buffer, |
---|
2884 | FT_UInt buffer_max ); |
---|
2885 | |
---|
2886 | |
---|
2887 | /*************************************************************************/ |
---|
2888 | /* */ |
---|
2889 | /* <Function> */ |
---|
2890 | /* FT_Get_Postscript_Name */ |
---|
2891 | /* */ |
---|
2892 | /* <Description> */ |
---|
2893 | /* Retrieve the ASCII PostScript name of a given face, if available. */ |
---|
2894 | /* This only works with PostScript and TrueType fonts. */ |
---|
2895 | /* */ |
---|
2896 | /* <Input> */ |
---|
2897 | /* face :: A handle to the source face object. */ |
---|
2898 | /* */ |
---|
2899 | /* <Return> */ |
---|
2900 | /* A pointer to the face's PostScript name. NULL if unavailable. */ |
---|
2901 | /* */ |
---|
2902 | /* <Note> */ |
---|
2903 | /* The returned pointer is owned by the face and is destroyed with */ |
---|
2904 | /* it. */ |
---|
2905 | /* */ |
---|
2906 | FT_EXPORT( const char* ) |
---|
2907 | FT_Get_Postscript_Name( FT_Face face ); |
---|
2908 | |
---|
2909 | |
---|
2910 | /*************************************************************************/ |
---|
2911 | /* */ |
---|
2912 | /* <Function> */ |
---|
2913 | /* FT_Select_Charmap */ |
---|
2914 | /* */ |
---|
2915 | /* <Description> */ |
---|
2916 | /* Select a given charmap by its encoding tag (as listed in */ |
---|
2917 | /* `freetype.h'). */ |
---|
2918 | /* */ |
---|
2919 | /* <InOut> */ |
---|
2920 | /* face :: A handle to the source face object. */ |
---|
2921 | /* */ |
---|
2922 | /* <Input> */ |
---|
2923 | /* encoding :: A handle to the selected encoding. */ |
---|
2924 | /* */ |
---|
2925 | /* <Return> */ |
---|
2926 | /* FreeType error code. 0~means success. */ |
---|
2927 | /* */ |
---|
2928 | /* <Note> */ |
---|
2929 | /* This function returns an error if no charmap in the face */ |
---|
2930 | /* corresponds to the encoding queried here. */ |
---|
2931 | /* */ |
---|
2932 | /* Because many fonts contain more than a single cmap for Unicode */ |
---|
2933 | /* encoding, this function has some special code to select the one */ |
---|
2934 | /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */ |
---|
2935 | /* is preferred to a UCS-2 cmap). It is thus preferable to */ |
---|
2936 | /* @FT_Set_Charmap in this case. */ |
---|
2937 | /* */ |
---|
2938 | FT_EXPORT( FT_Error ) |
---|
2939 | FT_Select_Charmap( FT_Face face, |
---|
2940 | FT_Encoding encoding ); |
---|
2941 | |
---|
2942 | |
---|
2943 | /*************************************************************************/ |
---|
2944 | /* */ |
---|
2945 | /* <Function> */ |
---|
2946 | /* FT_Set_Charmap */ |
---|
2947 | /* */ |
---|
2948 | /* <Description> */ |
---|
2949 | /* Select a given charmap for character code to glyph index mapping. */ |
---|
2950 | /* */ |
---|
2951 | /* <InOut> */ |
---|
2952 | /* face :: A handle to the source face object. */ |
---|
2953 | /* */ |
---|
2954 | /* <Input> */ |
---|
2955 | /* charmap :: A handle to the selected charmap. */ |
---|
2956 | /* */ |
---|
2957 | /* <Return> */ |
---|
2958 | /* FreeType error code. 0~means success. */ |
---|
2959 | /* */ |
---|
2960 | /* <Note> */ |
---|
2961 | /* This function returns an error if the charmap is not part of */ |
---|
2962 | /* the face (i.e., if it is not listed in the `face->charmaps' */ |
---|
2963 | /* table). */ |
---|
2964 | /* */ |
---|
2965 | /* It also fails if a type~14 charmap is selected. */ |
---|
2966 | /* */ |
---|
2967 | FT_EXPORT( FT_Error ) |
---|
2968 | FT_Set_Charmap( FT_Face face, |
---|
2969 | FT_CharMap charmap ); |
---|
2970 | |
---|
2971 | |
---|
2972 | /************************************************************************* |
---|
2973 | * |
---|
2974 | * @function: |
---|
2975 | * FT_Get_Charmap_Index |
---|
2976 | * |
---|
2977 | * @description: |
---|
2978 | * Retrieve index of a given charmap. |
---|
2979 | * |
---|
2980 | * @input: |
---|
2981 | * charmap :: |
---|
2982 | * A handle to a charmap. |
---|
2983 | * |
---|
2984 | * @return: |
---|
2985 | * The index into the array of character maps within the face to which |
---|
2986 | * `charmap' belongs. |
---|
2987 | * |
---|
2988 | */ |
---|
2989 | FT_EXPORT( FT_Int ) |
---|
2990 | FT_Get_Charmap_Index( FT_CharMap charmap ); |
---|
2991 | |
---|
2992 | |
---|
2993 | /*************************************************************************/ |
---|
2994 | /* */ |
---|
2995 | /* <Function> */ |
---|
2996 | /* FT_Get_Char_Index */ |
---|
2997 | /* */ |
---|
2998 | /* <Description> */ |
---|
2999 | /* Return the glyph index of a given character code. This function */ |
---|
3000 | /* uses a charmap object to do the mapping. */ |
---|
3001 | /* */ |
---|
3002 | /* <Input> */ |
---|
3003 | /* face :: A handle to the source face object. */ |
---|
3004 | /* */ |
---|
3005 | /* charcode :: The character code. */ |
---|
3006 | /* */ |
---|
3007 | /* <Return> */ |
---|
3008 | /* The glyph index. 0~means `undefined character code'. */ |
---|
3009 | /* */ |
---|
3010 | /* <Note> */ |
---|
3011 | /* If you use FreeType to manipulate the contents of font files */ |
---|
3012 | /* directly, be aware that the glyph index returned by this function */ |
---|
3013 | /* doesn't always correspond to the internal indices used within */ |
---|
3014 | /* the file. This is done to ensure that value~0 always corresponds */ |
---|
3015 | /* to the `missing glyph'. */ |
---|
3016 | /* */ |
---|
3017 | FT_EXPORT( FT_UInt ) |
---|
3018 | FT_Get_Char_Index( FT_Face face, |
---|
3019 | FT_ULong charcode ); |
---|
3020 | |
---|
3021 | |
---|
3022 | /*************************************************************************/ |
---|
3023 | /* */ |
---|
3024 | /* <Function> */ |
---|
3025 | /* FT_Get_First_Char */ |
---|
3026 | /* */ |
---|
3027 | /* <Description> */ |
---|
3028 | /* This function is used to return the first character code in the */ |
---|
3029 | /* current charmap of a given face. It also returns the */ |
---|
3030 | /* corresponding glyph index. */ |
---|
3031 | /* */ |
---|
3032 | /* <Input> */ |
---|
3033 | /* face :: A handle to the source face object. */ |
---|
3034 | /* */ |
---|
3035 | /* <Output> */ |
---|
3036 | /* agindex :: Glyph index of first character code. 0~if charmap is */ |
---|
3037 | /* empty. */ |
---|
3038 | /* */ |
---|
3039 | /* <Return> */ |
---|
3040 | /* The charmap's first character code. */ |
---|
3041 | /* */ |
---|
3042 | /* <Note> */ |
---|
3043 | /* You should use this function with @FT_Get_Next_Char to be able to */ |
---|
3044 | /* parse all character codes available in a given charmap. The code */ |
---|
3045 | /* should look like this: */ |
---|
3046 | /* */ |
---|
3047 | /* { */ |
---|
3048 | /* FT_ULong charcode; */ |
---|
3049 | /* FT_UInt gindex; */ |
---|
3050 | /* */ |
---|
3051 | /* */ |
---|
3052 | /* charcode = FT_Get_First_Char( face, &gindex ); */ |
---|
3053 | /* while ( gindex != 0 ) */ |
---|
3054 | /* { */ |
---|
3055 | /* ... do something with (charcode,gindex) pair ... */ |
---|
3056 | /* */ |
---|
3057 | /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */ |
---|
3058 | /* } */ |
---|
3059 | /* } */ |
---|
3060 | /* */ |
---|
3061 | /* Note that `*agindex' is set to~0 if the charmap is empty. The */ |
---|
3062 | /* result itself can be~0 in two cases: if the charmap is empty or */ |
---|
3063 | /* when the value~0 is the first valid character code. */ |
---|
3064 | /* */ |
---|
3065 | FT_EXPORT( FT_ULong ) |
---|
3066 | FT_Get_First_Char( FT_Face face, |
---|
3067 | FT_UInt *agindex ); |
---|
3068 | |
---|
3069 | |
---|
3070 | /*************************************************************************/ |
---|
3071 | /* */ |
---|
3072 | /* <Function> */ |
---|
3073 | /* FT_Get_Next_Char */ |
---|
3074 | /* */ |
---|
3075 | /* <Description> */ |
---|
3076 | /* This function is used to return the next character code in the */ |
---|
3077 | /* current charmap of a given face following the value `char_code', */ |
---|
3078 | /* as well as the corresponding glyph index. */ |
---|
3079 | /* */ |
---|
3080 | /* <Input> */ |
---|
3081 | /* face :: A handle to the source face object. */ |
---|
3082 | /* char_code :: The starting character code. */ |
---|
3083 | /* */ |
---|
3084 | /* <Output> */ |
---|
3085 | /* agindex :: Glyph index of first character code. 0~if charmap */ |
---|
3086 | /* is empty. */ |
---|
3087 | /* */ |
---|
3088 | /* <Return> */ |
---|
3089 | /* The charmap's next character code. */ |
---|
3090 | /* */ |
---|
3091 | /* <Note> */ |
---|
3092 | /* You should use this function with @FT_Get_First_Char to walk */ |
---|
3093 | /* over all character codes available in a given charmap. See the */ |
---|
3094 | /* note for this function for a simple code example. */ |
---|
3095 | /* */ |
---|
3096 | /* Note that `*agindex' is set to~0 when there are no more codes in */ |
---|
3097 | /* the charmap. */ |
---|
3098 | /* */ |
---|
3099 | FT_EXPORT( FT_ULong ) |
---|
3100 | FT_Get_Next_Char( FT_Face face, |
---|
3101 | FT_ULong char_code, |
---|
3102 | FT_UInt *agindex ); |
---|
3103 | |
---|
3104 | |
---|
3105 | /*************************************************************************/ |
---|
3106 | /* */ |
---|
3107 | /* <Function> */ |
---|
3108 | /* FT_Get_Name_Index */ |
---|
3109 | /* */ |
---|
3110 | /* <Description> */ |
---|
3111 | /* Return the glyph index of a given glyph name. This function uses */ |
---|
3112 | /* driver specific objects to do the translation. */ |
---|
3113 | /* */ |
---|
3114 | /* <Input> */ |
---|
3115 | /* face :: A handle to the source face object. */ |
---|
3116 | /* */ |
---|
3117 | /* glyph_name :: The glyph name. */ |
---|
3118 | /* */ |
---|
3119 | /* <Return> */ |
---|
3120 | /* The glyph index. 0~means `undefined character code'. */ |
---|
3121 | /* */ |
---|
3122 | FT_EXPORT( FT_UInt ) |
---|
3123 | FT_Get_Name_Index( FT_Face face, |
---|
3124 | FT_String* glyph_name ); |
---|
3125 | |
---|
3126 | |
---|
3127 | /************************************************************************* |
---|
3128 | * |
---|
3129 | * @macro: |
---|
3130 | * FT_SUBGLYPH_FLAG_XXX |
---|
3131 | * |
---|
3132 | * @description: |
---|
3133 | * A list of constants used to describe subglyphs. Please refer to the |
---|
3134 | * TrueType specification for the meaning of the various flags. |
---|
3135 | * |
---|
3136 | * @values: |
---|
3137 | * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS :: |
---|
3138 | * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES :: |
---|
3139 | * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID :: |
---|
3140 | * FT_SUBGLYPH_FLAG_SCALE :: |
---|
3141 | * FT_SUBGLYPH_FLAG_XY_SCALE :: |
---|
3142 | * FT_SUBGLYPH_FLAG_2X2 :: |
---|
3143 | * FT_SUBGLYPH_FLAG_USE_MY_METRICS :: |
---|
3144 | * |
---|
3145 | */ |
---|
3146 | #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 |
---|
3147 | #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 |
---|
3148 | #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 |
---|
3149 | #define FT_SUBGLYPH_FLAG_SCALE 8 |
---|
3150 | #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 |
---|
3151 | #define FT_SUBGLYPH_FLAG_2X2 0x80 |
---|
3152 | #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 |
---|
3153 | |
---|
3154 | |
---|
3155 | /************************************************************************* |
---|
3156 | * |
---|
3157 | * @func: |
---|
3158 | * FT_Get_SubGlyph_Info |
---|
3159 | * |
---|
3160 | * @description: |
---|
3161 | * Retrieve a description of a given subglyph. Only use it if |
---|
3162 | * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE, or an error is |
---|
3163 | * returned. |
---|
3164 | * |
---|
3165 | * @input: |
---|
3166 | * glyph :: |
---|
3167 | * The source glyph slot. |
---|
3168 | * |
---|
3169 | * sub_index :: |
---|
3170 | * The index of subglyph. Must be less than `glyph->num_subglyphs'. |
---|
3171 | * |
---|
3172 | * @output: |
---|
3173 | * p_index :: |
---|
3174 | * The glyph index of the subglyph. |
---|
3175 | * |
---|
3176 | * p_flags :: |
---|
3177 | * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX. |
---|
3178 | * |
---|
3179 | * p_arg1 :: |
---|
3180 | * The subglyph's first argument (if any). |
---|
3181 | * |
---|
3182 | * p_arg2 :: |
---|
3183 | * The subglyph's second argument (if any). |
---|
3184 | * |
---|
3185 | * p_transform :: |
---|
3186 | * The subglyph transformation (if any). |
---|
3187 | * |
---|
3188 | * @return: |
---|
3189 | * FreeType error code. 0~means success. |
---|
3190 | * |
---|
3191 | * @note: |
---|
3192 | * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be |
---|
3193 | * interpreted depending on the flags returned in `*p_flags'. See the |
---|
3194 | * TrueType specification for details. |
---|
3195 | * |
---|
3196 | */ |
---|
3197 | FT_EXPORT( FT_Error ) |
---|
3198 | FT_Get_SubGlyph_Info( FT_GlyphSlot glyph, |
---|
3199 | FT_UInt sub_index, |
---|
3200 | FT_Int *p_index, |
---|
3201 | FT_UInt *p_flags, |
---|
3202 | FT_Int *p_arg1, |
---|
3203 | FT_Int *p_arg2, |
---|
3204 | FT_Matrix *p_transform ); |
---|
3205 | |
---|
3206 | |
---|
3207 | /*************************************************************************/ |
---|
3208 | /* */ |
---|
3209 | /* <Enum> */ |
---|
3210 | /* FT_FSTYPE_XXX */ |
---|
3211 | /* */ |
---|
3212 | /* <Description> */ |
---|
3213 | /* A list of bit flags used in the `fsType' field of the OS/2 table */ |
---|
3214 | /* in a TrueType or OpenType font and the `FSType' entry in a */ |
---|
3215 | /* PostScript font. These bit flags are returned by */ |
---|
3216 | /* @FT_Get_FSType_Flags; they inform client applications of embedding */ |
---|
3217 | /* and subsetting restrictions associated with a font. */ |
---|
3218 | /* */ |
---|
3219 | /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */ |
---|
3220 | /* more details. */ |
---|
3221 | /* */ |
---|
3222 | /* <Values> */ |
---|
3223 | /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */ |
---|
3224 | /* Fonts with no fsType bit set may be embedded and permanently */ |
---|
3225 | /* installed on the remote system by an application. */ |
---|
3226 | /* */ |
---|
3227 | /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */ |
---|
3228 | /* Fonts that have only this bit set must not be modified, embedded */ |
---|
3229 | /* or exchanged in any manner without first obtaining permission of */ |
---|
3230 | /* the font software copyright owner. */ |
---|
3231 | /* */ |
---|
3232 | /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */ |
---|
3233 | /* If this bit is set, the font may be embedded and temporarily */ |
---|
3234 | /* loaded on the remote system. Documents containing Preview & */ |
---|
3235 | /* Print fonts must be opened `read-only'; no edits can be applied */ |
---|
3236 | /* to the document. */ |
---|
3237 | /* */ |
---|
3238 | /* FT_FSTYPE_EDITABLE_EMBEDDING :: */ |
---|
3239 | /* If this bit is set, the font may be embedded but must only be */ |
---|
3240 | /* installed temporarily on other systems. In contrast to Preview */ |
---|
3241 | /* & Print fonts, documents containing editable fonts may be opened */ |
---|
3242 | /* for reading, editing is permitted, and changes may be saved. */ |
---|
3243 | /* */ |
---|
3244 | /* FT_FSTYPE_NO_SUBSETTING :: */ |
---|
3245 | /* If this bit is set, the font may not be subsetted prior to */ |
---|
3246 | /* embedding. */ |
---|
3247 | /* */ |
---|
3248 | /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */ |
---|
3249 | /* If this bit is set, only bitmaps contained in the font may be */ |
---|
3250 | /* embedded; no outline data may be embedded. If there are no */ |
---|
3251 | /* bitmaps available in the font, then the font is unembeddable. */ |
---|
3252 | /* */ |
---|
3253 | /* <Note> */ |
---|
3254 | /* While the fsType flags can indicate that a font may be embedded, a */ |
---|
3255 | /* license with the font vendor may be separately required to use the */ |
---|
3256 | /* font in this way. */ |
---|
3257 | /* */ |
---|
3258 | #define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 |
---|
3259 | #define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 |
---|
3260 | #define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 |
---|
3261 | #define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 |
---|
3262 | #define FT_FSTYPE_NO_SUBSETTING 0x0100 |
---|
3263 | #define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 |
---|
3264 | |
---|
3265 | |
---|
3266 | /*************************************************************************/ |
---|
3267 | /* */ |
---|
3268 | /* <Function> */ |
---|
3269 | /* FT_Get_FSType_Flags */ |
---|
3270 | /* */ |
---|
3271 | /* <Description> */ |
---|
3272 | /* Return the fsType flags for a font. */ |
---|
3273 | /* */ |
---|
3274 | /* <Input> */ |
---|
3275 | /* face :: A handle to the source face object. */ |
---|
3276 | /* */ |
---|
3277 | /* <Return> */ |
---|
3278 | /* The fsType flags, @FT_FSTYPE_XXX. */ |
---|
3279 | /* */ |
---|
3280 | /* <Note> */ |
---|
3281 | /* Use this function rather than directly reading the `fs_type' field */ |
---|
3282 | /* in the @PS_FontInfoRec structure which is only guaranteed to */ |
---|
3283 | /* return the correct results for Type~1 fonts. */ |
---|
3284 | /* */ |
---|
3285 | FT_EXPORT( FT_UShort ) |
---|
3286 | FT_Get_FSType_Flags( FT_Face face ); |
---|
3287 | |
---|
3288 | |
---|
3289 | /*************************************************************************/ |
---|
3290 | /* */ |
---|
3291 | /* <Section> */ |
---|
3292 | /* glyph_variants */ |
---|
3293 | /* */ |
---|
3294 | /* <Title> */ |
---|
3295 | /* Glyph Variants */ |
---|
3296 | /* */ |
---|
3297 | /* <Abstract> */ |
---|
3298 | /* The FreeType~2 interface to Unicode Ideographic Variation */ |
---|
3299 | /* Sequences (IVS), using the SFNT cmap format~14. */ |
---|
3300 | /* */ |
---|
3301 | /* <Description> */ |
---|
3302 | /* Many CJK characters have variant forms. They are a sort of grey */ |
---|
3303 | /* area somewhere between being totally irrelevant and semantically */ |
---|
3304 | /* distinct; for this reason, the Unicode consortium decided to */ |
---|
3305 | /* introduce Ideographic Variation Sequences (IVS), consisting of a */ |
---|
3306 | /* Unicode base character and one of 240 variant selectors */ |
---|
3307 | /* (U+E0100-U+E01EF), instead of further extending the already huge */ |
---|
3308 | /* code range for CJK characters. */ |
---|
3309 | /* */ |
---|
3310 | /* An IVS is registered and unique; for further details please refer */ |
---|
3311 | /* to Unicode Technical Report #37, the Ideographic Variation */ |
---|
3312 | /* Database. To date (October 2007), the character with the most */ |
---|
3313 | /* variants is U+908A, having 8~such IVS. */ |
---|
3314 | /* */ |
---|
3315 | /* Adobe and MS decided to support IVS with a new cmap subtable */ |
---|
3316 | /* (format~14). It is an odd subtable because it is not a mapping of */ |
---|
3317 | /* input code points to glyphs, but contains lists of all variants */ |
---|
3318 | /* supported by the font. */ |
---|
3319 | /* */ |
---|
3320 | /* A variant may be either `default' or `non-default'. A default */ |
---|
3321 | /* variant is the one you will get for that code point if you look it */ |
---|
3322 | /* up in the standard Unicode cmap. A non-default variant is a */ |
---|
3323 | /* different glyph. */ |
---|
3324 | /* */ |
---|
3325 | /*************************************************************************/ |
---|
3326 | |
---|
3327 | |
---|
3328 | /*************************************************************************/ |
---|
3329 | /* */ |
---|
3330 | /* <Function> */ |
---|
3331 | /* FT_Face_GetCharVariantIndex */ |
---|
3332 | /* */ |
---|
3333 | /* <Description> */ |
---|
3334 | /* Return the glyph index of a given character code as modified by */ |
---|
3335 | /* the variation selector. */ |
---|
3336 | /* */ |
---|
3337 | /* <Input> */ |
---|
3338 | /* face :: */ |
---|
3339 | /* A handle to the source face object. */ |
---|
3340 | /* */ |
---|
3341 | /* charcode :: */ |
---|
3342 | /* The character code point in Unicode. */ |
---|
3343 | /* */ |
---|
3344 | /* variantSelector :: */ |
---|
3345 | /* The Unicode code point of the variation selector. */ |
---|
3346 | /* */ |
---|
3347 | /* <Return> */ |
---|
3348 | /* The glyph index. 0~means either `undefined character code', or */ |
---|
3349 | /* `undefined selector code', or `no variation selector cmap */ |
---|
3350 | /* subtable', or `current CharMap is not Unicode'. */ |
---|
3351 | /* */ |
---|
3352 | /* <Note> */ |
---|
3353 | /* If you use FreeType to manipulate the contents of font files */ |
---|
3354 | /* directly, be aware that the glyph index returned by this function */ |
---|
3355 | /* doesn't always correspond to the internal indices used within */ |
---|
3356 | /* the file. This is done to ensure that value~0 always corresponds */ |
---|
3357 | /* to the `missing glyph'. */ |
---|
3358 | /* */ |
---|
3359 | /* This function is only meaningful if */ |
---|
3360 | /* a) the font has a variation selector cmap sub table, */ |
---|
3361 | /* and */ |
---|
3362 | /* b) the current charmap has a Unicode encoding. */ |
---|
3363 | /* */ |
---|
3364 | /* <Since> */ |
---|
3365 | /* 2.3.6 */ |
---|
3366 | /* */ |
---|
3367 | FT_EXPORT( FT_UInt ) |
---|
3368 | FT_Face_GetCharVariantIndex( FT_Face face, |
---|
3369 | FT_ULong charcode, |
---|
3370 | FT_ULong variantSelector ); |
---|
3371 | |
---|
3372 | |
---|
3373 | /*************************************************************************/ |
---|
3374 | /* */ |
---|
3375 | /* <Function> */ |
---|
3376 | /* FT_Face_GetCharVariantIsDefault */ |
---|
3377 | /* */ |
---|
3378 | /* <Description> */ |
---|
3379 | /* Check whether this variant of this Unicode character is the one to */ |
---|
3380 | /* be found in the `cmap'. */ |
---|
3381 | /* */ |
---|
3382 | /* <Input> */ |
---|
3383 | /* face :: */ |
---|
3384 | /* A handle to the source face object. */ |
---|
3385 | /* */ |
---|
3386 | /* charcode :: */ |
---|
3387 | /* The character codepoint in Unicode. */ |
---|
3388 | /* */ |
---|
3389 | /* variantSelector :: */ |
---|
3390 | /* The Unicode codepoint of the variation selector. */ |
---|
3391 | /* */ |
---|
3392 | /* <Return> */ |
---|
3393 | /* 1~if found in the standard (Unicode) cmap, 0~if found in the */ |
---|
3394 | /* variation selector cmap, or -1 if it is not a variant. */ |
---|
3395 | /* */ |
---|
3396 | /* <Note> */ |
---|
3397 | /* This function is only meaningful if the font has a variation */ |
---|
3398 | /* selector cmap subtable. */ |
---|
3399 | /* */ |
---|
3400 | /* <Since> */ |
---|
3401 | /* 2.3.6 */ |
---|
3402 | /* */ |
---|
3403 | FT_EXPORT( FT_Int ) |
---|
3404 | FT_Face_GetCharVariantIsDefault( FT_Face face, |
---|
3405 | FT_ULong charcode, |
---|
3406 | FT_ULong variantSelector ); |
---|
3407 | |
---|
3408 | |
---|
3409 | /*************************************************************************/ |
---|
3410 | /* */ |
---|
3411 | /* <Function> */ |
---|
3412 | /* FT_Face_GetVariantSelectors */ |
---|
3413 | /* */ |
---|
3414 | /* <Description> */ |
---|
3415 | /* Return a zero-terminated list of Unicode variant selectors found */ |
---|
3416 | /* in the font. */ |
---|
3417 | /* */ |
---|
3418 | /* <Input> */ |
---|
3419 | /* face :: */ |
---|
3420 | /* A handle to the source face object. */ |
---|
3421 | /* */ |
---|
3422 | /* <Return> */ |
---|
3423 | /* A pointer to an array of selector code points, or NULL if there is */ |
---|
3424 | /* no valid variant selector cmap subtable. */ |
---|
3425 | /* */ |
---|
3426 | /* <Note> */ |
---|
3427 | /* The last item in the array is~0; the array is owned by the */ |
---|
3428 | /* @FT_Face object but can be overwritten or released on the next */ |
---|
3429 | /* call to a FreeType function. */ |
---|
3430 | /* */ |
---|
3431 | /* <Since> */ |
---|
3432 | /* 2.3.6 */ |
---|
3433 | /* */ |
---|
3434 | FT_EXPORT( FT_UInt32* ) |
---|
3435 | FT_Face_GetVariantSelectors( FT_Face face ); |
---|
3436 | |
---|
3437 | |
---|
3438 | /*************************************************************************/ |
---|
3439 | /* */ |
---|
3440 | /* <Function> */ |
---|
3441 | /* FT_Face_GetVariantsOfChar */ |
---|
3442 | /* */ |
---|
3443 | /* <Description> */ |
---|
3444 | /* Return a zero-terminated list of Unicode variant selectors found */ |
---|
3445 | /* for the specified character code. */ |
---|
3446 | /* */ |
---|
3447 | /* <Input> */ |
---|
3448 | /* face :: */ |
---|
3449 | /* A handle to the source face object. */ |
---|
3450 | /* */ |
---|
3451 | /* charcode :: */ |
---|
3452 | /* The character codepoint in Unicode. */ |
---|
3453 | /* */ |
---|
3454 | /* <Return> */ |
---|
3455 | /* A pointer to an array of variant selector code points which are */ |
---|
3456 | /* active for the given character, or NULL if the corresponding list */ |
---|
3457 | /* is empty. */ |
---|
3458 | /* */ |
---|
3459 | /* <Note> */ |
---|
3460 | /* The last item in the array is~0; the array is owned by the */ |
---|
3461 | /* @FT_Face object but can be overwritten or released on the next */ |
---|
3462 | /* call to a FreeType function. */ |
---|
3463 | /* */ |
---|
3464 | /* <Since> */ |
---|
3465 | /* 2.3.6 */ |
---|
3466 | /* */ |
---|
3467 | FT_EXPORT( FT_UInt32* ) |
---|
3468 | FT_Face_GetVariantsOfChar( FT_Face face, |
---|
3469 | FT_ULong charcode ); |
---|
3470 | |
---|
3471 | |
---|
3472 | /*************************************************************************/ |
---|
3473 | /* */ |
---|
3474 | /* <Function> */ |
---|
3475 | /* FT_Face_GetCharsOfVariant */ |
---|
3476 | /* */ |
---|
3477 | /* <Description> */ |
---|
3478 | /* Return a zero-terminated list of Unicode character codes found for */ |
---|
3479 | /* the specified variant selector. */ |
---|
3480 | /* */ |
---|
3481 | /* <Input> */ |
---|
3482 | /* face :: */ |
---|
3483 | /* A handle to the source face object. */ |
---|
3484 | /* */ |
---|
3485 | /* variantSelector :: */ |
---|
3486 | /* The variant selector code point in Unicode. */ |
---|
3487 | /* */ |
---|
3488 | /* <Return> */ |
---|
3489 | /* A list of all the code points which are specified by this selector */ |
---|
3490 | /* (both default and non-default codes are returned) or NULL if there */ |
---|
3491 | /* is no valid cmap or the variant selector is invalid. */ |
---|
3492 | /* */ |
---|
3493 | /* <Note> */ |
---|
3494 | /* The last item in the array is~0; the array is owned by the */ |
---|
3495 | /* @FT_Face object but can be overwritten or released on the next */ |
---|
3496 | /* call to a FreeType function. */ |
---|
3497 | /* */ |
---|
3498 | /* <Since> */ |
---|
3499 | /* 2.3.6 */ |
---|
3500 | /* */ |
---|
3501 | FT_EXPORT( FT_UInt32* ) |
---|
3502 | FT_Face_GetCharsOfVariant( FT_Face face, |
---|
3503 | FT_ULong variantSelector ); |
---|
3504 | |
---|
3505 | |
---|
3506 | /*************************************************************************/ |
---|
3507 | /* */ |
---|
3508 | /* <Section> */ |
---|
3509 | /* computations */ |
---|
3510 | /* */ |
---|
3511 | /* <Title> */ |
---|
3512 | /* Computations */ |
---|
3513 | /* */ |
---|
3514 | /* <Abstract> */ |
---|
3515 | /* Crunching fixed numbers and vectors. */ |
---|
3516 | /* */ |
---|
3517 | /* <Description> */ |
---|
3518 | /* This section contains various functions used to perform */ |
---|
3519 | /* computations on 16.16 fixed-float numbers or 2d vectors. */ |
---|
3520 | /* */ |
---|
3521 | /* <Order> */ |
---|
3522 | /* FT_MulDiv */ |
---|
3523 | /* FT_MulFix */ |
---|
3524 | /* FT_DivFix */ |
---|
3525 | /* FT_RoundFix */ |
---|
3526 | /* FT_CeilFix */ |
---|
3527 | /* FT_FloorFix */ |
---|
3528 | /* FT_Vector_Transform */ |
---|
3529 | /* FT_Matrix_Multiply */ |
---|
3530 | /* FT_Matrix_Invert */ |
---|
3531 | /* */ |
---|
3532 | /*************************************************************************/ |
---|
3533 | |
---|
3534 | |
---|
3535 | /*************************************************************************/ |
---|
3536 | /* */ |
---|
3537 | /* <Function> */ |
---|
3538 | /* FT_MulDiv */ |
---|
3539 | /* */ |
---|
3540 | /* <Description> */ |
---|
3541 | /* A very simple function used to perform the computation `(a*b)/c' */ |
---|
3542 | /* with maximal accuracy (it uses a 64-bit intermediate integer */ |
---|
3543 | /* whenever necessary). */ |
---|
3544 | /* */ |
---|
3545 | /* This function isn't necessarily as fast as some processor specific */ |
---|
3546 | /* operations, but is at least completely portable. */ |
---|
3547 | /* */ |
---|
3548 | /* <Input> */ |
---|
3549 | /* a :: The first multiplier. */ |
---|
3550 | /* b :: The second multiplier. */ |
---|
3551 | /* c :: The divisor. */ |
---|
3552 | /* */ |
---|
3553 | /* <Return> */ |
---|
3554 | /* The result of `(a*b)/c'. This function never traps when trying to */ |
---|
3555 | /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ |
---|
3556 | /* on the signs of `a' and `b'. */ |
---|
3557 | /* */ |
---|
3558 | FT_EXPORT( FT_Long ) |
---|
3559 | FT_MulDiv( FT_Long a, |
---|
3560 | FT_Long b, |
---|
3561 | FT_Long c ); |
---|
3562 | |
---|
3563 | |
---|
3564 | /* */ |
---|
3565 | |
---|
3566 | /* The following #if 0 ... #endif is for the documentation formatter, */ |
---|
3567 | /* hiding the internal `FT_MULFIX_INLINED' macro. */ |
---|
3568 | |
---|
3569 | #if 0 |
---|
3570 | /*************************************************************************/ |
---|
3571 | /* */ |
---|
3572 | /* <Function> */ |
---|
3573 | /* FT_MulFix */ |
---|
3574 | /* */ |
---|
3575 | /* <Description> */ |
---|
3576 | /* A very simple function used to perform the computation */ |
---|
3577 | /* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */ |
---|
3578 | /* used to multiply a given value by a 16.16 fixed float factor. */ |
---|
3579 | /* */ |
---|
3580 | /* <Input> */ |
---|
3581 | /* a :: The first multiplier. */ |
---|
3582 | /* b :: The second multiplier. Use a 16.16 factor here whenever */ |
---|
3583 | /* possible (see note below). */ |
---|
3584 | /* */ |
---|
3585 | /* <Return> */ |
---|
3586 | /* The result of `(a*b)/0x10000'. */ |
---|
3587 | /* */ |
---|
3588 | /* <Note> */ |
---|
3589 | /* This function has been optimized for the case where the absolute */ |
---|
3590 | /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */ |
---|
3591 | /* As this happens mainly when scaling from notional units to */ |
---|
3592 | /* fractional pixels in FreeType, it resulted in noticeable speed */ |
---|
3593 | /* improvements between versions 2.x and 1.x. */ |
---|
3594 | /* */ |
---|
3595 | /* As a conclusion, always try to place a 16.16 factor as the */ |
---|
3596 | /* _second_ argument of this function; this can make a great */ |
---|
3597 | /* difference. */ |
---|
3598 | /* */ |
---|
3599 | FT_EXPORT( FT_Long ) |
---|
3600 | FT_MulFix( FT_Long a, |
---|
3601 | FT_Long b ); |
---|
3602 | |
---|
3603 | /* */ |
---|
3604 | #endif |
---|
3605 | |
---|
3606 | #ifdef FT_MULFIX_INLINED |
---|
3607 | #define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b ) |
---|
3608 | #else |
---|
3609 | FT_EXPORT( FT_Long ) |
---|
3610 | FT_MulFix( FT_Long a, |
---|
3611 | FT_Long b ); |
---|
3612 | #endif |
---|
3613 | |
---|
3614 | |
---|
3615 | /*************************************************************************/ |
---|
3616 | /* */ |
---|
3617 | /* <Function> */ |
---|
3618 | /* FT_DivFix */ |
---|
3619 | /* */ |
---|
3620 | /* <Description> */ |
---|
3621 | /* A very simple function used to perform the computation */ |
---|
3622 | /* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */ |
---|
3623 | /* used to divide a given value by a 16.16 fixed float factor. */ |
---|
3624 | /* */ |
---|
3625 | /* <Input> */ |
---|
3626 | /* a :: The first multiplier. */ |
---|
3627 | /* b :: The second multiplier. Use a 16.16 factor here whenever */ |
---|
3628 | /* possible (see note below). */ |
---|
3629 | /* */ |
---|
3630 | /* <Return> */ |
---|
3631 | /* The result of `(a*0x10000)/b'. */ |
---|
3632 | /* */ |
---|
3633 | /* <Note> */ |
---|
3634 | /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */ |
---|
3635 | /* 32~bits, then the division is computed directly. Otherwise, we */ |
---|
3636 | /* use a specialized version of @FT_MulDiv. */ |
---|
3637 | /* */ |
---|
3638 | FT_EXPORT( FT_Long ) |
---|
3639 | FT_DivFix( FT_Long a, |
---|
3640 | FT_Long b ); |
---|
3641 | |
---|
3642 | |
---|
3643 | /*************************************************************************/ |
---|
3644 | /* */ |
---|
3645 | /* <Function> */ |
---|
3646 | /* FT_RoundFix */ |
---|
3647 | /* */ |
---|
3648 | /* <Description> */ |
---|
3649 | /* A very simple function used to round a 16.16 fixed number. */ |
---|
3650 | /* */ |
---|
3651 | /* <Input> */ |
---|
3652 | /* a :: The number to be rounded. */ |
---|
3653 | /* */ |
---|
3654 | /* <Return> */ |
---|
3655 | /* The result of `(a + 0x8000) & -0x10000'. */ |
---|
3656 | /* */ |
---|
3657 | FT_EXPORT( FT_Fixed ) |
---|
3658 | FT_RoundFix( FT_Fixed a ); |
---|
3659 | |
---|
3660 | |
---|
3661 | /*************************************************************************/ |
---|
3662 | /* */ |
---|
3663 | /* <Function> */ |
---|
3664 | /* FT_CeilFix */ |
---|
3665 | /* */ |
---|
3666 | /* <Description> */ |
---|
3667 | /* A very simple function used to compute the ceiling function of a */ |
---|
3668 | /* 16.16 fixed number. */ |
---|
3669 | /* */ |
---|
3670 | /* <Input> */ |
---|
3671 | /* a :: The number for which the ceiling function is to be computed. */ |
---|
3672 | /* */ |
---|
3673 | /* <Return> */ |
---|
3674 | /* The result of `(a + 0x10000 - 1) & -0x10000'. */ |
---|
3675 | /* */ |
---|
3676 | FT_EXPORT( FT_Fixed ) |
---|
3677 | FT_CeilFix( FT_Fixed a ); |
---|
3678 | |
---|
3679 | |
---|
3680 | /*************************************************************************/ |
---|
3681 | /* */ |
---|
3682 | /* <Function> */ |
---|
3683 | /* FT_FloorFix */ |
---|
3684 | /* */ |
---|
3685 | /* <Description> */ |
---|
3686 | /* A very simple function used to compute the floor function of a */ |
---|
3687 | /* 16.16 fixed number. */ |
---|
3688 | /* */ |
---|
3689 | /* <Input> */ |
---|
3690 | /* a :: The number for which the floor function is to be computed. */ |
---|
3691 | /* */ |
---|
3692 | /* <Return> */ |
---|
3693 | /* The result of `a & -0x10000'. */ |
---|
3694 | /* */ |
---|
3695 | FT_EXPORT( FT_Fixed ) |
---|
3696 | FT_FloorFix( FT_Fixed a ); |
---|
3697 | |
---|
3698 | |
---|
3699 | /*************************************************************************/ |
---|
3700 | /* */ |
---|
3701 | /* <Function> */ |
---|
3702 | /* FT_Vector_Transform */ |
---|
3703 | /* */ |
---|
3704 | /* <Description> */ |
---|
3705 | /* Transform a single vector through a 2x2 matrix. */ |
---|
3706 | /* */ |
---|
3707 | /* <InOut> */ |
---|
3708 | /* vector :: The target vector to transform. */ |
---|
3709 | /* */ |
---|
3710 | /* <Input> */ |
---|
3711 | /* matrix :: A pointer to the source 2x2 matrix. */ |
---|
3712 | /* */ |
---|
3713 | /* <Note> */ |
---|
3714 | /* The result is undefined if either `vector' or `matrix' is invalid. */ |
---|
3715 | /* */ |
---|
3716 | FT_EXPORT( void ) |
---|
3717 | FT_Vector_Transform( FT_Vector* vec, |
---|
3718 | const FT_Matrix* matrix ); |
---|
3719 | |
---|
3720 | |
---|
3721 | /*************************************************************************/ |
---|
3722 | /* */ |
---|
3723 | /* <Section> */ |
---|
3724 | /* version */ |
---|
3725 | /* */ |
---|
3726 | /* <Title> */ |
---|
3727 | /* FreeType Version */ |
---|
3728 | /* */ |
---|
3729 | /* <Abstract> */ |
---|
3730 | /* Functions and macros related to FreeType versions. */ |
---|
3731 | /* */ |
---|
3732 | /* <Description> */ |
---|
3733 | /* Note that those functions and macros are of limited use because */ |
---|
3734 | /* even a new release of FreeType with only documentation changes */ |
---|
3735 | /* increases the version number. */ |
---|
3736 | /* */ |
---|
3737 | /*************************************************************************/ |
---|
3738 | |
---|
3739 | |
---|
3740 | /************************************************************************* |
---|
3741 | * |
---|
3742 | * @enum: |
---|
3743 | * FREETYPE_XXX |
---|
3744 | * |
---|
3745 | * @description: |
---|
3746 | * These three macros identify the FreeType source code version. |
---|
3747 | * Use @FT_Library_Version to access them at runtime. |
---|
3748 | * |
---|
3749 | * @values: |
---|
3750 | * FREETYPE_MAJOR :: The major version number. |
---|
3751 | * FREETYPE_MINOR :: The minor version number. |
---|
3752 | * FREETYPE_PATCH :: The patch level. |
---|
3753 | * |
---|
3754 | * @note: |
---|
3755 | * The version number of FreeType if built as a dynamic link library |
---|
3756 | * with the `libtool' package is _not_ controlled by these three |
---|
3757 | * macros. |
---|
3758 | */ |
---|
3759 | #define FREETYPE_MAJOR 2 |
---|
3760 | #define FREETYPE_MINOR 3 |
---|
3761 | #define FREETYPE_PATCH 8 |
---|
3762 | |
---|
3763 | |
---|
3764 | /*************************************************************************/ |
---|
3765 | /* */ |
---|
3766 | /* <Function> */ |
---|
3767 | /* FT_Library_Version */ |
---|
3768 | /* */ |
---|
3769 | /* <Description> */ |
---|
3770 | /* Return the version of the FreeType library being used. This is */ |
---|
3771 | /* useful when dynamically linking to the library, since one cannot */ |
---|
3772 | /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */ |
---|
3773 | /* @FREETYPE_PATCH. */ |
---|
3774 | /* */ |
---|
3775 | /* <Input> */ |
---|
3776 | /* library :: A source library handle. */ |
---|
3777 | /* */ |
---|
3778 | /* <Output> */ |
---|
3779 | /* amajor :: The major version number. */ |
---|
3780 | /* */ |
---|
3781 | /* aminor :: The minor version number. */ |
---|
3782 | /* */ |
---|
3783 | /* apatch :: The patch version number. */ |
---|
3784 | /* */ |
---|
3785 | /* <Note> */ |
---|
3786 | /* The reason why this function takes a `library' argument is because */ |
---|
3787 | /* certain programs implement library initialization in a custom way */ |
---|
3788 | /* that doesn't use @FT_Init_FreeType. */ |
---|
3789 | /* */ |
---|
3790 | /* In such cases, the library version might not be available before */ |
---|
3791 | /* the library object has been created. */ |
---|
3792 | /* */ |
---|
3793 | FT_EXPORT( void ) |
---|
3794 | FT_Library_Version( FT_Library library, |
---|
3795 | FT_Int *amajor, |
---|
3796 | FT_Int *aminor, |
---|
3797 | FT_Int *apatch ); |
---|
3798 | |
---|
3799 | |
---|
3800 | /*************************************************************************/ |
---|
3801 | /* */ |
---|
3802 | /* <Function> */ |
---|
3803 | /* FT_Face_CheckTrueTypePatents */ |
---|
3804 | /* */ |
---|
3805 | /* <Description> */ |
---|
3806 | /* Parse all bytecode instructions of a TrueType font file to check */ |
---|
3807 | /* whether any of the patented opcodes are used. This is only useful */ |
---|
3808 | /* if you want to be able to use the unpatented hinter with */ |
---|
3809 | /* fonts that do *not* use these opcodes. */ |
---|
3810 | /* */ |
---|
3811 | /* Note that this function parses *all* glyph instructions in the */ |
---|
3812 | /* font file, which may be slow. */ |
---|
3813 | /* */ |
---|
3814 | /* <Input> */ |
---|
3815 | /* face :: A face handle. */ |
---|
3816 | /* */ |
---|
3817 | /* <Return> */ |
---|
3818 | /* 1~if this is a TrueType font that uses one of the patented */ |
---|
3819 | /* opcodes, 0~otherwise. */ |
---|
3820 | /* */ |
---|
3821 | /* <Since> */ |
---|
3822 | /* 2.3.5 */ |
---|
3823 | /* */ |
---|
3824 | FT_EXPORT( FT_Bool ) |
---|
3825 | FT_Face_CheckTrueTypePatents( FT_Face face ); |
---|
3826 | |
---|
3827 | |
---|
3828 | /*************************************************************************/ |
---|
3829 | /* */ |
---|
3830 | /* <Function> */ |
---|
3831 | /* FT_Face_SetUnpatentedHinting */ |
---|
3832 | /* */ |
---|
3833 | /* <Description> */ |
---|
3834 | /* Enable or disable the unpatented hinter for a given face. */ |
---|
3835 | /* Only enable it if you have determined that the face doesn't */ |
---|
3836 | /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */ |
---|
3837 | /* */ |
---|
3838 | /* <Input> */ |
---|
3839 | /* face :: A face handle. */ |
---|
3840 | /* */ |
---|
3841 | /* value :: New boolean setting. */ |
---|
3842 | /* */ |
---|
3843 | /* <Return> */ |
---|
3844 | /* The old setting value. This will always be false if this is not */ |
---|
3845 | /* an SFNT font, or if the unpatented hinter is not compiled in this */ |
---|
3846 | /* instance of the library. */ |
---|
3847 | /* */ |
---|
3848 | /* <Since> */ |
---|
3849 | /* 2.3.5 */ |
---|
3850 | /* */ |
---|
3851 | FT_EXPORT( FT_Bool ) |
---|
3852 | FT_Face_SetUnpatentedHinting( FT_Face face, |
---|
3853 | FT_Bool value ); |
---|
3854 | |
---|
3855 | /* */ |
---|
3856 | |
---|
3857 | |
---|
3858 | FT_END_HEADER |
---|
3859 | |
---|
3860 | #endif /* __FREETYPE_H__ */ |
---|
3861 | |
---|
3862 | |
---|
3863 | /* END */ |
---|