1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
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;
10 background: #FFFFFF; }
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;
19 a:link { color: #0000EF; }
20 a:visited { color: #51188E; }
21 a:hover { color: #FF0000; }
23 span.keyword { font-family: monospace;
28 pre.colored { color: blue; }
30 ul.empty { list-style-type: none; }
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>
44 <table align=center cellspacing=5 cellpadding=0 border=0>
45 <tr><td></td><td><a href="#FT_MulDiv">FT_MulDiv</a></td><td></td><td><a href="#FT_Matrix_Invert">FT_Matrix_Invert</a></td><td></td><td><a href="#FT_Tan">FT_Tan</a></td></tr>
46 <tr><td></td><td><a href="#FT_MulFix">FT_MulFix</a></td><td></td><td><a href="#FT_Angle">FT_Angle</a></td><td></td><td><a href="#FT_Atan2">FT_Atan2</a></td></tr>
47 <tr><td></td><td><a href="#FT_DivFix">FT_DivFix</a></td><td></td><td><a href="#FT_ANGLE_PI">FT_ANGLE_PI</a></td><td></td><td><a href="#FT_Angle_Diff">FT_Angle_Diff</a></td></tr>
48 <tr><td></td><td><a href="#FT_RoundFix">FT_RoundFix</a></td><td></td><td><a href="#FT_ANGLE_2PI">FT_ANGLE_2PI</a></td><td></td><td><a href="#FT_Vector_Unit">FT_Vector_Unit</a></td></tr>
49 <tr><td></td><td><a href="#FT_CeilFix">FT_CeilFix</a></td><td></td><td><a href="#FT_ANGLE_PI2">FT_ANGLE_PI2</a></td><td></td><td><a href="#FT_Vector_Rotate">FT_Vector_Rotate</a></td></tr>
50 <tr><td></td><td><a href="#FT_FloorFix">FT_FloorFix</a></td><td></td><td><a href="#FT_ANGLE_PI4">FT_ANGLE_PI4</a></td><td></td><td><a href="#FT_Vector_Length">FT_Vector_Length</a></td></tr>
51 <tr><td></td><td><a href="#FT_Vector_Transform">FT_Vector_Transform</a></td><td></td><td><a href="#FT_Sin">FT_Sin</a></td><td></td><td><a href="#FT_Vector_Polarize">FT_Vector_Polarize</a></td></tr>
52 <tr><td></td><td><a href="#FT_Matrix_Multiply">FT_Matrix_Multiply</a></td><td></td><td><a href="#FT_Cos">FT_Cos</a></td><td></td><td><a href="#FT_Vector_From_Polar">FT_Vector_From_Polar</a></td></tr>
55 <table align=center width="87%"><tr><td>
56 <p>This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors.</p>
57 </td></tr></table><br>
58 <table align=center width="75%"><tr><td>
59 <h4><a name="FT_MulDiv">FT_MulDiv</a></h4>
60 <table align=center width="87%"><tr><td>
61 Defined in FT_FREETYPE_H (freetype/freetype.h).
62 </td></tr></table><br>
63 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
65 FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
66 <b>FT_MulDiv</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> a,
67 <a href="ft2-basic_types.html#FT_Long">FT_Long</a> b,
68 <a href="ft2-basic_types.html#FT_Long">FT_Long</a> c );
71 <table align=center width="87%"><tr><td>
72 <p>A very simple function used to perform the computation ‘(a*b)/c’ with maximal accuracy (it uses a 64-bit intermediate integer whenever necessary).</p>
73 <p>This function isn't necessarily as fast as some processor specific operations, but is at least completely portable.</p>
74 </td></tr></table><br>
75 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
77 <table cellpadding=3 border=0>
78 <tr valign=top><td><b>a</b></td><td>
79 <p>The first multiplier.</p>
81 <tr valign=top><td><b>b</b></td><td>
82 <p>The second multiplier.</p>
84 <tr valign=top><td><b>c</b></td><td>
89 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
90 <p>The result of ‘(a*b)/c’. This function never traps when trying to divide by zero; it simply returns ‘MaxInt’ or ‘MinInt’ depending on the signs of ‘a’ and ‘b’.</p>
94 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
95 <td width="100%"></td>
96 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
98 <table align=center width="75%"><tr><td>
99 <h4><a name="FT_MulFix">FT_MulFix</a></h4>
100 <table align=center width="87%"><tr><td>
101 Defined in FT_FREETYPE_H (freetype/freetype.h).
102 </td></tr></table><br>
103 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
105 FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
106 <b>FT_MulFix</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> a,
107 <a href="ft2-basic_types.html#FT_Long">FT_Long</a> b );
110 <table align=center width="87%"><tr><td>
111 <p>A very simple function used to perform the computation ‘(a*b)/0x10000’ with maximal accuracy. Most of the time this is used to multiply a given value by a 16.16 fixed float factor.</p>
112 </td></tr></table><br>
113 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
115 <table cellpadding=3 border=0>
116 <tr valign=top><td><b>a</b></td><td>
117 <p>The first multiplier.</p>
119 <tr valign=top><td><b>b</b></td><td>
120 <p>The second multiplier. Use a 16.16 factor here whenever possible (see note below).</p>
124 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
125 <p>The result of ‘(a*b)/0x10000’.</p>
127 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
128 <p>This function has been optimized for the case where the absolute value of ‘a’ is less than 2048, and ‘b’ is a 16.16 scaling factor. As this happens mainly when scaling from notional units to fractional pixels in FreeType, it resulted in noticeable speed improvements between versions 2.x and 1.x.</p>
129 <p>As a conclusion, always try to place a 16.16 factor as the <i>second</i> argument of this function; this can make a great difference.</p>
133 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
134 <td width="100%"></td>
135 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
137 <table align=center width="75%"><tr><td>
138 <h4><a name="FT_DivFix">FT_DivFix</a></h4>
139 <table align=center width="87%"><tr><td>
140 Defined in FT_FREETYPE_H (freetype/freetype.h).
141 </td></tr></table><br>
142 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
144 FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
145 <b>FT_DivFix</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> a,
146 <a href="ft2-basic_types.html#FT_Long">FT_Long</a> b );
149 <table align=center width="87%"><tr><td>
150 <p>A very simple function used to perform the computation ‘(a*0x10000)/b’ with maximal accuracy. Most of the time, this is used to divide a given value by a 16.16 fixed float factor.</p>
151 </td></tr></table><br>
152 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
154 <table cellpadding=3 border=0>
155 <tr valign=top><td><b>a</b></td><td>
156 <p>The first multiplier.</p>
158 <tr valign=top><td><b>b</b></td><td>
159 <p>The second multiplier. Use a 16.16 factor here whenever possible (see note below).</p>
163 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
164 <p>The result of ‘(a*0x10000)/b’.</p>
166 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
167 <p>The optimization for FT_DivFix() is simple: If (a << 16) fits in 32 bits, then the division is computed directly. Otherwise, we use a specialized version of <a href="ft2-computations.html#FT_MulDiv">FT_MulDiv</a>.</p>
171 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
172 <td width="100%"></td>
173 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
175 <table align=center width="75%"><tr><td>
176 <h4><a name="FT_RoundFix">FT_RoundFix</a></h4>
177 <table align=center width="87%"><tr><td>
178 Defined in FT_FREETYPE_H (freetype/freetype.h).
179 </td></tr></table><br>
180 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
182 FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
183 <b>FT_RoundFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> a );
186 <table align=center width="87%"><tr><td>
187 <p>A very simple function used to round a 16.16 fixed number.</p>
188 </td></tr></table><br>
189 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
191 <table cellpadding=3 border=0>
192 <tr valign=top><td><b>a</b></td><td>
193 <p>The number to be rounded.</p>
197 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
198 <p>The result of ‘(a + 0x8000) & -0x10000’.</p>
202 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
203 <td width="100%"></td>
204 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
206 <table align=center width="75%"><tr><td>
207 <h4><a name="FT_CeilFix">FT_CeilFix</a></h4>
208 <table align=center width="87%"><tr><td>
209 Defined in FT_FREETYPE_H (freetype/freetype.h).
210 </td></tr></table><br>
211 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
213 FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
214 <b>FT_CeilFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> a );
217 <table align=center width="87%"><tr><td>
218 <p>A very simple function used to compute the ceiling function of a 16.16 fixed number.</p>
219 </td></tr></table><br>
220 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
222 <table cellpadding=3 border=0>
223 <tr valign=top><td><b>a</b></td><td>
224 <p>The number for which the ceiling function is to be computed.</p>
228 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
229 <p>The result of ‘(a + 0x10000 - 1) & -0x10000’.</p>
233 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
234 <td width="100%"></td>
235 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
237 <table align=center width="75%"><tr><td>
238 <h4><a name="FT_FloorFix">FT_FloorFix</a></h4>
239 <table align=center width="87%"><tr><td>
240 Defined in FT_FREETYPE_H (freetype/freetype.h).
241 </td></tr></table><br>
242 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
244 FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
245 <b>FT_FloorFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> a );
248 <table align=center width="87%"><tr><td>
249 <p>A very simple function used to compute the floor function of a 16.16 fixed number.</p>
250 </td></tr></table><br>
251 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
253 <table cellpadding=3 border=0>
254 <tr valign=top><td><b>a</b></td><td>
255 <p>The number for which the floor function is to be computed.</p>
259 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
260 <p>The result of ‘a & -0x10000’.</p>
264 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
265 <td width="100%"></td>
266 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
268 <table align=center width="75%"><tr><td>
269 <h4><a name="FT_Vector_Transform">FT_Vector_Transform</a></h4>
270 <table align=center width="87%"><tr><td>
271 Defined in FT_FREETYPE_H (freetype/freetype.h).
272 </td></tr></table><br>
273 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
275 FT_EXPORT( <span class="keyword">void</span> )
276 <b>FT_Vector_Transform</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
277 <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* matrix );
280 <table align=center width="87%"><tr><td>
281 <p>Transform a single vector through a 2x2 matrix.</p>
282 </td></tr></table><br>
283 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
285 <table cellpadding=3 border=0>
286 <tr valign=top><td><b>vector</b></td><td>
287 <p>The target vector to transform.</p>
291 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
293 <table cellpadding=3 border=0>
294 <tr valign=top><td><b>matrix</b></td><td>
295 <p>A pointer to the source 2x2 matrix.</p>
299 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
300 <p>The result is undefined if either ‘vector’ or ‘matrix’ is invalid.</p>
304 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
305 <td width="100%"></td>
306 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
308 <table align=center width="75%"><tr><td>
309 <h4><a name="FT_Matrix_Multiply">FT_Matrix_Multiply</a></h4>
310 <table align=center width="87%"><tr><td>
311 Defined in FT_GLYPH_H (freetype/ftglyph.h).
312 </td></tr></table><br>
313 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
315 FT_EXPORT( <span class="keyword">void</span> )
316 <b>FT_Matrix_Multiply</b>( <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* a,
317 <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* b );
320 <table align=center width="87%"><tr><td>
321 <p>Perform the matrix operation ‘b = a*b’.</p>
322 </td></tr></table><br>
323 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
325 <table cellpadding=3 border=0>
326 <tr valign=top><td><b>a</b></td><td>
327 <p>A pointer to matrix ‘a’.</p>
331 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
333 <table cellpadding=3 border=0>
334 <tr valign=top><td><b>b</b></td><td>
335 <p>A pointer to matrix ‘b’.</p>
339 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
340 <p>The result is undefined if either ‘a’ or ‘b’ is zero.</p>
344 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
345 <td width="100%"></td>
346 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
348 <table align=center width="75%"><tr><td>
349 <h4><a name="FT_Matrix_Invert">FT_Matrix_Invert</a></h4>
350 <table align=center width="87%"><tr><td>
351 Defined in FT_GLYPH_H (freetype/ftglyph.h).
352 </td></tr></table><br>
353 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
355 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
356 <b>FT_Matrix_Invert</b>( <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* matrix );
359 <table align=center width="87%"><tr><td>
360 <p>Invert a 2x2 matrix. Return an error if it can't be inverted.</p>
361 </td></tr></table><br>
362 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
364 <table cellpadding=3 border=0>
365 <tr valign=top><td><b>matrix</b></td><td>
366 <p>A pointer to the target matrix. Remains untouched in case of error.</p>
370 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
371 <p>FreeType error code. 0 means success.</p>
375 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
376 <td width="100%"></td>
377 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
379 <table align=center width="75%"><tr><td>
380 <h4><a name="FT_Angle">FT_Angle</a></h4>
381 <table align=center width="87%"><tr><td>
382 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
383 </td></tr></table><br>
384 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
386 <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> <b>FT_Angle</b>;
389 <table align=center width="87%"><tr><td>
390 <p>This type is used to model angle values in FreeType. Note that the angle is a 16.16 fixed float value expressed in degrees.</p>
391 </td></tr></table><br>
394 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
395 <td width="100%"></td>
396 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
398 <table align=center width="75%"><tr><td>
399 <h4><a name="FT_ANGLE_PI">FT_ANGLE_PI</a></h4>
400 <table align=center width="87%"><tr><td>
401 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
402 </td></tr></table><br>
403 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
405 #define <b>FT_ANGLE_PI</b> ( 180L << 16 )
408 <table align=center width="87%"><tr><td>
409 <p>The angle pi expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
410 </td></tr></table><br>
413 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
414 <td width="100%"></td>
415 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
417 <table align=center width="75%"><tr><td>
418 <h4><a name="FT_ANGLE_2PI">FT_ANGLE_2PI</a></h4>
419 <table align=center width="87%"><tr><td>
420 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
421 </td></tr></table><br>
422 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
424 #define <b>FT_ANGLE_2PI</b> ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> * 2 )
427 <table align=center width="87%"><tr><td>
428 <p>The angle 2*pi expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
429 </td></tr></table><br>
432 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
433 <td width="100%"></td>
434 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
436 <table align=center width="75%"><tr><td>
437 <h4><a name="FT_ANGLE_PI2">FT_ANGLE_PI2</a></h4>
438 <table align=center width="87%"><tr><td>
439 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
440 </td></tr></table><br>
441 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
443 #define <b>FT_ANGLE_PI2</b> ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> / 2 )
446 <table align=center width="87%"><tr><td>
447 <p>The angle pi/2 expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
448 </td></tr></table><br>
451 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
452 <td width="100%"></td>
453 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
455 <table align=center width="75%"><tr><td>
456 <h4><a name="FT_ANGLE_PI4">FT_ANGLE_PI4</a></h4>
457 <table align=center width="87%"><tr><td>
458 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
459 </td></tr></table><br>
460 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
462 #define <b>FT_ANGLE_PI4</b> ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> / 4 )
465 <table align=center width="87%"><tr><td>
466 <p>The angle pi/4 expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
467 </td></tr></table><br>
470 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
471 <td width="100%"></td>
472 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
474 <table align=center width="75%"><tr><td>
475 <h4><a name="FT_Sin">FT_Sin</a></h4>
476 <table align=center width="87%"><tr><td>
477 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
478 </td></tr></table><br>
479 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
481 FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
482 <b>FT_Sin</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
485 <table align=center width="87%"><tr><td>
486 <p>Return the sinus of a given angle in fixed point format.</p>
487 </td></tr></table><br>
488 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
490 <table cellpadding=3 border=0>
491 <tr valign=top><td><b>angle</b></td><td>
492 <p>The input angle.</p>
496 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
497 <p>The sinus value.</p>
499 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
500 <p>If you need both the sinus and cosinus for a given angle, use the function <a href="ft2-computations.html#FT_Vector_Unit">FT_Vector_Unit</a>.</p>
504 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
505 <td width="100%"></td>
506 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
508 <table align=center width="75%"><tr><td>
509 <h4><a name="FT_Cos">FT_Cos</a></h4>
510 <table align=center width="87%"><tr><td>
511 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
512 </td></tr></table><br>
513 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
515 FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
516 <b>FT_Cos</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
519 <table align=center width="87%"><tr><td>
520 <p>Return the cosinus of a given angle in fixed point format.</p>
521 </td></tr></table><br>
522 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
524 <table cellpadding=3 border=0>
525 <tr valign=top><td><b>angle</b></td><td>
526 <p>The input angle.</p>
530 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
531 <p>The cosinus value.</p>
533 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
534 <p>If you need both the sinus and cosinus for a given angle, use the function <a href="ft2-computations.html#FT_Vector_Unit">FT_Vector_Unit</a>.</p>
538 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
539 <td width="100%"></td>
540 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
542 <table align=center width="75%"><tr><td>
543 <h4><a name="FT_Tan">FT_Tan</a></h4>
544 <table align=center width="87%"><tr><td>
545 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
546 </td></tr></table><br>
547 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
549 FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
550 <b>FT_Tan</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
553 <table align=center width="87%"><tr><td>
554 <p>Return the tangent of a given angle in fixed point format.</p>
555 </td></tr></table><br>
556 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
558 <table cellpadding=3 border=0>
559 <tr valign=top><td><b>angle</b></td><td>
560 <p>The input angle.</p>
564 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
565 <p>The tangent value.</p>
569 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
570 <td width="100%"></td>
571 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
573 <table align=center width="75%"><tr><td>
574 <h4><a name="FT_Atan2">FT_Atan2</a></h4>
575 <table align=center width="87%"><tr><td>
576 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
577 </td></tr></table><br>
578 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
580 FT_EXPORT( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> )
581 <b>FT_Atan2</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> x,
582 <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> y );
585 <table align=center width="87%"><tr><td>
586 <p>Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane.</p>
587 </td></tr></table><br>
588 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
590 <table cellpadding=3 border=0>
591 <tr valign=top><td><b>x</b></td><td>
592 <p>The horizontal vector coordinate.</p>
594 <tr valign=top><td><b>y</b></td><td>
595 <p>The vertical vector coordinate.</p>
599 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
600 <p>The arc-tangent value (i.e. angle).</p>
604 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
605 <td width="100%"></td>
606 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
608 <table align=center width="75%"><tr><td>
609 <h4><a name="FT_Angle_Diff">FT_Angle_Diff</a></h4>
610 <table align=center width="87%"><tr><td>
611 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
612 </td></tr></table><br>
613 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
615 FT_EXPORT( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> )
616 <b>FT_Angle_Diff</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle1,
617 <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle2 );
620 <table align=center width="87%"><tr><td>
621 <p>Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval.</p>
622 </td></tr></table><br>
623 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
625 <table cellpadding=3 border=0>
626 <tr valign=top><td><b>angle1</b></td><td>
629 <tr valign=top><td><b>angle2</b></td><td>
634 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
635 <p>Constrained value of ‘value2-value1’.</p>
639 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
640 <td width="100%"></td>
641 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
643 <table align=center width="75%"><tr><td>
644 <h4><a name="FT_Vector_Unit">FT_Vector_Unit</a></h4>
645 <table align=center width="87%"><tr><td>
646 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
647 </td></tr></table><br>
648 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
650 FT_EXPORT( <span class="keyword">void</span> )
651 <b>FT_Vector_Unit</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
652 <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
655 <table align=center width="87%"><tr><td>
656 <p>Return the unit vector corresponding to a given angle. After the call, the value of ‘vec.x’ will be ‘sin(angle)’, and the value of ‘vec.y’ will be ‘cos(angle)’.</p>
657 <p>This function is useful to retrieve both the sinus and cosinus of a given angle quickly.</p>
658 </td></tr></table><br>
659 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
661 <table cellpadding=3 border=0>
662 <tr valign=top><td><b>vec</b></td><td>
663 <p>The address of target vector.</p>
667 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
669 <table cellpadding=3 border=0>
670 <tr valign=top><td><b>angle</b></td><td>
671 <p>The address of angle.</p>
677 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
678 <td width="100%"></td>
679 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
681 <table align=center width="75%"><tr><td>
682 <h4><a name="FT_Vector_Rotate">FT_Vector_Rotate</a></h4>
683 <table align=center width="87%"><tr><td>
684 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
685 </td></tr></table><br>
686 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
688 FT_EXPORT( <span class="keyword">void</span> )
689 <b>FT_Vector_Rotate</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
690 <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
693 <table align=center width="87%"><tr><td>
694 <p>Rotate a vector by a given angle.</p>
695 </td></tr></table><br>
696 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
698 <table cellpadding=3 border=0>
699 <tr valign=top><td><b>vec</b></td><td>
700 <p>The address of target vector.</p>
704 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
706 <table cellpadding=3 border=0>
707 <tr valign=top><td><b>angle</b></td><td>
708 <p>The address of angle.</p>
714 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
715 <td width="100%"></td>
716 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
718 <table align=center width="75%"><tr><td>
719 <h4><a name="FT_Vector_Length">FT_Vector_Length</a></h4>
720 <table align=center width="87%"><tr><td>
721 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
722 </td></tr></table><br>
723 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
725 FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
726 <b>FT_Vector_Length</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec );
729 <table align=center width="87%"><tr><td>
730 <p>Return the length of a given vector.</p>
731 </td></tr></table><br>
732 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
734 <table cellpadding=3 border=0>
735 <tr valign=top><td><b>vec</b></td><td>
736 <p>The address of target vector.</p>
740 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
741 <p>The vector length, expressed in the same units that the original vector coordinates.</p>
745 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
746 <td width="100%"></td>
747 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
749 <table align=center width="75%"><tr><td>
750 <h4><a name="FT_Vector_Polarize">FT_Vector_Polarize</a></h4>
751 <table align=center width="87%"><tr><td>
752 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
753 </td></tr></table><br>
754 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
756 FT_EXPORT( <span class="keyword">void</span> )
757 <b>FT_Vector_Polarize</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
758 <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> *length,
759 <a href="ft2-computations.html#FT_Angle">FT_Angle</a> *angle );
762 <table align=center width="87%"><tr><td>
763 <p>Compute both the length and angle of a given vector.</p>
764 </td></tr></table><br>
765 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
767 <table cellpadding=3 border=0>
768 <tr valign=top><td><b>vec</b></td><td>
769 <p>The address of source vector.</p>
773 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
775 <table cellpadding=3 border=0>
776 <tr valign=top><td><b>length</b></td><td>
777 <p>The vector length.</p>
779 <tr valign=top><td><b>angle</b></td><td>
780 <p>The vector angle.</p>
786 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
787 <td width="100%"></td>
788 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
790 <table align=center width="75%"><tr><td>
791 <h4><a name="FT_Vector_From_Polar">FT_Vector_From_Polar</a></h4>
792 <table align=center width="87%"><tr><td>
793 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
794 </td></tr></table><br>
795 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
797 FT_EXPORT( <span class="keyword">void</span> )
798 <b>FT_Vector_From_Polar</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
799 <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> length,
800 <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
803 <table align=center width="87%"><tr><td>
804 <p>Compute vector coordinates from a length and angle.</p>
805 </td></tr></table><br>
806 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
808 <table cellpadding=3 border=0>
809 <tr valign=top><td><b>vec</b></td><td>
810 <p>The address of source vector.</p>
814 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
816 <table cellpadding=3 border=0>
817 <tr valign=top><td><b>length</b></td><td>
818 <p>The vector length.</p>
820 <tr valign=top><td><b>angle</b></td><td>
821 <p>The vector angle.</p>
827 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
828 <td width="100%"></td>
829 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>