1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>FreeType-2.4.1 API Reference</title>
<style type="text/css">
body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
color: #000000;
background: #FFFFFF; }
p { text-align: justify; }
h1 { text-align: center; }
li { text-align: justify; }
td { padding: 0 0.5em 0 0.5em; }
td.left { padding: 0 0.5em 0 0.5em;
text-align: left; }
a:link { color: #0000EF; }
a:visited { color: #51188E; }
a:hover { color: #FF0000; }
span.keyword { font-family: monospace;
text-align: left;
white-space: pre;
color: darkblue; }
pre.colored { color: blue; }
ul.empty { list-style-type: none; }
</style>
</head>
<body>
<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<center><h1>FreeType-2.4.1 API Reference</h1></center>
<center><h1>
Computations
</h1></center>
<h2>Synopsis</h2>
<table align=center cellspacing=5 cellpadding=0 border=0>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
</table><br><br>
<table align=center width="87%"><tr><td>
<p>This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors.</p>
</td></tr></table><br>
<table align=center width="75%"><tr><td>
<h4><a name="FT_MulDiv">FT_MulDiv</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_FREETYPE_H (freetype/freetype.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
<b>FT_MulDiv</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> a,
<a href="ft2-basic_types.html#FT_Long">FT_Long</a> b,
<a href="ft2-basic_types.html#FT_Long">FT_Long</a> c );
</pre></table><br>
<table align=center width="87%"><tr><td>
<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>
<p>This function isn't necessarily as fast as some processor specific operations, but is at least completely portable.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>a</b></td><td>
<p>The first multiplier.</p>
</td></tr>
<tr valign=top><td><b>b</b></td><td>
<p>The second multiplier.</p>
</td></tr>
<tr valign=top><td><b>c</b></td><td>
<p>The divisor.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<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>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_MulFix">FT_MulFix</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_FREETYPE_H (freetype/freetype.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
<b>FT_MulFix</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> a,
<a href="ft2-basic_types.html#FT_Long">FT_Long</a> b );
</pre></table><br>
<table align=center width="87%"><tr><td>
<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>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>a</b></td><td>
<p>The first multiplier.</p>
</td></tr>
<tr valign=top><td><b>b</b></td><td>
<p>The second multiplier. Use a 16.16 factor here whenever possible (see note below).</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The result of ‘(a*b)/0x10000’.</p>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<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>
<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>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_DivFix">FT_DivFix</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_FREETYPE_H (freetype/freetype.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> )
<b>FT_DivFix</b>( <a href="ft2-basic_types.html#FT_Long">FT_Long</a> a,
<a href="ft2-basic_types.html#FT_Long">FT_Long</a> b );
</pre></table><br>
<table align=center width="87%"><tr><td>
<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>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>a</b></td><td>
<p>The first multiplier.</p>
</td></tr>
<tr valign=top><td><b>b</b></td><td>
<p>The second multiplier. Use a 16.16 factor here whenever possible (see note below).</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The result of ‘(a*0x10000)/b’.</p>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<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>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_RoundFix">FT_RoundFix</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_FREETYPE_H (freetype/freetype.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
<b>FT_RoundFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> a );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A very simple function used to round a 16.16 fixed number.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>a</b></td><td>
<p>The number to be rounded.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The result of ‘(a + 0x8000) & -0x10000’.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_CeilFix">FT_CeilFix</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_FREETYPE_H (freetype/freetype.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
<b>FT_CeilFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> a );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A very simple function used to compute the ceiling function of a 16.16 fixed number.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>a</b></td><td>
<p>The number for which the ceiling function is to be computed.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The result of ‘(a + 0x10000 - 1) & -0x10000’.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_FloorFix">FT_FloorFix</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_FREETYPE_H (freetype/freetype.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
<b>FT_FloorFix</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> a );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A very simple function used to compute the floor function of a 16.16 fixed number.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>a</b></td><td>
<p>The number for which the floor function is to be computed.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The result of ‘a & -0x10000’.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Vector_Transform">FT_Vector_Transform</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_FREETYPE_H (freetype/freetype.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <span class="keyword">void</span> )
<b>FT_Vector_Transform</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
<span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* matrix );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Transform a single vector through a 2x2 matrix.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>vector</b></td><td>
<p>The target vector to transform.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>matrix</b></td><td>
<p>A pointer to the source 2x2 matrix.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>The result is undefined if either ‘vector’ or ‘matrix’ is invalid.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Matrix_Multiply">FT_Matrix_Multiply</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_GLYPH_H (freetype/ftglyph.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <span class="keyword">void</span> )
<b>FT_Matrix_Multiply</b>( <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* a,
<a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* b );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Perform the matrix operation ‘b = a*b’.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>a</b></td><td>
<p>A pointer to matrix ‘a’.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>b</b></td><td>
<p>A pointer to matrix ‘b’.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>The result is undefined if either ‘a’ or ‘b’ is zero.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Matrix_Invert">FT_Matrix_Invert</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_GLYPH_H (freetype/ftglyph.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
<b>FT_Matrix_Invert</b>( <a href="ft2-basic_types.html#FT_Matrix">FT_Matrix</a>* matrix );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Invert a 2x2 matrix. Return an error if it can't be inverted.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>matrix</b></td><td>
<p>A pointer to the target matrix. Remains untouched in case of error.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>FreeType error code. 0 means success.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Angle">FT_Angle</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> <b>FT_Angle</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<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>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_ANGLE_PI">FT_ANGLE_PI</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_ANGLE_PI</b> ( 180L << 16 )
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>The angle pi expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_ANGLE_2PI">FT_ANGLE_2PI</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_ANGLE_2PI</b> ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> * 2 )
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>The angle 2*pi expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_ANGLE_PI2">FT_ANGLE_PI2</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_ANGLE_PI2</b> ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> / 2 )
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>The angle pi/2 expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_ANGLE_PI4">FT_ANGLE_PI4</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
#define <b>FT_ANGLE_PI4</b> ( <a href="ft2-computations.html#FT_ANGLE_PI">FT_ANGLE_PI</a> / 4 )
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>The angle pi/4 expressed in <a href="ft2-computations.html#FT_Angle">FT_Angle</a> units.</p>
</td></tr></table><br>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Sin">FT_Sin</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
<b>FT_Sin</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Return the sinus of a given angle in fixed point format.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>angle</b></td><td>
<p>The input angle.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The sinus value.</p>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<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>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Cos">FT_Cos</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
<b>FT_Cos</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Return the cosinus of a given angle in fixed point format.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>angle</b></td><td>
<p>The input angle.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The cosinus value.</p>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<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>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Tan">FT_Tan</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
<b>FT_Tan</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Return the tangent of a given angle in fixed point format.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>angle</b></td><td>
<p>The input angle.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The tangent value.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Atan2">FT_Atan2</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> )
<b>FT_Atan2</b>( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> x,
<a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> y );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>x</b></td><td>
<p>The horizontal vector coordinate.</p>
</td></tr>
<tr valign=top><td><b>y</b></td><td>
<p>The vertical vector coordinate.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The arc-tangent value (i.e. angle).</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Angle_Diff">FT_Angle_Diff</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> )
<b>FT_Angle_Diff</b>( <a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle1,
<a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle2 );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>angle1</b></td><td>
<p>First angle.</p>
</td></tr>
<tr valign=top><td><b>angle2</b></td><td>
<p>Second angle.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>Constrained value of ‘value2-value1’.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Vector_Unit">FT_Vector_Unit</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <span class="keyword">void</span> )
<b>FT_Vector_Unit</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
<a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
</pre></table><br>
<table align=center width="87%"><tr><td>
<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>
<p>This function is useful to retrieve both the sinus and cosinus of a given angle quickly.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>vec</b></td><td>
<p>The address of target vector.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>angle</b></td><td>
<p>The address of angle.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Vector_Rotate">FT_Vector_Rotate</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <span class="keyword">void</span> )
<b>FT_Vector_Rotate</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
<a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Rotate a vector by a given angle.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>vec</b></td><td>
<p>The address of target vector.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>angle</b></td><td>
<p>The address of angle.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Vector_Length">FT_Vector_Length</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> )
<b>FT_Vector_Length</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Return the length of a given vector.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>vec</b></td><td>
<p>The address of target vector.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>The vector length, expressed in the same units that the original vector coordinates.</p>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Vector_Polarize">FT_Vector_Polarize</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <span class="keyword">void</span> )
<b>FT_Vector_Polarize</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
<a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> *length,
<a href="ft2-computations.html#FT_Angle">FT_Angle</a> *angle );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Compute both the length and angle of a given vector.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>vec</b></td><td>
<p>The address of source vector.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>length</b></td><td>
<p>The vector length.</p>
</td></tr>
<tr valign=top><td><b>angle</b></td><td>
<p>The vector angle.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Vector_From_Polar">FT_Vector_From_Polar</a></h4>
<table align=center width="87%"><tr><td>
Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h).
</td></tr></table><br>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <span class="keyword">void</span> )
<b>FT_Vector_From_Polar</b>( <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>* vec,
<a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> length,
<a href="ft2-computations.html#FT_Angle">FT_Angle</a> angle );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Compute vector coordinates from a length and angle.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>vec</b></td><td>
<p>The address of source vector.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<p></p>
<table cellpadding=3 border=0>
<tr valign=top><td><b>length</b></td><td>
<p>The vector length.</p>
</td></tr>
<tr valign=top><td><b>angle</b></td><td>
<p>The vector angle.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table>
<hr width="75%">
<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
</body>
</html>
|