Upload tizen 2.0 beta source
[framework/graphics/freetype.git] / docs / reference / ft2-glyph_management.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>FreeType-2.4.9 API Reference</title>
7 <style type="text/css">
8   body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
9          color: #000000;
10          background: #FFFFFF; }
11
12   p { text-align: justify; }
13   h1 { text-align: center; }
14   li { text-align: justify; }
15   td { padding: 0 0.5em 0 0.5em; }
16   td.left { padding: 0 0.5em 0 0.5em;
17             text-align: left; }
18
19   a:link { color: #0000EF; }
20   a:visited { color: #51188E; }
21   a:hover { color: #FF0000; }
22
23   span.keyword { font-family: monospace;
24                  text-align: left;
25                  white-space: pre;
26                  color: darkblue; }
27
28   pre.colored { color: blue; }
29
30   ul.empty { list-style-type: none; }
31 </style>
32 </head>
33 <body>
34
35 <table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
36 <td width="100%"></td>
37 <td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
38 <center><h1>FreeType-2.4.9 API Reference</h1></center>
39
40 <center><h1>
41 Glyph Management
42 </h1></center>
43 <h2>Synopsis</h2>
44 <table align=center cellspacing=5 cellpadding=0 border=0>
45 <tr><td></td><td><a href="#FT_Glyph">FT_Glyph</a></td><td></td><td><a href="#FT_OutlineGlyphRec">FT_OutlineGlyphRec</a></td><td></td><td><a href="#ft_glyph_bbox_xxx">ft_glyph_bbox_xxx</a></td></tr>
46 <tr><td></td><td><a href="#FT_GlyphRec">FT_GlyphRec</a></td><td></td><td><a href="#FT_Get_Glyph">FT_Get_Glyph</a></td><td></td><td><a href="#FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a></td></tr>
47 <tr><td></td><td><a href="#FT_BitmapGlyph">FT_BitmapGlyph</a></td><td></td><td><a href="#FT_Glyph_Copy">FT_Glyph_Copy</a></td><td></td><td><a href="#FT_Glyph_To_Bitmap">FT_Glyph_To_Bitmap</a></td></tr>
48 <tr><td></td><td><a href="#FT_BitmapGlyphRec">FT_BitmapGlyphRec</a></td><td></td><td><a href="#FT_Glyph_Transform">FT_Glyph_Transform</a></td><td></td><td><a href="#FT_Done_Glyph">FT_Done_Glyph</a></td></tr>
49 <tr><td></td><td><a href="#FT_OutlineGlyph">FT_OutlineGlyph</a></td><td></td><td><a href="#FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a></td><td></td><td></td></tr>
50 </table><br><br>
51
52 <table align=center width="87%"><tr><td>
53 <p>This section contains definitions used to manage glyph data through generic FT_Glyph objects. Each of them can contain a bitmap, a vector outline, or even images in other formats.</p>
54 </td></tr></table><br>
55 <table align=center width="75%"><tr><td>
56 <h4><a name="FT_Glyph">FT_Glyph</a></h4>
57 <table align=center width="87%"><tr><td>
58 Defined in FT_GLYPH_H (freetype/ftglyph.h).
59 </td></tr></table><br>
60 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
61
62   <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_GlyphRec_*  <b>FT_Glyph</b>;
63
64 </pre></table><br>
65 <table align=center width="87%"><tr><td>
66 <p>Handle to an object used to model generic glyph images. It is a pointer to the <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a> structure and can contain a glyph bitmap or pointer.</p>
67 </td></tr></table><br>
68 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
69 <p>Glyph objects are not owned by the library. You must thus release them manually (through <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>) <i>before</i> calling <a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a>.</p>
70 </td></tr></table>
71 </td></tr></table>
72 <hr width="75%">
73 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
74 <td width="100%"></td>
75 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
76
77 <table align=center width="75%"><tr><td>
78 <h4><a name="FT_GlyphRec">FT_GlyphRec</a></h4>
79 <table align=center width="87%"><tr><td>
80 Defined in FT_GLYPH_H (freetype/ftglyph.h).
81 </td></tr></table><br>
82 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
83
84   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_GlyphRec_
85   {
86     <a href="ft2-base_interface.html#FT_Library">FT_Library</a>             library;
87     <span class="keyword">const</span> FT_Glyph_Class*  clazz;
88     <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>        format;
89     <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>              advance;
90
91   } <b>FT_GlyphRec</b>;
92
93 </pre></table><br>
94 <table align=center width="87%"><tr><td>
95 <p>The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed float format.</p>
96 </td></tr></table><br>
97 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
98 <p></p>
99 <table cellpadding=3 border=0>
100 <tr valign=top><td><b>library</b></td><td>
101 <p>A handle to the FreeType library object.</p>
102 </td></tr>
103 <tr valign=top><td><b>clazz</b></td><td>
104 <p>A pointer to the glyph's class. Private.</p>
105 </td></tr>
106 <tr valign=top><td><b>format</b></td><td>
107 <p>The format of the glyph's image.</p>
108 </td></tr>
109 <tr valign=top><td><b>advance</b></td><td>
110 <p>A 16.16 vector that gives the glyph's advance width.</p>
111 </td></tr>
112 </table>
113 </td></tr></table>
114 </td></tr></table>
115 <hr width="75%">
116 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
117 <td width="100%"></td>
118 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
119
120 <table align=center width="75%"><tr><td>
121 <h4><a name="FT_BitmapGlyph">FT_BitmapGlyph</a></h4>
122 <table align=center width="87%"><tr><td>
123 Defined in FT_GLYPH_H (freetype/ftglyph.h).
124 </td></tr></table><br>
125 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
126
127   <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_BitmapGlyphRec_*  <b>FT_BitmapGlyph</b>;
128
129 </pre></table><br>
130 <table align=center width="87%"><tr><td>
131 <p>A handle to an object used to model a bitmap glyph image. This is a sub-class of <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>, and a pointer to <a href="ft2-glyph_management.html#FT_BitmapGlyphRec">FT_BitmapGlyphRec</a>.</p>
132 </td></tr></table><br>
133 </td></tr></table>
134 <hr width="75%">
135 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
136 <td width="100%"></td>
137 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
138
139 <table align=center width="75%"><tr><td>
140 <h4><a name="FT_BitmapGlyphRec">FT_BitmapGlyphRec</a></h4>
141 <table align=center width="87%"><tr><td>
142 Defined in FT_GLYPH_H (freetype/ftglyph.h).
143 </td></tr></table><br>
144 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
145
146   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_BitmapGlyphRec_
147   {
148     <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>  root;
149     <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       left;
150     <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       top;
151     <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>    bitmap;
152
153   } <b>FT_BitmapGlyphRec</b>;
154
155 </pre></table><br>
156 <table align=center width="87%"><tr><td>
157 <p>A structure used for bitmap glyph images. This really is a &lsquo;sub-class&rsquo; of <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>.</p>
158 </td></tr></table><br>
159 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
160 <p></p>
161 <table cellpadding=3 border=0>
162 <tr valign=top><td><b>root</b></td><td>
163 <p>The root <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> fields.</p>
164 </td></tr>
165 <tr valign=top><td><b>left</b></td><td>
166 <p>The left-side bearing, i.e., the horizontal distance from the current pen position to the left border of the glyph bitmap.</p>
167 </td></tr>
168 <tr valign=top><td><b>top</b></td><td>
169 <p>The top-side bearing, i.e., the vertical distance from the current pen position to the top border of the glyph bitmap. This distance is positive for upwards&nbsp;y!</p>
170 </td></tr>
171 <tr valign=top><td><b>bitmap</b></td><td>
172 <p>A descriptor for the bitmap.</p>
173 </td></tr>
174 </table>
175 </td></tr></table>
176 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
177 <p>You can typecast an <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> to <a href="ft2-glyph_management.html#FT_BitmapGlyph">FT_BitmapGlyph</a> if you have &lsquo;glyph-&gt;format == FT_GLYPH_FORMAT_BITMAP&rsquo;. This lets you access the bitmap's contents easily.</p>
178 <p>The corresponding pixel buffer is always owned by <a href="ft2-glyph_management.html#FT_BitmapGlyph">FT_BitmapGlyph</a> and is thus created and destroyed with it.</p>
179 </td></tr></table>
180 </td></tr></table>
181 <hr width="75%">
182 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
183 <td width="100%"></td>
184 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
185
186 <table align=center width="75%"><tr><td>
187 <h4><a name="FT_OutlineGlyph">FT_OutlineGlyph</a></h4>
188 <table align=center width="87%"><tr><td>
189 Defined in FT_GLYPH_H (freetype/ftglyph.h).
190 </td></tr></table><br>
191 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
192
193   <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_OutlineGlyphRec_*  <b>FT_OutlineGlyph</b>;
194
195 </pre></table><br>
196 <table align=center width="87%"><tr><td>
197 <p>A handle to an object used to model an outline glyph image. This is a sub-class of <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>, and a pointer to <a href="ft2-glyph_management.html#FT_OutlineGlyphRec">FT_OutlineGlyphRec</a>.</p>
198 </td></tr></table><br>
199 </td></tr></table>
200 <hr width="75%">
201 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
202 <td width="100%"></td>
203 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
204
205 <table align=center width="75%"><tr><td>
206 <h4><a name="FT_OutlineGlyphRec">FT_OutlineGlyphRec</a></h4>
207 <table align=center width="87%"><tr><td>
208 Defined in FT_GLYPH_H (freetype/ftglyph.h).
209 </td></tr></table><br>
210 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
211
212   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_OutlineGlyphRec_
213   {
214     <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>  root;
215     <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>   outline;
216
217   } <b>FT_OutlineGlyphRec</b>;
218
219 </pre></table><br>
220 <table align=center width="87%"><tr><td>
221 <p>A structure used for outline (vectorial) glyph images. This really is a &lsquo;sub-class&rsquo; of <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>.</p>
222 </td></tr></table><br>
223 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
224 <p></p>
225 <table cellpadding=3 border=0>
226 <tr valign=top><td><b>root</b></td><td>
227 <p>The root <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> fields.</p>
228 </td></tr>
229 <tr valign=top><td><b>outline</b></td><td>
230 <p>A descriptor for the outline.</p>
231 </td></tr>
232 </table>
233 </td></tr></table>
234 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
235 <p>You can typecast an <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> to <a href="ft2-glyph_management.html#FT_OutlineGlyph">FT_OutlineGlyph</a> if you have &lsquo;glyph-&gt;format == FT_GLYPH_FORMAT_OUTLINE&rsquo;. This lets you access the outline's content easily.</p>
236 <p>As the outline is extracted from a glyph slot, its coordinates are expressed normally in 26.6 pixels, unless the flag <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a> was used in <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>() or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>().</p>
237 <p>The outline's tables are always owned by the object and are destroyed with it.</p>
238 </td></tr></table>
239 </td></tr></table>
240 <hr width="75%">
241 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
242 <td width="100%"></td>
243 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
244
245 <table align=center width="75%"><tr><td>
246 <h4><a name="FT_Get_Glyph">FT_Get_Glyph</a></h4>
247 <table align=center width="87%"><tr><td>
248 Defined in FT_GLYPH_H (freetype/ftglyph.h).
249 </td></tr></table><br>
250 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
251
252   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
253   <b>FT_Get_Glyph</b>( <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>  slot,
254                 <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>     *aglyph );
255
256 </pre></table><br>
257 <table align=center width="87%"><tr><td>
258 <p>A function used to extract a glyph image from a slot. Note that the created <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object must be released with <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>.</p>
259 </td></tr></table><br>
260 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
261 <p></p>
262 <table cellpadding=3 border=0>
263 <tr valign=top><td><b>slot</b></td><td>
264 <p>A handle to the source glyph slot.</p>
265 </td></tr>
266 </table>
267 </td></tr></table>
268 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
269 <p></p>
270 <table cellpadding=3 border=0>
271 <tr valign=top><td><b>aglyph</b></td><td>
272 <p>A handle to the glyph object.</p>
273 </td></tr>
274 </table>
275 </td></tr></table>
276 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
277 <p>FreeType error code. 0&nbsp;means success.</p>
278 </td></tr></table>
279 </td></tr></table>
280 <hr width="75%">
281 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
282 <td width="100%"></td>
283 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
284
285 <table align=center width="75%"><tr><td>
286 <h4><a name="FT_Glyph_Copy">FT_Glyph_Copy</a></h4>
287 <table align=center width="87%"><tr><td>
288 Defined in FT_GLYPH_H (freetype/ftglyph.h).
289 </td></tr></table><br>
290 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
291
292   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
293   <b>FT_Glyph_Copy</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>   source,
294                  <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>  *target );
295
296 </pre></table><br>
297 <table align=center width="87%"><tr><td>
298 <p>A function used to copy a glyph image. Note that the created <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object must be released with <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>.</p>
299 </td></tr></table><br>
300 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
301 <p></p>
302 <table cellpadding=3 border=0>
303 <tr valign=top><td><b>source</b></td><td>
304 <p>A handle to the source glyph object.</p>
305 </td></tr>
306 </table>
307 </td></tr></table>
308 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
309 <p></p>
310 <table cellpadding=3 border=0>
311 <tr valign=top><td><b>target</b></td><td>
312 <p>A handle to the target glyph object. 0&nbsp;in case of error.</p>
313 </td></tr>
314 </table>
315 </td></tr></table>
316 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
317 <p>FreeType error code. 0&nbsp;means success.</p>
318 </td></tr></table>
319 </td></tr></table>
320 <hr width="75%">
321 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
322 <td width="100%"></td>
323 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
324
325 <table align=center width="75%"><tr><td>
326 <h4><a name="FT_Glyph_Transform">FT_Glyph_Transform</a></h4>
327 <table align=center width="87%"><tr><td>
328 Defined in FT_GLYPH_H (freetype/ftglyph.h).
329 </td></tr></table><br>
330 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
331
332   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
333   <b>FT_Glyph_Transform</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>    glyph,
334                       <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>*  matrix,
335                       <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*  delta );
336
337 </pre></table><br>
338 <table align=center width="87%"><tr><td>
339 <p>Transform a glyph image if its format is scalable.</p>
340 </td></tr></table><br>
341 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
342 <p></p>
343 <table cellpadding=3 border=0>
344 <tr valign=top><td><b>glyph</b></td><td>
345 <p>A handle to the target glyph object.</p>
346 </td></tr>
347 </table>
348 </td></tr></table>
349 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
350 <p></p>
351 <table cellpadding=3 border=0>
352 <tr valign=top><td><b>matrix</b></td><td>
353 <p>A pointer to a 2x2 matrix to apply.</p>
354 </td></tr>
355 <tr valign=top><td><b>delta</b></td><td>
356 <p>A pointer to a 2d vector to apply. Coordinates are expressed in 1/64th of a pixel.</p>
357 </td></tr>
358 </table>
359 </td></tr></table>
360 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
361 <p>FreeType error code (if not 0, the glyph format is not scalable).</p>
362 </td></tr></table>
363 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
364 <p>The 2x2 transformation matrix is also applied to the glyph's advance vector.</p>
365 </td></tr></table>
366 </td></tr></table>
367 <hr width="75%">
368 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
369 <td width="100%"></td>
370 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
371
372 <table align=center width="75%"><tr><td>
373 <h4><a name="FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a></h4>
374 <table align=center width="87%"><tr><td>
375 Defined in FT_GLYPH_H (freetype/ftglyph.h).
376 </td></tr></table><br>
377 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
378
379   <span class="keyword">typedef</span> <span class="keyword">enum</span>  FT_Glyph_BBox_Mode_
380   {
381     <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a>  = 0,
382     <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a> = 0,
383     <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>   = 1,
384     <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>  = 2,
385     <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>    = 3
386
387   } <b>FT_Glyph_BBox_Mode</b>;
388
389 </pre></table><br>
390 <table align=center width="87%"><tr><td>
391 <p>The mode how the values of <a href="ft2-glyph_management.html#FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a> are returned.</p>
392 </td></tr></table><br>
393 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
394 <p></p>
395 <table cellpadding=3 border=0>
396 <tr valign=top><td><b>FT_GLYPH_BBOX_UNSCALED</b></td><td>
397 <p>Return unscaled font units.</p>
398 </td></tr>
399 <tr valign=top><td colspan=0><b>FT_GLYPH_BBOX_SUBPIXELS</b></td></tr>
400 <tr valign=top><td></td><td>
401 <p>Return unfitted 26.6 coordinates.</p>
402 </td></tr>
403 <tr valign=top><td><b>FT_GLYPH_BBOX_GRIDFIT</b></td><td>
404 <p>Return grid-fitted 26.6 coordinates.</p>
405 </td></tr>
406 <tr valign=top><td><b>FT_GLYPH_BBOX_TRUNCATE</b></td><td>
407 <p>Return coordinates in integer pixels.</p>
408 </td></tr>
409 <tr valign=top><td><b>FT_GLYPH_BBOX_PIXELS</b></td><td>
410 <p>Return grid-fitted pixel coordinates.</p>
411 </td></tr>
412 </table>
413 </td></tr></table>
414 </td></tr></table>
415 <hr width="75%">
416 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
417 <td width="100%"></td>
418 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
419
420 <table align=center width="75%"><tr><td>
421 <h4><a name="ft_glyph_bbox_xxx">ft_glyph_bbox_xxx</a></h4>
422 <table align=center width="87%"><tr><td>
423 Defined in FT_GLYPH_H (freetype/ftglyph.h).
424 </td></tr></table><br>
425 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
426
427 #define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_unscaled</a>   <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a>
428 #define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_subpixels</a>  <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a>
429 #define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_gridfit</a>    <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>
430 #define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_truncate</a>   <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>
431 #define <a href="ft2-glyph_management.html#ft_glyph_bbox_xxx">ft_glyph_bbox_pixels</a>     <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>
432
433 </pre></table><br>
434 <table align=center width="87%"><tr><td>
435 <p>These constants are deprecated. Use the corresponding <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a> values instead.</p>
436 </td></tr></table><br>
437 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
438 <p></p>
439 <table cellpadding=3 border=0>
440 <tr valign=top><td><b>ft_glyph_bbox_unscaled</b></td><td>
441 <p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a>.</p>
442 </td></tr>
443 <tr valign=top><td colspan=0><b>ft_glyph_bbox_subpixels</b></td></tr>
444 <tr valign=top><td></td><td>
445 <p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a>.</p>
446 </td></tr>
447 <tr valign=top><td><b>ft_glyph_bbox_gridfit</b></td><td>
448 <p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>.</p>
449 </td></tr>
450 <tr valign=top><td><b>ft_glyph_bbox_truncate</b></td><td>
451 <p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>.</p>
452 </td></tr>
453 <tr valign=top><td><b>ft_glyph_bbox_pixels</b></td><td>
454 <p>See <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>.</p>
455 </td></tr>
456 </table>
457 </td></tr></table>
458 </td></tr></table>
459 <hr width="75%">
460 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
461 <td width="100%"></td>
462 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
463
464 <table align=center width="75%"><tr><td>
465 <h4><a name="FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a></h4>
466 <table align=center width="87%"><tr><td>
467 Defined in FT_GLYPH_H (freetype/ftglyph.h).
468 </td></tr></table><br>
469 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
470
471   FT_EXPORT( <span class="keyword">void</span> )
472   <b>FT_Glyph_Get_CBox</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>  glyph,
473                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>   bbox_mode,
474                      <a href="ft2-basic_types.html#FT_BBox">FT_BBox</a>  *acbox );
475
476 </pre></table><br>
477 <table align=center width="87%"><tr><td>
478 <p>Return a glyph's &lsquo;control box&rsquo;. The control box encloses all the outline's points, including Bézier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline which contains Bézier outside arcs).</p>
479 <p>Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the &lsquo;ftbbox&rsquo; component which is dedicated to this single task.</p>
480 </td></tr></table><br>
481 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
482 <p></p>
483 <table cellpadding=3 border=0>
484 <tr valign=top><td><b>glyph</b></td><td>
485 <p>A handle to the source glyph object.</p>
486 </td></tr>
487 <tr valign=top><td><b>mode</b></td><td>
488 <p>The mode which indicates how to interpret the returned bounding box values.</p>
489 </td></tr>
490 </table>
491 </td></tr></table>
492 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
493 <p></p>
494 <table cellpadding=3 border=0>
495 <tr valign=top><td><b>acbox</b></td><td>
496 <p>The glyph coordinate bounding box. Coordinates are expressed in 1/64th of pixels if it is grid-fitted.</p>
497 </td></tr>
498 </table>
499 </td></tr></table>
500 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
501 <p>Coordinates are relative to the glyph origin, using the y&nbsp;upwards convention.</p>
502 <p>If the glyph has been loaded with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>, &lsquo;bbox_mode&rsquo; must be set to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_UNSCALED</a> to get unscaled font units in 26.6 pixel format. The value <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_SUBPIXELS</a> is another name for this constant.</p>
503 <p>If the font is tricky and the glyph has been loaded with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>, the resulting CBox is meaningless. To get reasonable values for the CBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the CBox which can be eventually converted back to font units.</p>
504 <p>Note that the maximum coordinates are exclusive, which means that one can compute the width and height of the glyph image (be it in integer or 26.6 pixels) as:</p>
505 <pre class="colored">
506   width  = bbox.xMax - bbox.xMin;                                  
507   height = bbox.yMax - bbox.yMin;                                  
508 </pre>
509 <p>Note also that for 26.6 coordinates, if &lsquo;bbox_mode&rsquo; is set to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>, the coordinates will also be grid-fitted, which corresponds to:</p>
510 <pre class="colored">
511   bbox.xMin = FLOOR(bbox.xMin);                                    
512   bbox.yMin = FLOOR(bbox.yMin);                                    
513   bbox.xMax = CEILING(bbox.xMax);                                  
514   bbox.yMax = CEILING(bbox.yMax);                                  
515 </pre>
516 <p>To get the bbox in pixel coordinates, set &lsquo;bbox_mode&rsquo; to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>.</p>
517 <p>To get the bbox in grid-fitted pixel coordinates, set &lsquo;bbox_mode&rsquo; to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>.</p>
518 </td></tr></table>
519 </td></tr></table>
520 <hr width="75%">
521 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
522 <td width="100%"></td>
523 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
524
525 <table align=center width="75%"><tr><td>
526 <h4><a name="FT_Glyph_To_Bitmap">FT_Glyph_To_Bitmap</a></h4>
527 <table align=center width="87%"><tr><td>
528 Defined in FT_GLYPH_H (freetype/ftglyph.h).
529 </td></tr></table><br>
530 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
531
532   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
533   <b>FT_Glyph_To_Bitmap</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>*       the_glyph,
534                       <a href="ft2-base_interface.html#FT_Render_Mode">FT_Render_Mode</a>  render_mode,
535                       <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>*      origin,
536                       <a href="ft2-basic_types.html#FT_Bool">FT_Bool</a>         destroy );
537
538 </pre></table><br>
539 <table align=center width="87%"><tr><td>
540 <p>Convert a given glyph object to a bitmap glyph object.</p>
541 </td></tr></table><br>
542 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
543 <p></p>
544 <table cellpadding=3 border=0>
545 <tr valign=top><td><b>the_glyph</b></td><td>
546 <p>A pointer to a handle to the target glyph.</p>
547 </td></tr>
548 </table>
549 </td></tr></table>
550 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
551 <p></p>
552 <table cellpadding=3 border=0>
553 <tr valign=top><td><b>render_mode</b></td><td>
554 <p>An enumeration that describes how the data is rendered.</p>
555 </td></tr>
556 <tr valign=top><td><b>origin</b></td><td>
557 <p>A pointer to a vector used to translate the glyph image before rendering. Can be&nbsp;0 (if no translation). The origin is expressed in 26.6 pixels.</p>
558 </td></tr>
559 <tr valign=top><td><b>destroy</b></td><td>
560 <p>A boolean that indicates that the original glyph image should be destroyed by this function. It is never destroyed in case of error.</p>
561 </td></tr>
562 </table>
563 </td></tr></table>
564 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
565 <p>FreeType error code. 0&nbsp;means success.</p>
566 </td></tr></table>
567 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
568 <p>This function does nothing if the glyph format isn't scalable.</p>
569 <p>The glyph image is translated with the &lsquo;origin&rsquo; vector before rendering.</p>
570 <p>The first parameter is a pointer to an <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> handle, that will be <i>replaced</i> by this function (with newly allocated data). Typically, you would use (omitting error handling):</p>
571 <p></p>
572 <pre class="colored">
573   FT_Glyph        glyph;                                         
574   FT_BitmapGlyph  glyph_bitmap;                                  
575                                                                  
576                                                                  
577   // load glyph                                                  
578   error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     
579                                                                  
580   // extract glyph image                                         
581   error = FT_Get_Glyph( face-&gt;glyph, &amp;glyph );                   
582                                                                  
583   // convert to a bitmap (default render mode + destroying old)  
584   if ( glyph-&gt;format != FT_GLYPH_FORMAT_BITMAP )                 
585   {                                                              
586     error = FT_Glyph_To_Bitmap( &amp;glyph, FT_RENDER_MODE_NORMAL,   
587                                 0, 1 );                          
588     if ( error ) // `glyph' unchanged                            
589       ...                                                        
590   }                                                              
591                                                                  
592   // access bitmap content by typecasting                        
593   glyph_bitmap = (FT_BitmapGlyph)glyph;                          
594                                                                  
595   // do funny stuff with it, like blitting/drawing               
596   ...                                                            
597                                                                  
598   // discard glyph image (bitmap or not)                         
599   FT_Done_Glyph( glyph );                                        
600 </pre>
601 <p></p>
602 <p>Here another example, again without error handling:</p>
603 <p></p>
604 <pre class="colored">
605   FT_Glyph  glyphs[MAX_GLYPHS]                                   
606                                                                  
607                                                                  
608   ...                                                            
609                                                                  
610   for ( idx = 0; i &lt; MAX_GLYPHS; i++ )                           
611     error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       
612             FT_Get_Glyph ( face-&gt;glyph, &amp;glyph[idx] );           
613                                                                  
614   ...                                                            
615                                                                  
616   for ( idx = 0; i &lt; MAX_GLYPHS; i++ )                           
617   {                                                              
618     FT_Glyph  bitmap = glyphs[idx];                              
619                                                                  
620                                                                  
621     ...                                                          
622                                                                  
623     // after this call, `bitmap' no longer points into           
624     // the `glyphs' array (and the old value isn't destroyed)    
625     FT_Glyph_To_Bitmap( &amp;bitmap, FT_RENDER_MODE_MONO, 0, 0 );    
626                                                                  
627     ...                                                          
628                                                                  
629     FT_Done_Glyph( bitmap );                                     
630   }                                                              
631                                                                  
632   ...                                                            
633                                                                  
634   for ( idx = 0; i &lt; MAX_GLYPHS; i++ )                           
635     FT_Done_Glyph( glyphs[idx] );                                
636 </pre>
637 </td></tr></table>
638 </td></tr></table>
639 <hr width="75%">
640 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
641 <td width="100%"></td>
642 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
643
644 <table align=center width="75%"><tr><td>
645 <h4><a name="FT_Done_Glyph">FT_Done_Glyph</a></h4>
646 <table align=center width="87%"><tr><td>
647 Defined in FT_GLYPH_H (freetype/ftglyph.h).
648 </td></tr></table><br>
649 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
650
651   FT_EXPORT( <span class="keyword">void</span> )
652   <b>FT_Done_Glyph</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>  glyph );
653
654 </pre></table><br>
655 <table align=center width="87%"><tr><td>
656 <p>Destroy a given glyph.</p>
657 </td></tr></table><br>
658 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
659 <p></p>
660 <table cellpadding=3 border=0>
661 <tr valign=top><td><b>glyph</b></td><td>
662 <p>A handle to the target glyph object.</p>
663 </td></tr>
664 </table>
665 </td></tr></table>
666 </td></tr></table>
667 <hr width="75%">
668 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
669 <td width="100%"></td>
670 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
671
672 </body>
673 </html>