rev |
line source |
nuclear@0
|
1 /***************************************************************************/
|
nuclear@0
|
2 /* */
|
nuclear@0
|
3 /* ftadvanc.h */
|
nuclear@0
|
4 /* */
|
nuclear@0
|
5 /* Quick computation of advance widths (specification only). */
|
nuclear@0
|
6 /* */
|
nuclear@0
|
7 /* Copyright 2008 by */
|
nuclear@0
|
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
nuclear@0
|
9 /* */
|
nuclear@0
|
10 /* This file is part of the FreeType project, and may only be used, */
|
nuclear@0
|
11 /* modified, and distributed under the terms of the FreeType project */
|
nuclear@0
|
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
nuclear@0
|
13 /* this file you indicate that you have read the license and */
|
nuclear@0
|
14 /* understand and accept it fully. */
|
nuclear@0
|
15 /* */
|
nuclear@0
|
16 /***************************************************************************/
|
nuclear@0
|
17
|
nuclear@0
|
18
|
nuclear@0
|
19 #ifndef __FTADVANC_H__
|
nuclear@0
|
20 #define __FTADVANC_H__
|
nuclear@0
|
21
|
nuclear@0
|
22
|
nuclear@0
|
23 #include <ft2build.h>
|
nuclear@0
|
24 #include FT_FREETYPE_H
|
nuclear@0
|
25
|
nuclear@0
|
26 #ifdef FREETYPE_H
|
nuclear@0
|
27 #error "freetype.h of FreeType 1 has been loaded!"
|
nuclear@0
|
28 #error "Please fix the directory search order for header files"
|
nuclear@0
|
29 #error "so that freetype.h of FreeType 2 is found first."
|
nuclear@0
|
30 #endif
|
nuclear@0
|
31
|
nuclear@0
|
32
|
nuclear@0
|
33 FT_BEGIN_HEADER
|
nuclear@0
|
34
|
nuclear@0
|
35
|
nuclear@0
|
36 /**************************************************************************
|
nuclear@0
|
37 *
|
nuclear@0
|
38 * @section:
|
nuclear@0
|
39 * quick_advance
|
nuclear@0
|
40 *
|
nuclear@0
|
41 * @title:
|
nuclear@0
|
42 * Quick retrieval of advance values
|
nuclear@0
|
43 *
|
nuclear@0
|
44 * @abstract:
|
nuclear@0
|
45 * Retrieve horizontal and vertical advance values without processing
|
nuclear@0
|
46 * glyph outlines, if possible.
|
nuclear@0
|
47 *
|
nuclear@0
|
48 * @description:
|
nuclear@0
|
49 * This section contains functions to quickly extract advance values
|
nuclear@0
|
50 * without handling glyph outlines, if possible.
|
nuclear@0
|
51 */
|
nuclear@0
|
52
|
nuclear@0
|
53
|
nuclear@0
|
54 /*************************************************************************/
|
nuclear@0
|
55 /* */
|
nuclear@0
|
56 /* <Const> */
|
nuclear@0
|
57 /* FT_ADVANCE_FLAG_FAST_ONLY */
|
nuclear@0
|
58 /* */
|
nuclear@0
|
59 /* <Description> */
|
nuclear@0
|
60 /* A bit-flag to be OR-ed with the `flags' parameter of the */
|
nuclear@0
|
61 /* @FT_Get_Advance and @FT_Get_Advances functions. */
|
nuclear@0
|
62 /* */
|
nuclear@0
|
63 /* If set, it indicates that you want these functions to fail if the */
|
nuclear@0
|
64 /* corresponding hinting mode or font driver doesn't allow for very */
|
nuclear@0
|
65 /* quick advance computation. */
|
nuclear@0
|
66 /* */
|
nuclear@0
|
67 /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
|
nuclear@0
|
68 /* or light-hinted can have their advance width computed very */
|
nuclear@0
|
69 /* quickly. */
|
nuclear@0
|
70 /* */
|
nuclear@0
|
71 /* Normal and bytecode hinted modes, which require loading, scaling, */
|
nuclear@0
|
72 /* and hinting of the glyph outline, are extremely slow by */
|
nuclear@0
|
73 /* comparison. */
|
nuclear@0
|
74 /* */
|
nuclear@0
|
75 #define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
|
nuclear@0
|
76
|
nuclear@0
|
77
|
nuclear@0
|
78 /*************************************************************************/
|
nuclear@0
|
79 /* */
|
nuclear@0
|
80 /* <Function> */
|
nuclear@0
|
81 /* FT_Get_Advance */
|
nuclear@0
|
82 /* */
|
nuclear@0
|
83 /* <Description> */
|
nuclear@0
|
84 /* Retrieve the advance value of a given glyph outline in an */
|
nuclear@0
|
85 /* @FT_Face. By default, the unhinted advance is returned in font */
|
nuclear@0
|
86 /* units. */
|
nuclear@0
|
87 /* */
|
nuclear@0
|
88 /* <Input> */
|
nuclear@0
|
89 /* face :: The source @FT_Face handle. */
|
nuclear@0
|
90 /* */
|
nuclear@0
|
91 /* gindex :: The glyph index. */
|
nuclear@0
|
92 /* */
|
nuclear@0
|
93 /* load_flags :: A set of bit flags similar to those used when */
|
nuclear@0
|
94 /* calling @FT_Load_Glyph, used to determine what kind */
|
nuclear@0
|
95 /* of advances you need. */
|
nuclear@0
|
96 /* <Output> */
|
nuclear@0
|
97 /* padvance :: The advance value, in either font units or 16.16 */
|
nuclear@0
|
98 /* format. */
|
nuclear@0
|
99 /* */
|
nuclear@0
|
100 /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
|
nuclear@0
|
101 /* vertical advance corresponding to a vertical layout. */
|
nuclear@0
|
102 /* Otherwise, it is the horizontal advance in a */
|
nuclear@0
|
103 /* horizontal layout. */
|
nuclear@0
|
104 /* */
|
nuclear@0
|
105 /* <Return> */
|
nuclear@0
|
106 /* FreeType error code. 0 means success. */
|
nuclear@0
|
107 /* */
|
nuclear@0
|
108 /* <Note> */
|
nuclear@0
|
109 /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
|
nuclear@0
|
110 /* if the corresponding font backend doesn't have a quick way to */
|
nuclear@0
|
111 /* retrieve the advances. */
|
nuclear@0
|
112 /* */
|
nuclear@0
|
113 /* A scaled advance is returned in 16.16 format but isn't transformed */
|
nuclear@0
|
114 /* by the affine transformation specified by @FT_Set_Transform. */
|
nuclear@0
|
115 /* */
|
nuclear@0
|
116 FT_EXPORT( FT_Error )
|
nuclear@0
|
117 FT_Get_Advance( FT_Face face,
|
nuclear@0
|
118 FT_UInt gindex,
|
nuclear@0
|
119 FT_Int32 load_flags,
|
nuclear@0
|
120 FT_Fixed *padvance );
|
nuclear@0
|
121
|
nuclear@0
|
122
|
nuclear@0
|
123 /*************************************************************************/
|
nuclear@0
|
124 /* */
|
nuclear@0
|
125 /* <Function> */
|
nuclear@0
|
126 /* FT_Get_Advances */
|
nuclear@0
|
127 /* */
|
nuclear@0
|
128 /* <Description> */
|
nuclear@0
|
129 /* Retrieve the advance values of several glyph outlines in an */
|
nuclear@0
|
130 /* @FT_Face. By default, the unhinted advances are returned in font */
|
nuclear@0
|
131 /* units. */
|
nuclear@0
|
132 /* */
|
nuclear@0
|
133 /* <Input> */
|
nuclear@0
|
134 /* face :: The source @FT_Face handle. */
|
nuclear@0
|
135 /* */
|
nuclear@0
|
136 /* start :: The first glyph index. */
|
nuclear@0
|
137 /* */
|
nuclear@0
|
138 /* count :: The number of advance values you want to retrieve. */
|
nuclear@0
|
139 /* */
|
nuclear@0
|
140 /* load_flags :: A set of bit flags similar to those used when */
|
nuclear@0
|
141 /* calling @FT_Load_Glyph. */
|
nuclear@0
|
142 /* */
|
nuclear@0
|
143 /* <Output> */
|
nuclear@0
|
144 /* padvance :: The advances, in either font units or 16.16 format. */
|
nuclear@0
|
145 /* This array must contain at least `count' elements. */
|
nuclear@0
|
146 /* */
|
nuclear@0
|
147 /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
|
nuclear@0
|
148 /* vertical advances corresponding to a vertical layout. */
|
nuclear@0
|
149 /* Otherwise, they are the horizontal advances in a */
|
nuclear@0
|
150 /* horizontal layout. */
|
nuclear@0
|
151 /* */
|
nuclear@0
|
152 /* <Return> */
|
nuclear@0
|
153 /* FreeType error code. 0 means success. */
|
nuclear@0
|
154 /* */
|
nuclear@0
|
155 /* <Note> */
|
nuclear@0
|
156 /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
|
nuclear@0
|
157 /* if the corresponding font backend doesn't have a quick way to */
|
nuclear@0
|
158 /* retrieve the advances. */
|
nuclear@0
|
159 /* */
|
nuclear@0
|
160 /* Scaled advances are returned in 16.16 format but aren't */
|
nuclear@0
|
161 /* transformed by the affine transformation specified by */
|
nuclear@0
|
162 /* @FT_Set_Transform. */
|
nuclear@0
|
163 /* */
|
nuclear@0
|
164 FT_EXPORT( FT_Error )
|
nuclear@0
|
165 FT_Get_Advances( FT_Face face,
|
nuclear@0
|
166 FT_UInt start,
|
nuclear@0
|
167 FT_UInt count,
|
nuclear@0
|
168 FT_Int32 load_flags,
|
nuclear@0
|
169 FT_Fixed *padvances );
|
nuclear@0
|
170
|
nuclear@0
|
171 /* */
|
nuclear@0
|
172
|
nuclear@0
|
173
|
nuclear@0
|
174 FT_END_HEADER
|
nuclear@0
|
175
|
nuclear@0
|
176 #endif /* __FTADVANC_H__ */
|
nuclear@0
|
177
|
nuclear@0
|
178
|
nuclear@0
|
179 /* END */
|