Debian Codegraph @

docs/reference/ft2-face_creation.html

raw symbols SCIP
1
2 <!doctype html>
3 <html lang="en" class="no-js">
4 <head>
5
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
8
9 <meta name="description" content="API Reference Documentation for FreeType-2.14.3">
10
11
12 <meta name="author" content="FreeType Contributors">
13
14
15 <link rel="canonical" href="http://freetype.org/freetype2/docs/reference/ft2-face_creation.html">
16
17
18 <link rel="prev" href="ft2-library_setup.html">
19
20
21 <link rel="next" href="ft2-font_testing_macros.html">
22
23
24 <link rel="icon" href="images/favico.ico">
25 <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.9">
26
27
28
29 <title>Face Creation - FreeType-2.14.3 API Reference</title>
30
31
32
33 <link rel="stylesheet" href="assets/stylesheets/main.4af4bdda.min.css">
34
35
36 <link rel="stylesheet" href="assets/stylesheets/palette.06af60db.min.css">
37
38
39
40
41
42
43
44
45
46
47
48
49 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
50 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
51 <style>:root{--md-text-font:"Noto Serif";--md-code-font:"Roboto Mono"}</style>
52
53
54
55 <link rel="stylesheet" href="stylesheets/extra.css">
56
57 <script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
58
59
60
61
62
63
64 </head>
65
66
67
68
69
70
71
72 <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="green" data-md-color-accent="green">
73
74
75 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
76 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
77 <label class="md-overlay" for="__drawer"></label>
78 <div data-md-component="skip">
79
80
81 <a href="#face-creation" class="md-skip">
82 Skip to content
83 </a>
84
85 </div>
86 <div data-md-component="announce">
87
88 </div>
89
90
91
92
93
94
95 <header class="md-header md-header--shadow" data-md-component="header">
96 <nav class="md-header__inner md-grid" aria-label="Header">
97 <a href="index.html" title="FreeType-2.14.3 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.14.3 API Reference" data-md-component="logo">
98
99 <img src="images/favico.ico" alt="logo">
100
101 </a>
102 <label class="md-header__button md-icon" for="__drawer">
103
104 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
105 </label>
106 <div class="md-header__title" data-md-component="header-title">
107 <div class="md-header__ellipsis">
108 <div class="md-header__topic">
109 <span class="md-ellipsis">
110 FreeType-2.14.3 API Reference
111 </span>
112 </div>
113 <div class="md-header__topic" data-md-component="header-topic">
114 <span class="md-ellipsis">
115
116 Face Creation
117
118 </span>
119 </div>
120 </div>
121 </div>
122
123
124
125
126
127
128 <label class="md-header__button md-icon" for="__search">
129
130 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
131 </label>
132 <div class="md-search" data-md-component="search" role="dialog">
133 <label class="md-search__overlay" for="__search"></label>
134 <div class="md-search__inner" role="search">
135 <form class="md-search__form" name="search">
136 <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
137 <label class="md-search__icon md-icon" for="__search">
138
139 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
140
141 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
142 </label>
143 <nav class="md-search__options" aria-label="Search">
144
145 <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
146
147 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
148 </button>
149 </nav>
150
151 </form>
152 <div class="md-search__output">
153 <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
154 <div class="md-search-result" data-md-component="search-result">
155 <div class="md-search-result__meta">
156 Initializing search
157 </div>
158 <ol class="md-search-result__list" role="presentation"></ol>
159 </div>
160 </div>
161 </div>
162 </div>
163 </div>
164
165
166 </nav>
167
168 </header>
169
170 <div class="md-container" data-md-component="container">
171
172
173
174
175
176
177 <main class="md-main" data-md-component="main">
178 <div class="md-main__inner md-grid">
179
180
181
182 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
183 <div class="md-sidebar__scrollwrap">
184 <div class="md-sidebar__inner">
185
186
187
188
189 <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
190 <label class="md-nav__title" for="__drawer">
191 <a href="index.html" title="FreeType-2.14.3 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.14.3 API Reference" data-md-component="logo">
192
193 <img src="images/favico.ico" alt="logo">
194
195 </a>
196 FreeType-2.14.3 API Reference
197 </label>
198
199 <ul class="md-nav__list" data-md-scrollfix>
200
201
202
203
204
205
206
207 <li class="md-nav__item">
208 <a href="index.html" class="md-nav__link">
209
210
211 <span class="md-ellipsis">
212 TOC
213
214 </span>
215
216
217 </a>
218 </li>
219
220
221
222
223
224
225
226
227
228 <li class="md-nav__item">
229 <a href="ft2-index.html" class="md-nav__link">
230
231
232 <span class="md-ellipsis">
233 Index
234
235 </span>
236
237
238 </a>
239 </li>
240
241
242
243
244
245
246
247
248
249
250
251
252
253 <li class="md-nav__item md-nav__item--nested">
254
255
256
257 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
258
259
260 <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
261
262
263 <span class="md-ellipsis">
264 General Remarks
265
266 </span>
267
268
269 <span class="md-nav__icon md-icon"></span>
270 </label>
271
272 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
273 <label class="md-nav__title" for="__nav_3">
274 <span class="md-nav__icon md-icon"></span>
275 General Remarks
276 </label>
277 <ul class="md-nav__list" data-md-scrollfix>
278
279
280
281
282
283
284
285 <li class="md-nav__item">
286 <a href="ft2-preamble.html" class="md-nav__link">
287
288
289 <span class="md-ellipsis">
290 Preamble
291
292 </span>
293
294
295 </a>
296 </li>
297
298
299
300
301
302
303
304
305
306
307 <li class="md-nav__item">
308 <a href="ft2-header_inclusion.html" class="md-nav__link">
309
310
311 <span class="md-ellipsis">
312 FreeType's header inclusion scheme
313
314 </span>
315
316
317 </a>
318 </li>
319
320
321
322
323
324
325
326
327
328
329 <li class="md-nav__item">
330 <a href="ft2-user_allocation.html" class="md-nav__link">
331
332
333 <span class="md-ellipsis">
334 User allocation
335
336 </span>
337
338
339 </a>
340 </li>
341
342
343
344
345 </ul>
346 </nav>
347
348 </li>
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
365
366
367
368 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" checked>
369
370
371 <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
372
373
374 <span class="md-ellipsis">
375 Core API
376
377 </span>
378
379
380 <span class="md-nav__icon md-icon"></span>
381 </label>
382
383 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="true">
384 <label class="md-nav__title" for="__nav_4">
385 <span class="md-nav__icon md-icon"></span>
386 Core API
387 </label>
388 <ul class="md-nav__list" data-md-scrollfix>
389
390
391
392
393
394
395
396 <li class="md-nav__item">
397 <a href="ft2-basic_types.html" class="md-nav__link">
398
399
400 <span class="md-ellipsis">
401 Basic Data Types
402
403 </span>
404
405
406 </a>
407 </li>
408
409
410
411
412
413
414
415
416
417
418 <li class="md-nav__item">
419 <a href="ft2-library_setup.html" class="md-nav__link">
420
421
422 <span class="md-ellipsis">
423 Library Setup
424
425 </span>
426
427
428 </a>
429 </li>
430
431
432
433
434
435
436
437
438
439
440
441
442 <li class="md-nav__item md-nav__item--active">
443
444 <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
445
446
447
448
449
450 <label class="md-nav__link md-nav__link--active" for="__toc">
451
452
453 <span class="md-ellipsis">
454 Face Creation
455
456 </span>
457
458
459 <span class="md-nav__icon md-icon"></span>
460 </label>
461
462 <a href="ft2-face_creation.html" class="md-nav__link md-nav__link--active">
463
464
465 <span class="md-ellipsis">
466 Face Creation
467
468 </span>
469
470
471 </a>
472
473
474
475 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
476
477
478
479
480
481
482 <label class="md-nav__title" for="__toc">
483 <span class="md-nav__icon md-icon"></span>
484 Table of contents
485 </label>
486 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
487
488 <li class="md-nav__item">
489 <a href="#synopsis" class="md-nav__link">
490 <span class="md-ellipsis">
491 Synopsis
492 </span>
493 </a>
494
495 </li>
496
497 <li class="md-nav__item">
498 <a href="#ft_face" class="md-nav__link">
499 <span class="md-ellipsis">
500 FT_Face
501 </span>
502 </a>
503
504 </li>
505
506 <li class="md-nav__item">
507 <a href="#ft_facerec" class="md-nav__link">
508 <span class="md-ellipsis">
509 FT_FaceRec
510 </span>
511 </a>
512
513 </li>
514
515 <li class="md-nav__item">
516 <a href="#ft_face_flag_xxx" class="md-nav__link">
517 <span class="md-ellipsis">
518 FT_FACE_FLAG_XXX
519 </span>
520 </a>
521
522 </li>
523
524 <li class="md-nav__item">
525 <a href="#ft_style_flag_xxx" class="md-nav__link">
526 <span class="md-ellipsis">
527 FT_STYLE_FLAG_XXX
528 </span>
529 </a>
530
531 </li>
532
533 <li class="md-nav__item">
534 <a href="#ft_new_face" class="md-nav__link">
535 <span class="md-ellipsis">
536 FT_New_Face
537 </span>
538 </a>
539
540 </li>
541
542 <li class="md-nav__item">
543 <a href="#ft_done_face" class="md-nav__link">
544 <span class="md-ellipsis">
545 FT_Done_Face
546 </span>
547 </a>
548
549 </li>
550
551 <li class="md-nav__item">
552 <a href="#ft_reference_face" class="md-nav__link">
553 <span class="md-ellipsis">
554 FT_Reference_Face
555 </span>
556 </a>
557
558 </li>
559
560 <li class="md-nav__item">
561 <a href="#ft_new_memory_face" class="md-nav__link">
562 <span class="md-ellipsis">
563 FT_New_Memory_Face
564 </span>
565 </a>
566
567 </li>
568
569 <li class="md-nav__item">
570 <a href="#ft_face_properties" class="md-nav__link">
571 <span class="md-ellipsis">
572 FT_Face_Properties
573 </span>
574 </a>
575
576 </li>
577
578 <li class="md-nav__item">
579 <a href="#ft_open_face" class="md-nav__link">
580 <span class="md-ellipsis">
581 FT_Open_Face
582 </span>
583 </a>
584
585 </li>
586
587 <li class="md-nav__item">
588 <a href="#ft_open_args" class="md-nav__link">
589 <span class="md-ellipsis">
590 FT_Open_Args
591 </span>
592 </a>
593
594 </li>
595
596 <li class="md-nav__item">
597 <a href="#ft_open_xxx" class="md-nav__link">
598 <span class="md-ellipsis">
599 FT_OPEN_XXX
600 </span>
601 </a>
602
603 </li>
604
605 <li class="md-nav__item">
606 <a href="#ft_parameter" class="md-nav__link">
607 <span class="md-ellipsis">
608 FT_Parameter
609 </span>
610 </a>
611
612 </li>
613
614 <li class="md-nav__item">
615 <a href="#ft_attach_file" class="md-nav__link">
616 <span class="md-ellipsis">
617 FT_Attach_File
618 </span>
619 </a>
620
621 </li>
622
623 <li class="md-nav__item">
624 <a href="#ft_attach_stream" class="md-nav__link">
625 <span class="md-ellipsis">
626 FT_Attach_Stream
627 </span>
628 </a>
629
630 </li>
631
632 </ul>
633
634 </nav>
635
636 </li>
637
638
639
640
641
642
643
644
645
646
647 <li class="md-nav__item">
648 <a href="ft2-font_testing_macros.html" class="md-nav__link">
649
650
651 <span class="md-ellipsis">
652 Font Testing Macros
653
654 </span>
655
656
657 </a>
658 </li>
659
660
661
662
663
664
665
666
667
668
669 <li class="md-nav__item">
670 <a href="ft2-sizing_and_scaling.html" class="md-nav__link">
671
672
673 <span class="md-ellipsis">
674 Sizing and Scaling
675
676 </span>
677
678
679 </a>
680 </li>
681
682
683
684
685
686
687
688
689
690
691 <li class="md-nav__item">
692 <a href="ft2-glyph_retrieval.html" class="md-nav__link">
693
694
695 <span class="md-ellipsis">
696 Glyph Retrieval
697
698 </span>
699
700
701 </a>
702 </li>
703
704
705
706
707
708
709
710
711
712
713 <li class="md-nav__item">
714 <a href="ft2-character_mapping.html" class="md-nav__link">
715
716
717 <span class="md-ellipsis">
718 Character Mapping
719
720 </span>
721
722
723 </a>
724 </li>
725
726
727
728
729
730
731
732
733
734
735 <li class="md-nav__item">
736 <a href="ft2-information_retrieval.html" class="md-nav__link">
737
738
739 <span class="md-ellipsis">
740 Information Retrieval
741
742 </span>
743
744
745 </a>
746 </li>
747
748
749
750
751
752
753
754
755
756
757 <li class="md-nav__item">
758 <a href="ft2-other_api_data.html" class="md-nav__link">
759
760
761 <span class="md-ellipsis">
762 Other API Data
763
764 </span>
765
766
767 </a>
768 </li>
769
770
771
772
773 </ul>
774 </nav>
775
776 </li>
777
778
779
780
781
782
783
784
785
786
787
788
789
790 <li class="md-nav__item md-nav__item--nested">
791
792
793
794 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
795
796
797 <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
798
799
800 <span class="md-ellipsis">
801 Extended API
802
803 </span>
804
805
806 <span class="md-nav__icon md-icon"></span>
807 </label>
808
809 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
810 <label class="md-nav__title" for="__nav_5">
811 <span class="md-nav__icon md-icon"></span>
812 Extended API
813 </label>
814 <ul class="md-nav__list" data-md-scrollfix>
815
816
817
818
819
820
821
822 <li class="md-nav__item">
823 <a href="ft2-glyph_variants.html" class="md-nav__link">
824
825
826 <span class="md-ellipsis">
827 Unicode Variation Sequences
828
829 </span>
830
831
832 </a>
833 </li>
834
835
836
837
838
839
840
841
842
843
844 <li class="md-nav__item">
845 <a href="ft2-color_management.html" class="md-nav__link">
846
847
848 <span class="md-ellipsis">
849 Glyph Color Management
850
851 </span>
852
853
854 </a>
855 </li>
856
857
858
859
860
861
862
863
864
865
866 <li class="md-nav__item">
867 <a href="ft2-layer_management.html" class="md-nav__link">
868
869
870 <span class="md-ellipsis">
871 Glyph Layer Management
872
873 </span>
874
875
876 </a>
877 </li>
878
879
880
881
882
883
884
885
886
887
888 <li class="md-nav__item">
889 <a href="ft2-glyph_management.html" class="md-nav__link">
890
891
892 <span class="md-ellipsis">
893 Glyph Management
894
895 </span>
896
897
898 </a>
899 </li>
900
901
902
903
904
905
906
907
908
909
910 <li class="md-nav__item">
911 <a href="ft2-mac_specific.html" class="md-nav__link">
912
913
914 <span class="md-ellipsis">
915 Mac Specific Interface
916
917 </span>
918
919
920 </a>
921 </li>
922
923
924
925
926
927
928
929
930
931
932 <li class="md-nav__item">
933 <a href="ft2-sizes_management.html" class="md-nav__link">
934
935
936 <span class="md-ellipsis">
937 Size Management
938
939 </span>
940
941
942 </a>
943 </li>
944
945
946
947
948
949
950
951
952
953
954 <li class="md-nav__item">
955 <a href="ft2-header_file_macros.html" class="md-nav__link">
956
957
958 <span class="md-ellipsis">
959 Header File Macros
960
961 </span>
962
963
964 </a>
965 </li>
966
967
968
969
970 </ul>
971 </nav>
972
973 </li>
974
975
976
977
978
979
980
981
982
983
984
985
986
987 <li class="md-nav__item md-nav__item--nested">
988
989
990
991 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
992
993
994 <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
995
996
997 <span class="md-ellipsis">
998 Format-Specific API
999
1000 </span>
1001
1002
1003 <span class="md-nav__icon md-icon"></span>
1004 </label>
1005
1006 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
1007 <label class="md-nav__title" for="__nav_6">
1008 <span class="md-nav__icon md-icon"></span>
1009 Format-Specific API
1010 </label>
1011 <ul class="md-nav__list" data-md-scrollfix>
1012
1013
1014
1015
1016
1017
1018
1019 <li class="md-nav__item">
1020 <a href="ft2-multiple_masters.html" class="md-nav__link">
1021
1022
1023 <span class="md-ellipsis">
1024 OpenType Font Variations, TrueType GX, and Adobe MM Fonts
1025
1026 </span>
1027
1028
1029 </a>
1030 </li>
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041 <li class="md-nav__item">
1042 <a href="ft2-truetype_tables.html" class="md-nav__link">
1043
1044
1045 <span class="md-ellipsis">
1046 TrueType Tables
1047
1048 </span>
1049
1050
1051 </a>
1052 </li>
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063 <li class="md-nav__item">
1064 <a href="ft2-type1_tables.html" class="md-nav__link">
1065
1066
1067 <span class="md-ellipsis">
1068 Type 1 Tables
1069
1070 </span>
1071
1072
1073 </a>
1074 </li>
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085 <li class="md-nav__item">
1086 <a href="ft2-sfnt_names.html" class="md-nav__link">
1087
1088
1089 <span class="md-ellipsis">
1090 SFNT Names
1091
1092 </span>
1093
1094
1095 </a>
1096 </li>
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107 <li class="md-nav__item">
1108 <a href="ft2-bdf_fonts.html" class="md-nav__link">
1109
1110
1111 <span class="md-ellipsis">
1112 BDF and PCF Files
1113
1114 </span>
1115
1116
1117 </a>
1118 </li>
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129 <li class="md-nav__item">
1130 <a href="ft2-cid_fonts.html" class="md-nav__link">
1131
1132
1133 <span class="md-ellipsis">
1134 CID Fonts
1135
1136 </span>
1137
1138
1139 </a>
1140 </li>
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151 <li class="md-nav__item">
1152 <a href="ft2-pfr_fonts.html" class="md-nav__link">
1153
1154
1155 <span class="md-ellipsis">
1156 PFR Fonts
1157
1158 </span>
1159
1160
1161 </a>
1162 </li>
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173 <li class="md-nav__item">
1174 <a href="ft2-winfnt_fonts.html" class="md-nav__link">
1175
1176
1177 <span class="md-ellipsis">
1178 Window FNT Files
1179
1180 </span>
1181
1182
1183 </a>
1184 </li>
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195 <li class="md-nav__item">
1196 <a href="ft2-svg_fonts.html" class="md-nav__link">
1197
1198
1199 <span class="md-ellipsis">
1200 OpenType SVG Fonts
1201
1202 </span>
1203
1204
1205 </a>
1206 </li>
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217 <li class="md-nav__item">
1218 <a href="ft2-font_formats.html" class="md-nav__link">
1219
1220
1221 <span class="md-ellipsis">
1222 Font Formats
1223
1224 </span>
1225
1226
1227 </a>
1228 </li>
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239 <li class="md-nav__item">
1240 <a href="ft2-gasp_table.html" class="md-nav__link">
1241
1242
1243 <span class="md-ellipsis">
1244 Gasp Table
1245
1246 </span>
1247
1248
1249 </a>
1250 </li>
1251
1252
1253
1254
1255 </ul>
1256 </nav>
1257
1258 </li>
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272 <li class="md-nav__item md-nav__item--nested">
1273
1274
1275
1276 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
1277
1278
1279 <label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
1280
1281
1282 <span class="md-ellipsis">
1283 Controlling FreeType Modules
1284
1285 </span>
1286
1287
1288 <span class="md-nav__icon md-icon"></span>
1289 </label>
1290
1291 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
1292 <label class="md-nav__title" for="__nav_7">
1293 <span class="md-nav__icon md-icon"></span>
1294 Controlling FreeType Modules
1295 </label>
1296 <ul class="md-nav__list" data-md-scrollfix>
1297
1298
1299
1300
1301
1302
1303
1304 <li class="md-nav__item">
1305 <a href="ft2-auto_hinter.html" class="md-nav__link">
1306
1307
1308 <span class="md-ellipsis">
1309 The auto-hinter
1310
1311 </span>
1312
1313
1314 </a>
1315 </li>
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326 <li class="md-nav__item">
1327 <a href="ft2-cff_driver.html" class="md-nav__link">
1328
1329
1330 <span class="md-ellipsis">
1331 The CFF driver
1332
1333 </span>
1334
1335
1336 </a>
1337 </li>
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348 <li class="md-nav__item">
1349 <a href="ft2-t1_cid_driver.html" class="md-nav__link">
1350
1351
1352 <span class="md-ellipsis">
1353 The Type 1 and CID drivers
1354
1355 </span>
1356
1357
1358 </a>
1359 </li>
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370 <li class="md-nav__item">
1371 <a href="ft2-tt_driver.html" class="md-nav__link">
1372
1373
1374 <span class="md-ellipsis">
1375 The TrueType driver
1376
1377 </span>
1378
1379
1380 </a>
1381 </li>
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392 <li class="md-nav__item">
1393 <a href="ft2-pcf_driver.html" class="md-nav__link">
1394
1395
1396 <span class="md-ellipsis">
1397 The PCF driver
1398
1399 </span>
1400
1401
1402 </a>
1403 </li>
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414 <li class="md-nav__item">
1415 <a href="ft2-ot_svg_driver.html" class="md-nav__link">
1416
1417
1418 <span class="md-ellipsis">
1419 The SVG driver
1420
1421 </span>
1422
1423
1424 </a>
1425 </li>
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436 <li class="md-nav__item">
1437 <a href="ft2-properties.html" class="md-nav__link">
1438
1439
1440 <span class="md-ellipsis">
1441 Driver properties
1442
1443 </span>
1444
1445
1446 </a>
1447 </li>
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458 <li class="md-nav__item">
1459 <a href="ft2-parameter_tags.html" class="md-nav__link">
1460
1461
1462 <span class="md-ellipsis">
1463 Parameter Tags
1464
1465 </span>
1466
1467
1468 </a>
1469 </li>
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480 <li class="md-nav__item">
1481 <a href="ft2-lcd_rendering.html" class="md-nav__link">
1482
1483
1484 <span class="md-ellipsis">
1485 Subpixel Rendering
1486
1487 </span>
1488
1489
1490 </a>
1491 </li>
1492
1493
1494
1495
1496 </ul>
1497 </nav>
1498
1499 </li>
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513 <li class="md-nav__item md-nav__item--nested">
1514
1515
1516
1517 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
1518
1519
1520 <label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
1521
1522
1523 <span class="md-ellipsis">
1524 Cache Sub-System
1525
1526 </span>
1527
1528
1529 <span class="md-nav__icon md-icon"></span>
1530 </label>
1531
1532 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
1533 <label class="md-nav__title" for="__nav_8">
1534 <span class="md-nav__icon md-icon"></span>
1535 Cache Sub-System
1536 </label>
1537 <ul class="md-nav__list" data-md-scrollfix>
1538
1539
1540
1541
1542
1543
1544
1545 <li class="md-nav__item">
1546 <a href="ft2-cache_subsystem.html" class="md-nav__link">
1547
1548
1549 <span class="md-ellipsis">
1550 Cache Sub-System
1551
1552 </span>
1553
1554
1555 </a>
1556 </li>
1557
1558
1559
1560
1561 </ul>
1562 </nav>
1563
1564 </li>
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578 <li class="md-nav__item md-nav__item--nested">
1579
1580
1581
1582 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
1583
1584
1585 <label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
1586
1587
1588 <span class="md-ellipsis">
1589 Support API
1590
1591 </span>
1592
1593
1594 <span class="md-nav__icon md-icon"></span>
1595 </label>
1596
1597 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
1598 <label class="md-nav__title" for="__nav_9">
1599 <span class="md-nav__icon md-icon"></span>
1600 Support API
1601 </label>
1602 <ul class="md-nav__list" data-md-scrollfix>
1603
1604
1605
1606
1607
1608
1609
1610 <li class="md-nav__item">
1611 <a href="ft2-computations.html" class="md-nav__link">
1612
1613
1614 <span class="md-ellipsis">
1615 Computations
1616
1617 </span>
1618
1619
1620 </a>
1621 </li>
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632 <li class="md-nav__item">
1633 <a href="ft2-list_processing.html" class="md-nav__link">
1634
1635
1636 <span class="md-ellipsis">
1637 List Processing
1638
1639 </span>
1640
1641
1642 </a>
1643 </li>
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654 <li class="md-nav__item">
1655 <a href="ft2-outline_processing.html" class="md-nav__link">
1656
1657
1658 <span class="md-ellipsis">
1659 Outline Processing
1660
1661 </span>
1662
1663
1664 </a>
1665 </li>
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676 <li class="md-nav__item">
1677 <a href="ft2-quick_advance.html" class="md-nav__link">
1678
1679
1680 <span class="md-ellipsis">
1681 Quick retrieval of advance values
1682
1683 </span>
1684
1685
1686 </a>
1687 </li>
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698 <li class="md-nav__item">
1699 <a href="ft2-bitmap_handling.html" class="md-nav__link">
1700
1701
1702 <span class="md-ellipsis">
1703 Bitmap Handling
1704
1705 </span>
1706
1707
1708 </a>
1709 </li>
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720 <li class="md-nav__item">
1721 <a href="ft2-raster.html" class="md-nav__link">
1722
1723
1724 <span class="md-ellipsis">
1725 Scanline Converter
1726
1727 </span>
1728
1729
1730 </a>
1731 </li>
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742 <li class="md-nav__item">
1743 <a href="ft2-glyph_stroker.html" class="md-nav__link">
1744
1745
1746 <span class="md-ellipsis">
1747 Glyph Stroker
1748
1749 </span>
1750
1751
1752 </a>
1753 </li>
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764 <li class="md-nav__item">
1765 <a href="ft2-system_interface.html" class="md-nav__link">
1766
1767
1768 <span class="md-ellipsis">
1769 System Interface
1770
1771 </span>
1772
1773
1774 </a>
1775 </li>
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786 <li class="md-nav__item">
1787 <a href="ft2-module_management.html" class="md-nav__link">
1788
1789
1790 <span class="md-ellipsis">
1791 Module Management
1792
1793 </span>
1794
1795
1796 </a>
1797 </li>
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808 <li class="md-nav__item">
1809 <a href="ft2-gzip.html" class="md-nav__link">
1810
1811
1812 <span class="md-ellipsis">
1813 GZIP Streams
1814
1815 </span>
1816
1817
1818 </a>
1819 </li>
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830 <li class="md-nav__item">
1831 <a href="ft2-lzw.html" class="md-nav__link">
1832
1833
1834 <span class="md-ellipsis">
1835 LZW Streams
1836
1837 </span>
1838
1839
1840 </a>
1841 </li>
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852 <li class="md-nav__item">
1853 <a href="ft2-bzip2.html" class="md-nav__link">
1854
1855
1856 <span class="md-ellipsis">
1857 BZIP2 Streams
1858
1859 </span>
1860
1861
1862 </a>
1863 </li>
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874 <li class="md-nav__item">
1875 <a href="ft2-debugging_apis.html" class="md-nav__link">
1876
1877
1878 <span class="md-ellipsis">
1879 External Debugging APIs
1880
1881 </span>
1882
1883
1884 </a>
1885 </li>
1886
1887
1888
1889
1890 </ul>
1891 </nav>
1892
1893 </li>
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907 <li class="md-nav__item md-nav__item--nested">
1908
1909
1910
1911 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
1912
1913
1914 <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
1915
1916
1917 <span class="md-ellipsis">
1918 Error Codes
1919
1920 </span>
1921
1922
1923 <span class="md-nav__icon md-icon"></span>
1924 </label>
1925
1926 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
1927 <label class="md-nav__title" for="__nav_10">
1928 <span class="md-nav__icon md-icon"></span>
1929 Error Codes
1930 </label>
1931 <ul class="md-nav__list" data-md-scrollfix>
1932
1933
1934
1935
1936
1937
1938
1939 <li class="md-nav__item">
1940 <a href="ft2-error_enumerations.html" class="md-nav__link">
1941
1942
1943 <span class="md-ellipsis">
1944 Error Enumerations
1945
1946 </span>
1947
1948
1949 </a>
1950 </li>
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961 <li class="md-nav__item">
1962 <a href="ft2-error_code_values.html" class="md-nav__link">
1963
1964
1965 <span class="md-ellipsis">
1966 Error Code Values
1967
1968 </span>
1969
1970
1971 </a>
1972 </li>
1973
1974
1975
1976
1977 </ul>
1978 </nav>
1979
1980 </li>
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994 <li class="md-nav__item md-nav__item--nested">
1995
1996
1997
1998 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
1999
2000
2001 <label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
2002
2003
2004 <span class="md-ellipsis">
2005 Miscellaneous
2006
2007 </span>
2008
2009
2010 <span class="md-nav__icon md-icon"></span>
2011 </label>
2012
2013 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
2014 <label class="md-nav__title" for="__nav_11">
2015 <span class="md-nav__icon md-icon"></span>
2016 Miscellaneous
2017 </label>
2018 <ul class="md-nav__list" data-md-scrollfix>
2019
2020
2021
2022
2023
2024
2025
2026 <li class="md-nav__item">
2027 <a href="ft2-gx_validation.html" class="md-nav__link">
2028
2029
2030 <span class="md-ellipsis">
2031 TrueTypeGX/AAT Validation
2032
2033 </span>
2034
2035
2036 </a>
2037 </li>
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048 <li class="md-nav__item">
2049 <a href="ft2-incremental.html" class="md-nav__link">
2050
2051
2052 <span class="md-ellipsis">
2053 Incremental Loading
2054
2055 </span>
2056
2057
2058 </a>
2059 </li>
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070 <li class="md-nav__item">
2071 <a href="ft2-truetype_engine.html" class="md-nav__link">
2072
2073
2074 <span class="md-ellipsis">
2075 The TrueType Engine
2076
2077 </span>
2078
2079
2080 </a>
2081 </li>
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092 <li class="md-nav__item">
2093 <a href="ft2-ot_validation.html" class="md-nav__link">
2094
2095
2096 <span class="md-ellipsis">
2097 OpenType Validation
2098
2099 </span>
2100
2101
2102 </a>
2103 </li>
2104
2105
2106
2107
2108 </ul>
2109 </nav>
2110
2111 </li>
2112
2113
2114
2115 </ul>
2116 </nav>
2117 </div>
2118 </div>
2119 </div>
2120
2121
2122
2123 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
2124 <div class="md-sidebar__scrollwrap">
2125 <div class="md-sidebar__inner">
2126
2127
2128 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
2129
2130
2131
2132
2133
2134
2135 <label class="md-nav__title" for="__toc">
2136 <span class="md-nav__icon md-icon"></span>
2137 Table of contents
2138 </label>
2139 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
2140
2141 <li class="md-nav__item">
2142 <a href="#synopsis" class="md-nav__link">
2143 <span class="md-ellipsis">
2144 Synopsis
2145 </span>
2146 </a>
2147
2148 </li>
2149
2150 <li class="md-nav__item">
2151 <a href="#ft_face" class="md-nav__link">
2152 <span class="md-ellipsis">
2153 FT_Face
2154 </span>
2155 </a>
2156
2157 </li>
2158
2159 <li class="md-nav__item">
2160 <a href="#ft_facerec" class="md-nav__link">
2161 <span class="md-ellipsis">
2162 FT_FaceRec
2163 </span>
2164 </a>
2165
2166 </li>
2167
2168 <li class="md-nav__item">
2169 <a href="#ft_face_flag_xxx" class="md-nav__link">
2170 <span class="md-ellipsis">
2171 FT_FACE_FLAG_XXX
2172 </span>
2173 </a>
2174
2175 </li>
2176
2177 <li class="md-nav__item">
2178 <a href="#ft_style_flag_xxx" class="md-nav__link">
2179 <span class="md-ellipsis">
2180 FT_STYLE_FLAG_XXX
2181 </span>
2182 </a>
2183
2184 </li>
2185
2186 <li class="md-nav__item">
2187 <a href="#ft_new_face" class="md-nav__link">
2188 <span class="md-ellipsis">
2189 FT_New_Face
2190 </span>
2191 </a>
2192
2193 </li>
2194
2195 <li class="md-nav__item">
2196 <a href="#ft_done_face" class="md-nav__link">
2197 <span class="md-ellipsis">
2198 FT_Done_Face
2199 </span>
2200 </a>
2201
2202 </li>
2203
2204 <li class="md-nav__item">
2205 <a href="#ft_reference_face" class="md-nav__link">
2206 <span class="md-ellipsis">
2207 FT_Reference_Face
2208 </span>
2209 </a>
2210
2211 </li>
2212
2213 <li class="md-nav__item">
2214 <a href="#ft_new_memory_face" class="md-nav__link">
2215 <span class="md-ellipsis">
2216 FT_New_Memory_Face
2217 </span>
2218 </a>
2219
2220 </li>
2221
2222 <li class="md-nav__item">
2223 <a href="#ft_face_properties" class="md-nav__link">
2224 <span class="md-ellipsis">
2225 FT_Face_Properties
2226 </span>
2227 </a>
2228
2229 </li>
2230
2231 <li class="md-nav__item">
2232 <a href="#ft_open_face" class="md-nav__link">
2233 <span class="md-ellipsis">
2234 FT_Open_Face
2235 </span>
2236 </a>
2237
2238 </li>
2239
2240 <li class="md-nav__item">
2241 <a href="#ft_open_args" class="md-nav__link">
2242 <span class="md-ellipsis">
2243 FT_Open_Args
2244 </span>
2245 </a>
2246
2247 </li>
2248
2249 <li class="md-nav__item">
2250 <a href="#ft_open_xxx" class="md-nav__link">
2251 <span class="md-ellipsis">
2252 FT_OPEN_XXX
2253 </span>
2254 </a>
2255
2256 </li>
2257
2258 <li class="md-nav__item">
2259 <a href="#ft_parameter" class="md-nav__link">
2260 <span class="md-ellipsis">
2261 FT_Parameter
2262 </span>
2263 </a>
2264
2265 </li>
2266
2267 <li class="md-nav__item">
2268 <a href="#ft_attach_file" class="md-nav__link">
2269 <span class="md-ellipsis">
2270 FT_Attach_File
2271 </span>
2272 </a>
2273
2274 </li>
2275
2276 <li class="md-nav__item">
2277 <a href="#ft_attach_stream" class="md-nav__link">
2278 <span class="md-ellipsis">
2279 FT_Attach_Stream
2280 </span>
2281 </a>
2282
2283 </li>
2284
2285 </ul>
2286
2287 </nav>
2288 </div>
2289 </div>
2290 </div>
2291
2292
2293
2294 <div class="md-content" data-md-component="content">
2295 <article class="md-content__inner md-typeset">
2296
2297
2298
2299
2300
2301 <p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; <a href="index.html#core-api">Core API</a> &raquo; Face Creation</p>
2302 <hr />
2303 <h1 id="face-creation">Face Creation<a class="headerlink" href="#face-creation" title="Permanent link">&para;</a></h1>
2304 <h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
2305 <p>The functions and structures collected in this section operate on fonts globally.</p>
2306 <h2 id="ft_face">FT_Face<a class="headerlink" href="#ft_face" title="Permanent link">&para;</a></h2>
2307 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2308 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_FaceRec_* <b>FT_Face</b>;
2309 </code></pre></div>
2310
2311 <p>A handle to a typographic face object. A face object models a given typeface, in a given style.</p>
2312 <h4>note</h4>
2313
2314 <p>A face object also owns a single <code><a href="ft2-glyph_retrieval.html#ft_glyphslot">FT_GlyphSlot</a></code> object, as well as one or more <code><a href="ft2-sizing_and_scaling.html#ft_size">FT_Size</a></code> objects.</p>
2315 <p>Use <code><a href="ft2-face_creation.html#ft_new_face">FT_New_Face</a></code> or <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> to create a new face object from a given filepath or a custom input stream.</p>
2316 <p>Use <code><a href="ft2-face_creation.html#ft_done_face">FT_Done_Face</a></code> to destroy it (along with its slot and sizes).</p>
2317 <p>An <code>FT_Face</code> object can only be safely used from one thread at a time. Similarly, creation and destruction of <code>FT_Face</code> with the same <code><a href="ft2-library_setup.html#ft_library">FT_Library</a></code> object can only be done from one thread at a time. On the other hand, functions like <code><a href="ft2-glyph_retrieval.html#ft_load_glyph">FT_Load_Glyph</a></code> and its siblings are thread-safe and do not need the lock to be held as long as the same <code>FT_Face</code> object is not used from multiple threads at the same time.</p>
2318 <h4>also</h4>
2319
2320 <p>See <code><a href="ft2-face_creation.html#ft_facerec">FT_FaceRec</a></code> for the publicly accessible fields of a given face object.</p>
2321 <hr>
2322
2323 <h2 id="ft_facerec">FT_FaceRec<a class="headerlink" href="#ft_facerec" title="Permanent link">&para;</a></h2>
2324 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2325 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_FaceRec_
2326 {
2327 <a href="ft2-basic_types.html#ft_long">FT_Long</a> num_faces;
2328 <a href="ft2-basic_types.html#ft_long">FT_Long</a> face_index;
2329
2330 <a href="ft2-basic_types.html#ft_long">FT_Long</a> face_flags;
2331 <a href="ft2-basic_types.html#ft_long">FT_Long</a> style_flags;
2332
2333 <a href="ft2-basic_types.html#ft_long">FT_Long</a> num_glyphs;
2334
2335 <a href="ft2-basic_types.html#ft_string">FT_String</a>* family_name;
2336 <a href="ft2-basic_types.html#ft_string">FT_String</a>* style_name;
2337
2338 <a href="ft2-basic_types.html#ft_int">FT_Int</a> num_fixed_sizes;
2339 <a href="ft2-sizing_and_scaling.html#ft_bitmap_size">FT_Bitmap_Size</a>* available_sizes;
2340
2341 <a href="ft2-basic_types.html#ft_int">FT_Int</a> num_charmaps;
2342 <a href="ft2-character_mapping.html#ft_charmap">FT_CharMap</a>* charmaps;
2343
2344 <a href="ft2-basic_types.html#ft_generic">FT_Generic</a> generic;
2345
2346 /* The following member variables (down to `underline_thickness`) */
2347 /* are only relevant to scalable outlines; cf. @<a href="ft2-sizing_and_scaling.html#ft_bitmap_size">FT_Bitmap_Size</a> */
2348 /* for bitmap fonts. */
2349 <a href="ft2-basic_types.html#ft_bbox">FT_BBox</a> bbox;
2350
2351 <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> units_per_EM;
2352 <a href="ft2-basic_types.html#ft_short">FT_Short</a> ascender;
2353 <a href="ft2-basic_types.html#ft_short">FT_Short</a> descender;
2354 <a href="ft2-basic_types.html#ft_short">FT_Short</a> height;
2355
2356 <a href="ft2-basic_types.html#ft_short">FT_Short</a> max_advance_width;
2357 <a href="ft2-basic_types.html#ft_short">FT_Short</a> max_advance_height;
2358
2359 <a href="ft2-basic_types.html#ft_short">FT_Short</a> underline_position;
2360 <a href="ft2-basic_types.html#ft_short">FT_Short</a> underline_thickness;
2361
2362 <a href="ft2-glyph_retrieval.html#ft_glyphslot">FT_GlyphSlot</a> glyph;
2363 <a href="ft2-sizing_and_scaling.html#ft_size">FT_Size</a> size;
2364 <a href="ft2-character_mapping.html#ft_charmap">FT_CharMap</a> charmap;
2365
2366 /* private fields, internal to FreeType */
2367
2368 <a href="ft2-module_management.html#ft_driver">FT_Driver</a> driver;
2369 <a href="ft2-system_interface.html#ft_memory">FT_Memory</a> memory;
2370 <a href="ft2-system_interface.html#ft_stream">FT_Stream</a> stream;
2371
2372 <a href="ft2-list_processing.html#ft_listrec">FT_ListRec</a> sizes_list;
2373
2374 <a href="ft2-basic_types.html#ft_generic">FT_Generic</a> autohint; /* face-specific auto-hinter data */
2375 <span class="keyword">void</span>* extensions; /* unused */
2376
2377 <a href="ft2-other_api_data.html#ft_face_internal">FT_Face_Internal</a> internal;
2378
2379 } <b>FT_FaceRec</b>;
2380 </code></pre></div>
2381
2382 <p>FreeType root face class structure. A face object models a typeface in a font file.</p>
2383 <h4>fields</h4>
2384 <table class="fields">
2385 <tr><td class="val" id="num_faces">num_faces</td><td class="desc">
2386 <p>The number of faces in the font file. Some font formats can have multiple faces in a single font file.</p>
2387 </td></tr>
2388 <tr><td class="val" id="face_index">face_index</td><td class="desc">
2389 <p>This field holds two different values. Bits 0-15 are the index of the face in the font file (starting with value 0). They are set to 0 if there is only one face in the font file.</p>
2390 <p>[Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType Font Variations only, holding the named instance index for the current face index (starting with value 1; value 0 indicates font access without a named instance). For non-variation fonts, bits 16-30 are ignored. If we have the third named instance of face 4, say, <code>face_index</code> is set to 0x00030004.</p>
2391 <p>Bit 31 is always zero (that is, <code>face_index</code> is always a positive value).</p>
2392 <p>[Since 2.9] Changing the design coordinates with <code><a href="ft2-multiple_masters.html#ft_set_var_design_coordinates">FT_Set_Var_Design_Coordinates</a></code> or <code><a href="ft2-multiple_masters.html#ft_set_var_blend_coordinates">FT_Set_Var_Blend_Coordinates</a></code> does not influence the named instance index value (only <code><a href="ft2-multiple_masters.html#ft_set_named_instance">FT_Set_Named_Instance</a></code> does that).</p>
2393 </td></tr>
2394 <tr><td class="val" id="face_flags">face_flags</td><td class="desc">
2395 <p>A set of bit flags that give important information about the face; see <code><a href="ft2-face_creation.html#ft_face_flag_xxx">FT_FACE_FLAG_XXX</a></code> for the details.</p>
2396 </td></tr>
2397 <tr><td class="val" id="style_flags">style_flags</td><td class="desc">
2398 <p>The lower 16 bits contain a set of bit flags indicating the style of the face; see <code><a href="ft2-face_creation.html#ft_style_flag_xxx">FT_STYLE_FLAG_XXX</a></code> for the details.</p>
2399 <p>[Since 2.6.1] Bits 16-30 hold the number of named instances available for the current face if we have a TrueType GX or OpenType Font Variation. Bit 31 is always zero (that is, <code>style_flags</code> is always a positive value). Note that a variation font has always at least one named instance, namely the default instance.</p>
2400 </td></tr>
2401 <tr><td class="val" id="num_glyphs">num_glyphs</td><td class="desc">
2402 <p>The number of glyphs in the face. If the face is scalable and has sbits (see <code>num_fixed_sizes</code>), it is set to the number of outline glyphs.</p>
2403 <p>For CID-keyed fonts (not in an SFNT wrapper) this value gives the highest CID used in the font.</p>
2404 </td></tr>
2405 <tr><td class="val" id="family_name">family_name</td><td class="desc">
2406 <p>The face's family name. This is an ASCII string, usually in English, that describes the typeface's family (like ‘Times New Roman’, ‘Bodoni’, ‘Garamond’, etc). This is a least common denominator used to list fonts. Some formats (TrueType &amp; OpenType) provide localized and Unicode versions of this string. Applications should use the format-specific interface to access them. Can be <code>NULL</code> (e.g., in fonts embedded in a PDF file).</p>
2407 <p>In case the font doesn't provide a specific family name entry, FreeType tries to synthesize one, deriving it from other name entries.</p>
2408 </td></tr>
2409 <tr><td class="val" id="style_name">style_name</td><td class="desc">
2410 <p>The face's style name. This is an ASCII string, usually in English, that describes the typeface's style (like ‘Italic’, ‘Bold’, ‘Condensed’, etc). Not all font formats provide a style name, so this field is optional, and can be set to <code>NULL</code>. As for <code>family_name</code>, some formats provide localized and Unicode versions of this string. Applications should use the format-specific interface to access them.</p>
2411 </td></tr>
2412 <tr><td class="val" id="num_fixed_sizes">num_fixed_sizes</td><td class="desc">
2413 <p>The number of bitmap strikes in the face. Even if the face is scalable, there might still be bitmap strikes, which are called ‘sbits’ in that case.</p>
2414 </td></tr>
2415 <tr><td class="val" id="available_sizes">available_sizes</td><td class="desc">
2416 <p>An array of <code><a href="ft2-sizing_and_scaling.html#ft_bitmap_size">FT_Bitmap_Size</a></code> for all bitmap strikes in the face. It is set to <code>NULL</code> if there is no bitmap strike.</p>
2417 <p>Note that FreeType tries to sanitize the strike data since they are sometimes sloppy or incorrect, but this can easily fail.</p>
2418 </td></tr>
2419 <tr><td class="val" id="num_charmaps">num_charmaps</td><td class="desc">
2420 <p>The number of charmaps in the face.</p>
2421 </td></tr>
2422 <tr><td class="val" id="charmaps">charmaps</td><td class="desc">
2423 <p>An array of the charmaps of the face.</p>
2424 </td></tr>
2425 <tr><td class="val" id="generic">generic</td><td class="desc">
2426 <p>A field reserved for client uses. See the <code><a href="ft2-basic_types.html#ft_generic">FT_Generic</a></code> type description.</p>
2427 </td></tr>
2428 <tr><td class="val" id="bbox">bbox</td><td class="desc">
2429 <p>The font bounding box. Coordinates are expressed in font units (see <code>units_per_EM</code>). The box is large enough to contain any glyph from the font. Thus, <code>bbox.yMax</code> can be seen as the ‘maximum ascender’, and <code>bbox.yMin</code> as the ‘minimum descender’. Only relevant for scalable formats.</p>
2430 <p>Note that the bounding box might be off by (at least) one pixel for hinted fonts. See <code><a href="ft2-sizing_and_scaling.html#ft_size_metrics">FT_Size_Metrics</a></code> for further discussion.</p>
2431 <p>Note that the bounding box does not vary in OpenType Font Variations and should only be used in relation to the default instance.</p>
2432 </td></tr>
2433 <tr><td class="val" id="units_per_em">units_per_EM</td><td class="desc">
2434 <p>The number of font units per EM square for this face. This is typically 2048 for TrueType fonts, and 1000 for Type 1 fonts. Only relevant for scalable formats.</p>
2435 </td></tr>
2436 <tr><td class="val" id="ascender">ascender</td><td class="desc">
2437 <p>The typographic ascender of the face, expressed in font units. For font formats not having this information, it is set to <code>bbox.yMax</code>. Only relevant for scalable formats.</p>
2438 </td></tr>
2439 <tr><td class="val" id="descender">descender</td><td class="desc">
2440 <p>The typographic descender of the face, expressed in font units. For font formats not having this information, it is set to <code>bbox.yMin</code>. Note that this field is negative for values below the baseline. Only relevant for scalable formats.</p>
2441 </td></tr>
2442 <tr><td class="val" id="height">height</td><td class="desc">
2443 <p>This value is the vertical distance between two consecutive baselines, expressed in font units. It is always positive. Only relevant for scalable formats.</p>
2444 <p>If you want the global glyph height, use <code>ascender - descender</code>.</p>
2445 </td></tr>
2446 <tr><td class="val" id="max_advance_width">max_advance_width</td><td class="desc">
2447 <p>The maximum advance width, in font units, for all glyphs in this face. This can be used to make word wrapping computations faster. Only relevant for scalable formats.</p>
2448 </td></tr>
2449 <tr><td class="val" id="max_advance_height">max_advance_height</td><td class="desc">
2450 <p>The maximum advance height, in font units, for all glyphs in this face. This is only relevant for vertical layouts, and is set to <code>height</code> for fonts that do not provide vertical metrics. Only relevant for scalable formats.</p>
2451 </td></tr>
2452 <tr><td class="val" id="underline_position">underline_position</td><td class="desc">
2453 <p>The position, in font units, of the underline line for this face. It is the center of the underlining stem. Only relevant for scalable formats.</p>
2454 </td></tr>
2455 <tr><td class="val" id="underline_thickness">underline_thickness</td><td class="desc">
2456 <p>The thickness, in font units, of the underline for this face. Only relevant for scalable formats.</p>
2457 </td></tr>
2458 <tr><td class="val" id="glyph">glyph</td><td class="desc">
2459 <p>The face's associated glyph slot(s).</p>
2460 </td></tr>
2461 <tr><td class="val" id="size">size</td><td class="desc">
2462 <p>The current active size for this face.</p>
2463 </td></tr>
2464 <tr><td class="val" id="charmap">charmap</td><td class="desc">
2465 <p>The current active charmap for this face.</p>
2466 </td></tr>
2467 </table>
2468
2469 <h4>note</h4>
2470
2471 <p>Fields may be changed after a call to <code><a href="ft2-face_creation.html#ft_attach_file">FT_Attach_File</a></code> or <code><a href="ft2-face_creation.html#ft_attach_stream">FT_Attach_Stream</a></code>.</p>
2472 <p>For OpenType Font Variations, the values of the following fields can change after a call to <code><a href="ft2-multiple_masters.html#ft_set_var_design_coordinates">FT_Set_Var_Design_Coordinates</a></code> (and friends) if the font contains an &lsquo;MVAR&rsquo; table: <code>ascender</code>, <code>descender</code>, <code>height</code>, <code>underline_position</code>, and <code>underline_thickness</code>.</p>
2473 <p>Especially for TrueType fonts see also the documentation for <code><a href="ft2-sizing_and_scaling.html#ft_size_metrics">FT_Size_Metrics</a></code>.</p>
2474 <hr>
2475
2476 <h2 id="ft_face_flag_xxx">FT_FACE_FLAG_XXX<a class="headerlink" href="#ft_face_flag_xxx" title="Permanent link">&para;</a></h2>
2477 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2478 <div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_scalable">FT_FACE_FLAG_SCALABLE</a> ( 1L &lt;&lt; 0 )
2479 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_fixed_sizes">FT_FACE_FLAG_FIXED_SIZES</a> ( 1L &lt;&lt; 1 )
2480 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_fixed_width">FT_FACE_FLAG_FIXED_WIDTH</a> ( 1L &lt;&lt; 2 )
2481 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_sfnt">FT_FACE_FLAG_SFNT</a> ( 1L &lt;&lt; 3 )
2482 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_horizontal">FT_FACE_FLAG_HORIZONTAL</a> ( 1L &lt;&lt; 4 )
2483 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_vertical">FT_FACE_FLAG_VERTICAL</a> ( 1L &lt;&lt; 5 )
2484 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_kerning">FT_FACE_FLAG_KERNING</a> ( 1L &lt;&lt; 6 )
2485 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_fast_glyphs">FT_FACE_FLAG_FAST_GLYPHS</a> ( 1L &lt;&lt; 7 )
2486 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_multiple_masters">FT_FACE_FLAG_MULTIPLE_MASTERS</a> ( 1L &lt;&lt; 8 )
2487 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_glyph_names">FT_FACE_FLAG_GLYPH_NAMES</a> ( 1L &lt;&lt; 9 )
2488 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_external_stream">FT_FACE_FLAG_EXTERNAL_STREAM</a> ( 1L &lt;&lt; 10 )
2489 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_hinter">FT_FACE_FLAG_HINTER</a> ( 1L &lt;&lt; 11 )
2490 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_cid_keyed">FT_FACE_FLAG_CID_KEYED</a> ( 1L &lt;&lt; 12 )
2491 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_tricky">FT_FACE_FLAG_TRICKY</a> ( 1L &lt;&lt; 13 )
2492 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_color">FT_FACE_FLAG_COLOR</a> ( 1L &lt;&lt; 14 )
2493 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_variation">FT_FACE_FLAG_VARIATION</a> ( 1L &lt;&lt; 15 )
2494 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_svg">FT_FACE_FLAG_SVG</a> ( 1L &lt;&lt; 16 )
2495 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_sbix">FT_FACE_FLAG_SBIX</a> ( 1L &lt;&lt; 17 )
2496 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_face_flag_sbix_overlay">FT_FACE_FLAG_SBIX_OVERLAY</a> ( 1L &lt;&lt; 18 )
2497 </code></pre></div>
2498
2499 <p>A list of bit flags used in the <code>face_flags</code> field of the <code><a href="ft2-face_creation.html#ft_facerec">FT_FaceRec</a></code> structure. They inform client applications of properties of the corresponding face.</p>
2500 <h4>values</h4>
2501 <table class="fields long">
2502 <tr><td class="val" id="ft_face_flag_scalable">FT_FACE_FLAG_SCALABLE</td><td class="desc">
2503 <p>The face contains outline glyphs. Note that a face can contain bitmap strikes also, i.e., a face can have both this flag and <code><a href="ft2-face_creation.html#ft_face_flag_xxx">FT_FACE_FLAG_FIXED_SIZES</a></code> set.</p>
2504 </td></tr>
2505 <tr><td class="val" id="ft_face_flag_fixed_sizes">FT_FACE_FLAG_FIXED_SIZES</td><td class="desc">
2506 <p>The face contains bitmap strikes. See also the <code>num_fixed_sizes</code> and <code>available_sizes</code> fields of <code><a href="ft2-face_creation.html#ft_facerec">FT_FaceRec</a></code>.</p>
2507 </td></tr>
2508 <tr><td class="val" id="ft_face_flag_fixed_width">FT_FACE_FLAG_FIXED_WIDTH</td><td class="desc">
2509 <p>The face contains fixed-width characters (like Courier, Lucida, MonoType, etc.).</p>
2510 </td></tr>
2511 <tr><td class="val" id="ft_face_flag_sfnt">FT_FACE_FLAG_SFNT</td><td class="desc">
2512 <p>The face uses the SFNT storage scheme. For now, this means TrueType and OpenType.</p>
2513 </td></tr>
2514 <tr><td class="val" id="ft_face_flag_horizontal">FT_FACE_FLAG_HORIZONTAL</td><td class="desc">
2515 <p>The face contains horizontal glyph metrics. This should be set for all common formats.</p>
2516 </td></tr>
2517 <tr><td class="val" id="ft_face_flag_vertical">FT_FACE_FLAG_VERTICAL</td><td class="desc">
2518 <p>The face contains vertical glyph metrics. This is only available in some formats, not all of them.</p>
2519 </td></tr>
2520 <tr><td class="val" id="ft_face_flag_kerning">FT_FACE_FLAG_KERNING</td><td class="desc">
2521 <p>The face contains kerning information. If set, the kerning distance can be retrieved using the function <code><a href="ft2-glyph_retrieval.html#ft_get_kerning">FT_Get_Kerning</a></code>. Otherwise the function always returns the vector (0,0).</p>
2522 <p>Note that for TrueType fonts only, FreeType supports both the ‘kern’ table and the basic, pair-wise kerning feature from the ‘GPOS’ table (with <code>TT_CONFIG_OPTION_GPOS_KERNING</code> enabled), though FreeType does not support the more advanced GPOS layout features; use a library like HarfBuzz for those instead.</p>
2523 </td></tr>
2524 <tr><td class="val" id="ft_face_flag_fast_glyphs">FT_FACE_FLAG_FAST_GLYPHS</td><td class="desc">
2525 <p>THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT.</p>
2526 </td></tr>
2527 <tr><td class="val" id="ft_face_flag_multiple_masters">FT_FACE_FLAG_MULTIPLE_MASTERS</td><td class="desc">
2528 <p>The face contains multiple masters and is capable of interpolating between them. Supported formats are Adobe MM, TrueType GX, and OpenType Font Variations.</p>
2529 <p>See section ‘<a href="ft2-multiple_masters.html#multiple_masters">OpenType Font Variations, TrueType GX, and Adobe MM Fonts</a>’ for API details.</p>
2530 </td></tr>
2531 <tr><td class="val" id="ft_face_flag_glyph_names">FT_FACE_FLAG_GLYPH_NAMES</td><td class="desc">
2532 <p>The face contains glyph names, which can be retrieved using <code><a href="ft2-information_retrieval.html#ft_get_glyph_name">FT_Get_Glyph_Name</a></code>. Note that some TrueType fonts contain broken glyph name tables. Use the function <code><a href="ft2-type1_tables.html#ft_has_ps_glyph_names">FT_Has_PS_Glyph_Names</a></code> when needed.</p>
2533 </td></tr>
2534 <tr><td class="val" id="ft_face_flag_external_stream">FT_FACE_FLAG_EXTERNAL_STREAM</td><td class="desc">
2535 <p>Used internally by FreeType to indicate that a face's stream was provided by the client application and should not be destroyed when <code><a href="ft2-face_creation.html#ft_done_face">FT_Done_Face</a></code> is called. Don't read or test this flag.</p>
2536 </td></tr>
2537 <tr><td class="val" id="ft_face_flag_hinter">FT_FACE_FLAG_HINTER</td><td class="desc">
2538 <p>The font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense to use data from the SFNT ‘gasp’ table only if the native TrueType hinting engine (with the bytecode interpreter) is available and active.</p>
2539 </td></tr>
2540 <tr><td class="val" id="ft_face_flag_cid_keyed">FT_FACE_FLAG_CID_KEYED</td><td class="desc">
2541 <p>The face is CID-keyed. In that case, the face is not accessed by glyph indices but by CID values. For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to <code><a href="ft2-glyph_retrieval.html#ft_load_glyph">FT_Load_Glyph</a></code>. Only the CID values for which corresponding glyphs in the subsetted font exist make <code>FT_Load_Glyph</code> return successfully; in all other cases you get an <code>FT_Err_Invalid_Argument</code> error.</p>
2542 <p>Note that CID-keyed fonts that are in an SFNT wrapper (that is, all OpenType/CFF fonts) don't have this flag set since the glyphs are accessed in the normal way (using contiguous indices); the ‘CID-ness’ isn't visible to the application.</p>
2543 </td></tr>
2544 <tr><td class="val" id="ft_face_flag_tricky">FT_FACE_FLAG_TRICKY</td><td class="desc">
2545 <p>The face is ‘tricky’, that is, it always needs the font format's native hinting engine to get a reasonable result. A typical example is the old Chinese font <code>mingli.ttf</code> (but not <code>mingliu.ttc</code>) that uses TrueType bytecode instructions to move and scale all of its subglyphs.</p>
2546 <p>It is not possible to auto-hint such fonts using <code><a href="ft2-glyph_retrieval.html#ft_load_xxx">FT_LOAD_FORCE_AUTOHINT</a></code>; it will also ignore <code><a href="ft2-glyph_retrieval.html#ft_load_xxx">FT_LOAD_NO_HINTING</a></code>. You have to set both <code><a href="ft2-glyph_retrieval.html#ft_load_xxx">FT_LOAD_NO_HINTING</a></code> and <code><a href="ft2-glyph_retrieval.html#ft_load_xxx">FT_LOAD_NO_AUTOHINT</a></code> to really disable hinting; however, you probably never want this except for demonstration purposes.</p>
2547 <p>Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded in file <code>ttobjs.c</code>.</p>
2548 </td></tr>
2549 <tr><td class="val" id="ft_face_flag_color">FT_FACE_FLAG_COLOR</td><td class="desc">
2550 <p>[Since 2.5.1] The face has color glyph tables. See <code><a href="ft2-glyph_retrieval.html#ft_load_xxx">FT_LOAD_COLOR</a></code> for more information.</p>
2551 </td></tr>
2552 <tr><td class="val" id="ft_face_flag_variation">FT_FACE_FLAG_VARIATION</td><td class="desc">
2553 <p>[Since 2.9] Set if the current face (or named instance) has been altered with <code><a href="ft2-multiple_masters.html#ft_set_mm_design_coordinates">FT_Set_MM_Design_Coordinates</a></code>, <code><a href="ft2-multiple_masters.html#ft_set_var_design_coordinates">FT_Set_Var_Design_Coordinates</a></code>, <code><a href="ft2-multiple_masters.html#ft_set_var_blend_coordinates">FT_Set_Var_Blend_Coordinates</a></code>, or <code><a href="ft2-multiple_masters.html#ft_set_mm_weightvector">FT_Set_MM_WeightVector</a></code> to select a non-default instance.</p>
2554 </td></tr>
2555 <tr><td class="val" id="ft_face_flag_svg">FT_FACE_FLAG_SVG</td><td class="desc">
2556 <p>[Since 2.12] The face has an ‘SVG ’ OpenType table.</p>
2557 </td></tr>
2558 <tr><td class="val" id="ft_face_flag_sbix">FT_FACE_FLAG_SBIX</td><td class="desc">
2559 <p>[Since 2.12] The face has an ‘sbix’ OpenType table <em>and</em> outlines. For such fonts, <code><a href="ft2-face_creation.html#ft_face_flag_xxx">FT_FACE_FLAG_SCALABLE</a></code> is not set by default to retain backward compatibility.</p>
2560 </td></tr>
2561 <tr><td class="val" id="ft_face_flag_sbix_overlay">FT_FACE_FLAG_SBIX_OVERLAY</td><td class="desc">
2562 <p>[Since 2.12] The face has an ‘sbix’ OpenType table where outlines should be drawn on top of bitmap strikes.</p>
2563 </td></tr>
2564 </table>
2565
2566 <hr>
2567
2568 <h2 id="ft_style_flag_xxx">FT_STYLE_FLAG_XXX<a class="headerlink" href="#ft_style_flag_xxx" title="Permanent link">&para;</a></h2>
2569 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2570 <div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_style_flag_italic">FT_STYLE_FLAG_ITALIC</a> ( 1 &lt;&lt; 0 )
2571 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_style_flag_bold">FT_STYLE_FLAG_BOLD</a> ( 1 &lt;&lt; 1 )
2572 </code></pre></div>
2573
2574 <p>A list of bit flags to indicate the style of a given face. These are used in the <code>style_flags</code> field of <code><a href="ft2-face_creation.html#ft_facerec">FT_FaceRec</a></code>.</p>
2575 <h4>values</h4>
2576 <table class="fields">
2577 <tr><td class="val" id="ft_style_flag_italic">FT_STYLE_FLAG_ITALIC</td><td class="desc">
2578 <p>The face style is italic or oblique.</p>
2579 </td></tr>
2580 <tr><td class="val" id="ft_style_flag_bold">FT_STYLE_FLAG_BOLD</td><td class="desc">
2581 <p>The face is bold.</p>
2582 </td></tr>
2583 </table>
2584
2585 <h4>note</h4>
2586
2587 <p>The style information as provided by FreeType is very basic. More details are beyond the scope and should be done on a higher level (for example, by analyzing various fields of the &lsquo;OS/2&rsquo; table in SFNT based fonts).</p>
2588 <hr>
2589
2590 <h2 id="ft_new_face">FT_New_Face<a class="headerlink" href="#ft_new_face" title="Permanent link">&para;</a></h2>
2591 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2592 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2593 <b>FT_New_Face</b>( <a href="ft2-library_setup.html#ft_library">FT_Library</a> library,
2594 <span class="keyword">const</span> <span class="keyword">char</span>* filepathname,
2595 <a href="ft2-basic_types.html#ft_long">FT_Long</a> face_index,
2596 <a href="ft2-face_creation.html#ft_face">FT_Face</a> *aface );
2597 </code></pre></div>
2598
2599 <p>Call <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> to open a font by its pathname.</p>
2600 <h4>inout</h4>
2601 <table class="fields">
2602 <tr><td class="val" id="library">library</td><td class="desc">
2603 <p>A handle to the library resource.</p>
2604 </td></tr>
2605 </table>
2606
2607 <h4>input</h4>
2608 <table class="fields">
2609 <tr><td class="val" id="pathname">pathname</td><td class="desc">
2610 <p>A path to the font file.</p>
2611 </td></tr>
2612 <tr><td class="val" id="face_index">face_index</td><td class="desc">
2613 <p>See <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> for a detailed description of this parameter.</p>
2614 </td></tr>
2615 </table>
2616
2617 <h4>output</h4>
2618 <table class="fields">
2619 <tr><td class="val" id="aface">aface</td><td class="desc">
2620 <p>A handle to a new face object. If <code>face_index</code> is greater than or equal to zero, it must be non-<code>NULL</code>.</p>
2621 </td></tr>
2622 </table>
2623
2624 <h4>return</h4>
2625
2626 <p>FreeType error code. 0&nbsp;means success.</p>
2627 <h4>note</h4>
2628
2629 <p>The <code>pathname</code> string should be recognizable as such by a standard <code>fopen</code> call on your system; in particular, this means that <code>pathname</code> must not contain null bytes. If that is not sufficient to address all file name possibilities (for example, to handle wide character file names on Windows in UTF-16 encoding) you might use <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> to pass a memory array or a stream object instead.</p>
2630 <p>Use <code><a href="ft2-face_creation.html#ft_done_face">FT_Done_Face</a></code> to destroy the created <code><a href="ft2-face_creation.html#ft_face">FT_Face</a></code> object (along with its slot and sizes).</p>
2631 <hr>
2632
2633 <h2 id="ft_done_face">FT_Done_Face<a class="headerlink" href="#ft_done_face" title="Permanent link">&para;</a></h2>
2634 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2635 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2636 <b>FT_Done_Face</b>( <a href="ft2-face_creation.html#ft_face">FT_Face</a> face );
2637 </code></pre></div>
2638
2639 <p>Discard a given face object, as well as all of its child slots and sizes.</p>
2640 <h4>input</h4>
2641 <table class="fields">
2642 <tr><td class="val" id="face">face</td><td class="desc">
2643 <p>A handle to a target face object.</p>
2644 </td></tr>
2645 </table>
2646
2647 <h4>return</h4>
2648
2649 <p>FreeType error code. 0&nbsp;means success.</p>
2650 <h4>note</h4>
2651
2652 <p>See the discussion of reference counters in the description of <code><a href="ft2-face_creation.html#ft_reference_face">FT_Reference_Face</a></code>.</p>
2653 <hr>
2654
2655 <h2 id="ft_reference_face">FT_Reference_Face<a class="headerlink" href="#ft_reference_face" title="Permanent link">&para;</a></h2>
2656 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2657 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2658 <b>FT_Reference_Face</b>( <a href="ft2-face_creation.html#ft_face">FT_Face</a> face );
2659 </code></pre></div>
2660
2661 <p>A counter gets initialized to&nbsp;1 at the time an <code><a href="ft2-face_creation.html#ft_face">FT_Face</a></code> structure is created. This function increments the counter. <code><a href="ft2-face_creation.html#ft_done_face">FT_Done_Face</a></code> then only destroys a face if the counter is&nbsp;1, otherwise it simply decrements the counter.</p>
2662 <p>This function helps in managing life-cycles of structures that reference <code><a href="ft2-face_creation.html#ft_face">FT_Face</a></code> objects.</p>
2663 <h4>input</h4>
2664 <table class="fields">
2665 <tr><td class="val" id="face">face</td><td class="desc">
2666 <p>A handle to a target face object.</p>
2667 </td></tr>
2668 </table>
2669
2670 <h4>return</h4>
2671
2672 <p>FreeType error code. 0&nbsp;means success.</p>
2673 <h4>since</h4>
2674
2675 <p>2.4.2</p>
2676 <hr>
2677
2678 <h2 id="ft_new_memory_face">FT_New_Memory_Face<a class="headerlink" href="#ft_new_memory_face" title="Permanent link">&para;</a></h2>
2679 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2680 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2681 <b>FT_New_Memory_Face</b>( <a href="ft2-library_setup.html#ft_library">FT_Library</a> library,
2682 <span class="keyword">const</span> <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>* file_base,
2683 <a href="ft2-basic_types.html#ft_long">FT_Long</a> file_size,
2684 <a href="ft2-basic_types.html#ft_long">FT_Long</a> face_index,
2685 <a href="ft2-face_creation.html#ft_face">FT_Face</a> *aface );
2686 </code></pre></div>
2687
2688 <p>Call <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> to open a font that has been loaded into memory.</p>
2689 <h4>inout</h4>
2690 <table class="fields">
2691 <tr><td class="val" id="library">library</td><td class="desc">
2692 <p>A handle to the library resource.</p>
2693 </td></tr>
2694 </table>
2695
2696 <h4>input</h4>
2697 <table class="fields">
2698 <tr><td class="val" id="file_base">file_base</td><td class="desc">
2699 <p>A pointer to the beginning of the font data.</p>
2700 </td></tr>
2701 <tr><td class="val" id="file_size">file_size</td><td class="desc">
2702 <p>The size of the memory chunk used by the font data.</p>
2703 </td></tr>
2704 <tr><td class="val" id="face_index">face_index</td><td class="desc">
2705 <p>See <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> for a detailed description of this parameter.</p>
2706 </td></tr>
2707 </table>
2708
2709 <h4>output</h4>
2710 <table class="fields">
2711 <tr><td class="val" id="aface">aface</td><td class="desc">
2712 <p>A handle to a new face object. If <code>face_index</code> is greater than or equal to zero, it must be non-<code>NULL</code>.</p>
2713 </td></tr>
2714 </table>
2715
2716 <h4>return</h4>
2717
2718 <p>FreeType error code. 0&nbsp;means success.</p>
2719 <h4>note</h4>
2720
2721 <p>You must not deallocate the memory before calling <code><a href="ft2-face_creation.html#ft_done_face">FT_Done_Face</a></code>.</p>
2722 <hr>
2723
2724 <h2 id="ft_face_properties">FT_Face_Properties<a class="headerlink" href="#ft_face_properties" title="Permanent link">&para;</a></h2>
2725 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2726 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2727 <b>FT_Face_Properties</b>( <a href="ft2-face_creation.html#ft_face">FT_Face</a> face,
2728 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> num_properties,
2729 <a href="ft2-face_creation.html#ft_parameter">FT_Parameter</a>* properties );
2730 </code></pre></div>
2731
2732 <p>Set or override certain (library or module-wide) properties on a face-by-face basis. Useful for finer-grained control and avoiding locks on shared structures (threads can modify their own faces as they see fit).</p>
2733 <p>Contrary to <code><a href="ft2-module_management.html#ft_property_set">FT_Property_Set</a></code>, this function uses <code><a href="ft2-face_creation.html#ft_parameter">FT_Parameter</a></code> so that you can pass multiple properties to the target face in one call. Note that only a subset of the available properties can be controlled.</p>
2734 <ul>
2735 <li>
2736 <p><code><a href="ft2-parameter_tags.html#ft_param_tag_stem_darkening">FT_PARAM_TAG_STEM_DARKENING</a></code> (stem darkening, corresponding to the property <code>no-stem-darkening</code> provided by the &lsquo;autofit&rsquo;, &lsquo;cff&rsquo;, &lsquo;type1&rsquo;, and &lsquo;t1cid&rsquo; modules; see <code><a href="ft2-properties.html#no-stem-darkening">no-stem-darkening</a></code>).</p>
2737 </li>
2738 <li>
2739 <p><code><a href="ft2-parameter_tags.html#ft_param_tag_random_seed">FT_PARAM_TAG_RANDOM_SEED</a></code> (seed value for the CFF, Type&nbsp;1, and CID &lsquo;random&rsquo; operator, corresponding to the <code>random-seed</code> property provided by the &lsquo;cff&rsquo;, &lsquo;type1&rsquo;, and &lsquo;t1cid&rsquo; modules; see <code><a href="ft2-properties.html#random-seed">random-seed</a></code>).</p>
2740 </li>
2741 <li>
2742 <p><code><a href="ft2-parameter_tags.html#ft_param_tag_lcd_filter_weights">FT_PARAM_TAG_LCD_FILTER_WEIGHTS</a></code> (no longer supported).</p>
2743 </li>
2744 </ul>
2745 <p>Pass <code>NULL</code> as <code>data</code> in <code><a href="ft2-face_creation.html#ft_parameter">FT_Parameter</a></code> for a given tag to reset the option and use the library or module default again.</p>
2746 <h4>input</h4>
2747 <table class="fields">
2748 <tr><td class="val" id="face">face</td><td class="desc">
2749 <p>A handle to the source face object.</p>
2750 </td></tr>
2751 <tr><td class="val" id="num_properties">num_properties</td><td class="desc">
2752 <p>The number of properties that follow.</p>
2753 </td></tr>
2754 <tr><td class="val" id="properties">properties</td><td class="desc">
2755 <p>A handle to an <code><a href="ft2-face_creation.html#ft_parameter">FT_Parameter</a></code> array with <code>num_properties</code> elements.</p>
2756 </td></tr>
2757 </table>
2758
2759 <h4>return</h4>
2760
2761 <p>FreeType error code. 0&nbsp;means success.</p>
2762 <h4>example</h4>
2763
2764 <p>Here is an example that sets three properties. You must define <code>FT_CONFIG_OPTION_SUBPIXEL_RENDERING</code> to make the LCD filter examples work.
2765 <div class="highlight"><pre><span></span><code> FT_Parameter property1;
2766 FT_Bool darken_stems = 1;
2767
2768 FT_Parameter property2;
2769 FT_Int32 random_seed = 314159265;
2770
2771 FT_Parameter properties[2] = { property1,
2772 property2 };
2773
2774
2775 property1.tag = FT_PARAM_TAG_STEM_DARKENING;
2776 property1.data = &amp;darken_stems;
2777
2778 property2.tag = FT_PARAM_TAG_RANDOM_SEED;
2779 property2.data = &amp;random_seed;
2780
2781 FT_Face_Properties( face, 3, properties );
2782 </code></pre></div></p>
2783 <p>The next example resets a single property to its default value.
2784 <div class="highlight"><pre><span></span><code> FT_Parameter property;
2785
2786
2787 property.tag = FT_PARAM_TAG_STEM_DARKENING;
2788 property.data = NULL;
2789
2790 FT_Face_Properties( face, 1, &amp;property );
2791 </code></pre></div></p>
2792 <h4>since</h4>
2793
2794 <p>2.8</p>
2795 <hr>
2796
2797 <h2 id="ft_open_face">FT_Open_Face<a class="headerlink" href="#ft_open_face" title="Permanent link">&para;</a></h2>
2798 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2799 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
2800 <b>FT_Open_Face</b>( <a href="ft2-library_setup.html#ft_library">FT_Library</a> library,
2801 <span class="keyword">const</span> <a href="ft2-face_creation.html#ft_open_args">FT_Open_Args</a>* args,
2802 <a href="ft2-basic_types.html#ft_long">FT_Long</a> face_index,
2803 <a href="ft2-face_creation.html#ft_face">FT_Face</a> *aface );
2804 </code></pre></div>
2805
2806 <p>Create a face object from a given resource described by <code><a href="ft2-face_creation.html#ft_open_args">FT_Open_Args</a></code>.</p>
2807 <h4>inout</h4>
2808 <table class="fields">
2809 <tr><td class="val" id="library">library</td><td class="desc">
2810 <p>A handle to the library resource.</p>
2811 </td></tr>
2812 </table>
2813
2814 <h4>input</h4>
2815 <table class="fields">
2816 <tr><td class="val" id="args">args</td><td class="desc">
2817 <p>A pointer to an <code>FT_Open_Args</code> structure that must be filled by the caller.</p>
2818 </td></tr>
2819 <tr><td class="val" id="face_index">face_index</td><td class="desc">
2820 <p>This field holds two different values. Bits 0-15 are the index of the face in the font file (starting with value 0). Set it to 0 if there is only one face in the font file.</p>
2821 <p>[Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType Font Variations only, specifying the named instance index for the current face index (starting with value 1; value 0 makes FreeType ignore named instances). For non-variation fonts, bits 16-30 are ignored. Assuming that you want to access the third named instance in face 4, <code>face_index</code> should be set to 0x00030004. If you want to access face 4 without variation handling, simply set <code>face_index</code> to value 4.</p>
2822 <p><code>FT_Open_Face</code> and its siblings can be used to quickly check whether the font format of a given font resource is supported by FreeType. In general, if the <code>face_index</code> argument is negative, the function's return value is 0 if the font format is recognized, or non-zero otherwise. The function allocates a more or less empty face handle in <code>*aface</code> (if <code>aface</code> isn't <code>NULL</code>); the only two useful fields in this special case are <code>face-&gt;num_faces</code> and <code>face-&gt;style_flags</code>. For any negative value of <code>face_index</code>, <code>face-&gt;num_faces</code> gives the number of faces within the font file. For the negative value ‘-(N+1)’ (with ‘N’ a non-negative 16-bit value), bits 16-30 in <code>face-&gt;style_flags</code> give the number of named instances in face ‘N’ if we have a variation font (or zero otherwise). After examination, the returned <code><a href="ft2-face_creation.html#ft_face">FT_Face</a></code> structure should be deallocated with a call to <code><a href="ft2-face_creation.html#ft_done_face">FT_Done_Face</a></code>.</p>
2823 </td></tr>
2824 </table>
2825
2826 <h4>output</h4>
2827 <table class="fields">
2828 <tr><td class="val" id="aface">aface</td><td class="desc">
2829 <p>A handle to a new face object. If <code>face_index</code> is greater than or equal to zero, it must be non-<code>NULL</code>.</p>
2830 </td></tr>
2831 </table>
2832
2833 <h4>return</h4>
2834
2835 <p>FreeType error code. 0&nbsp;means success.</p>
2836 <h4>note</h4>
2837
2838 <p>Unlike FreeType 1.x, this function automatically creates a glyph slot for the face object that can be accessed directly through <code>face-&gt;glyph</code>.</p>
2839 <p>Each new face object created with this function also owns a default <code><a href="ft2-sizing_and_scaling.html#ft_size">FT_Size</a></code> object, accessible as <code>face-&gt;size</code>.</p>
2840 <p>One <code><a href="ft2-library_setup.html#ft_library">FT_Library</a></code> instance can have multiple face objects, that is, <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> and its siblings can be called multiple times using the same <code>library</code> argument.</p>
2841 <p>See the discussion of reference counters in the description of <code><a href="ft2-face_creation.html#ft_reference_face">FT_Reference_Face</a></code>.</p>
2842 <p>If <code>FT_OPEN_STREAM</code> is set in <code>args-&gt;flags</code>, the stream in <code>args-&gt;stream</code> is automatically closed before this function returns any error (including <code>FT_Err_Invalid_Argument</code>).</p>
2843 <h4>example</h4>
2844
2845 <p>To loop over all faces, use code similar to the following snippet (omitting the error handling).
2846 <div class="highlight"><pre><span></span><code> ...
2847 FT_Face face;
2848 FT_Long i, num_faces;
2849
2850
2851 error = FT_Open_Face( library, args, -1, &amp;face );
2852 if ( error ) { ... }
2853
2854 num_faces = face-&gt;num_faces;
2855 FT_Done_Face( face );
2856
2857 for ( i = 0; i &lt; num_faces; i++ )
2858 {
2859 ...
2860 error = FT_Open_Face( library, args, i, &amp;face );
2861 ...
2862 FT_Done_Face( face );
2863 ...
2864 }
2865 </code></pre></div></p>
2866 <p>To loop over all valid values for <code>face_index</code>, use something similar to the following snippet, again without error handling. The code accesses all faces immediately (thus only a single call of <code>FT_Open_Face</code> within the do-loop), with and without named instances.
2867 <div class="highlight"><pre><span></span><code> ...
2868 FT_Face face;
2869
2870 FT_Long num_faces = 0;
2871 FT_Long num_instances = 0;
2872
2873 FT_Long face_idx = 0;
2874 FT_Long instance_idx = 0;
2875
2876
2877 do
2878 {
2879 FT_Long id = ( instance_idx &lt;&lt; 16 ) + face_idx;
2880
2881
2882 error = FT_Open_Face( library, args, id, &amp;face );
2883 if ( error ) { ... }
2884
2885 num_faces = face-&gt;num_faces;
2886 num_instances = face-&gt;style_flags &gt;&gt; 16;
2887
2888 ...
2889
2890 FT_Done_Face( face );
2891
2892 if ( instance_idx &lt; num_instances )
2893 instance_idx++;
2894 else
2895 {
2896 face_idx++;
2897 instance_idx = 0;
2898 }
2899
2900 } while ( face_idx &lt; num_faces )
2901 </code></pre></div></p>
2902 <hr>
2903
2904 <h2 id="ft_open_args">FT_Open_Args<a class="headerlink" href="#ft_open_args" title="Permanent link">&para;</a></h2>
2905 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2906 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Open_Args_
2907 {
2908 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> flags;
2909 <span class="keyword">const</span> <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>* memory_base;
2910 <a href="ft2-basic_types.html#ft_long">FT_Long</a> memory_size;
2911 <a href="ft2-basic_types.html#ft_string">FT_String</a>* pathname;
2912 <a href="ft2-system_interface.html#ft_stream">FT_Stream</a> stream;
2913 <a href="ft2-module_management.html#ft_module">FT_Module</a> driver;
2914 <a href="ft2-basic_types.html#ft_int">FT_Int</a> num_params;
2915 <a href="ft2-face_creation.html#ft_parameter">FT_Parameter</a>* params;
2916
2917 } <b>FT_Open_Args</b>;
2918 </code></pre></div>
2919
2920 <p>A structure to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> and <code><a href="ft2-face_creation.html#ft_attach_stream">FT_Attach_Stream</a></code>.</p>
2921 <h4>fields</h4>
2922 <table class="fields">
2923 <tr><td class="val" id="flags">flags</td><td class="desc">
2924 <p>A set of bit flags indicating how to use the structure.</p>
2925 </td></tr>
2926 <tr><td class="val" id="memory_base">memory_base</td><td class="desc">
2927 <p>The first byte of the file in memory.</p>
2928 </td></tr>
2929 <tr><td class="val" id="memory_size">memory_size</td><td class="desc">
2930 <p>The size in bytes of the file in memory.</p>
2931 </td></tr>
2932 <tr><td class="val" id="pathname">pathname</td><td class="desc">
2933 <p>A pointer to an 8-bit file pathname, which must be a C string (i.e., no null bytes except at the very end). The pointer is not owned by FreeType.</p>
2934 </td></tr>
2935 <tr><td class="val" id="stream">stream</td><td class="desc">
2936 <p>A handle to a source stream object.</p>
2937 </td></tr>
2938 <tr><td class="val" id="driver">driver</td><td class="desc">
2939 <p>This field is exclusively used by <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code>; it simply specifies the font driver to use for opening the face. If set to <code>NULL</code>, FreeType tries to load the face with each one of the drivers in its list.</p>
2940 </td></tr>
2941 <tr><td class="val" id="num_params">num_params</td><td class="desc">
2942 <p>The number of extra parameters.</p>
2943 </td></tr>
2944 <tr><td class="val" id="params">params</td><td class="desc">
2945 <p>Extra parameters passed to the font driver when opening a new face.</p>
2946 </td></tr>
2947 </table>
2948
2949 <h4>note</h4>
2950
2951 <p>The stream type is determined by the contents of <code>flags</code>:</p>
2952 <p>If the <code><a href="ft2-face_creation.html#ft_open_xxx">FT_OPEN_MEMORY</a></code> bit is set, assume that this is a memory file of <code>memory_size</code> bytes, located at <code>memory_address</code>. The data are not copied, and the client is responsible for releasing and destroying them <em>after</em> the corresponding call to <code><a href="ft2-face_creation.html#ft_done_face">FT_Done_Face</a></code>.</p>
2953 <p>Otherwise, if the <code><a href="ft2-face_creation.html#ft_open_xxx">FT_OPEN_STREAM</a></code> bit is set, assume that a custom input stream <code>stream</code> is used.</p>
2954 <p>Otherwise, if the <code><a href="ft2-face_creation.html#ft_open_xxx">FT_OPEN_PATHNAME</a></code> bit is set, assume that this is a normal file and use <code>pathname</code> to open it.</p>
2955 <p>If none of the above bits are set or if multiple are set at the same time, the flags are invalid and <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> fails.</p>
2956 <p>If the <code><a href="ft2-face_creation.html#ft_open_xxx">FT_OPEN_DRIVER</a></code> bit is set, <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> only tries to open the file with the driver whose handler is in <code>driver</code>.</p>
2957 <p>If the <code><a href="ft2-face_creation.html#ft_open_xxx">FT_OPEN_PARAMS</a></code> bit is set, the parameters given by <code>num_params</code> and <code>params</code> is used. They are ignored otherwise.</p>
2958 <p>Ideally, both the <code>pathname</code> and <code>params</code> fields should be tagged as &lsquo;const&rsquo;; this is missing for API backward compatibility. In other words, applications should treat them as read-only.</p>
2959 <hr>
2960
2961 <h2 id="ft_open_xxx">FT_OPEN_XXX<a class="headerlink" href="#ft_open_xxx" title="Permanent link">&para;</a></h2>
2962 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
2963 <div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_open_memory">FT_OPEN_MEMORY</a> 0x1
2964 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_open_stream">FT_OPEN_STREAM</a> 0x2
2965 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_open_pathname">FT_OPEN_PATHNAME</a> 0x4
2966 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_open_driver">FT_OPEN_DRIVER</a> 0x8
2967 #<span class="keyword">define</span> <a href="ft2-face_creation.html#ft_open_params">FT_OPEN_PARAMS</a> 0x10
2968
2969
2970 /* these constants are deprecated; use the corresponding `<b>FT_OPEN_XXX</b>` */
2971 /* values instead */
2972 #<span class="keyword">define</span> ft_open_memory <a href="ft2-face_creation.html#ft_open_memory">FT_OPEN_MEMORY</a>
2973 #<span class="keyword">define</span> ft_open_stream <a href="ft2-face_creation.html#ft_open_stream">FT_OPEN_STREAM</a>
2974 #<span class="keyword">define</span> ft_open_pathname <a href="ft2-face_creation.html#ft_open_pathname">FT_OPEN_PATHNAME</a>
2975 #<span class="keyword">define</span> ft_open_driver <a href="ft2-face_creation.html#ft_open_driver">FT_OPEN_DRIVER</a>
2976 #<span class="keyword">define</span> ft_open_params <a href="ft2-face_creation.html#ft_open_params">FT_OPEN_PARAMS</a>
2977 </code></pre></div>
2978
2979 <p>A list of bit field constants used within the <code>flags</code> field of the <code><a href="ft2-face_creation.html#ft_open_args">FT_Open_Args</a></code> structure.</p>
2980 <h4>values</h4>
2981 <table class="fields">
2982 <tr><td class="val" id="ft_open_memory">FT_OPEN_MEMORY</td><td class="desc">
2983 <p>This is a memory-based stream.</p>
2984 </td></tr>
2985 <tr><td class="val" id="ft_open_stream">FT_OPEN_STREAM</td><td class="desc">
2986 <p>Copy the stream from the <code>stream</code> field.</p>
2987 </td></tr>
2988 <tr><td class="val" id="ft_open_pathname">FT_OPEN_PATHNAME</td><td class="desc">
2989 <p>Create a new input stream from a C path name.</p>
2990 </td></tr>
2991 <tr><td class="val" id="ft_open_driver">FT_OPEN_DRIVER</td><td class="desc">
2992 <p>Use the <code>driver</code> field.</p>
2993 </td></tr>
2994 <tr><td class="val" id="ft_open_params">FT_OPEN_PARAMS</td><td class="desc">
2995 <p>Use the <code>num_params</code> and <code>params</code> fields.</p>
2996 </td></tr>
2997 </table>
2998
2999 <h4>note</h4>
3000
3001 <p>The <code>FT_OPEN_MEMORY</code>, <code>FT_OPEN_STREAM</code>, and <code>FT_OPEN_PATHNAME</code> flags are mutually exclusive.</p>
3002 <hr>
3003
3004 <h2 id="ft_parameter">FT_Parameter<a class="headerlink" href="#ft_parameter" title="Permanent link">&para;</a></h2>
3005 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
3006 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Parameter_
3007 {
3008 <a href="ft2-basic_types.html#ft_ulong">FT_ULong</a> tag;
3009 <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> data;
3010
3011 } <b>FT_Parameter</b>;
3012 </code></pre></div>
3013
3014 <p>A simple structure to pass more or less generic parameters to <code><a href="ft2-face_creation.html#ft_open_face">FT_Open_Face</a></code> and <code><a href="ft2-face_creation.html#ft_face_properties">FT_Face_Properties</a></code>.</p>
3015 <h4>fields</h4>
3016 <table class="fields">
3017 <tr><td class="val" id="tag">tag</td><td class="desc">
3018 <p>A four-byte identification tag.</p>
3019 </td></tr>
3020 <tr><td class="val" id="data">data</td><td class="desc">
3021 <p>A pointer to the parameter data.</p>
3022 </td></tr>
3023 </table>
3024
3025 <h4>note</h4>
3026
3027 <p>The ID and function of parameters are driver-specific. See section &lsquo;<a href="ft2-parameter_tags.html#parameter_tags">Parameter Tags</a>&rsquo; for more information.</p>
3028 <hr>
3029
3030 <h2 id="ft_attach_file">FT_Attach_File<a class="headerlink" href="#ft_attach_file" title="Permanent link">&para;</a></h2>
3031 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
3032 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
3033 <b>FT_Attach_File</b>( <a href="ft2-face_creation.html#ft_face">FT_Face</a> face,
3034 <span class="keyword">const</span> <span class="keyword">char</span>* filepathname );
3035 </code></pre></div>
3036
3037 <p>Call <code><a href="ft2-face_creation.html#ft_attach_stream">FT_Attach_Stream</a></code> to attach a file.</p>
3038 <h4>inout</h4>
3039 <table class="fields">
3040 <tr><td class="val" id="face">face</td><td class="desc">
3041 <p>The target face object.</p>
3042 </td></tr>
3043 </table>
3044
3045 <h4>input</h4>
3046 <table class="fields">
3047 <tr><td class="val" id="filepathname">filepathname</td><td class="desc">
3048 <p>The pathname.</p>
3049 </td></tr>
3050 </table>
3051
3052 <h4>return</h4>
3053
3054 <p>FreeType error code. 0&nbsp;means success.</p>
3055 <hr>
3056
3057 <h2 id="ft_attach_stream">FT_Attach_Stream<a class="headerlink" href="#ft_attach_stream" title="Permanent link">&para;</a></h2>
3058 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
3059 <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
3060 <b>FT_Attach_Stream</b>( <a href="ft2-face_creation.html#ft_face">FT_Face</a> face,
3061 <span class="keyword">const</span> <a href="ft2-face_creation.html#ft_open_args">FT_Open_Args</a>* parameters );
3062 </code></pre></div>
3063
3064 <p>&lsquo;Attach&rsquo; data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type&nbsp;1 font to get the kerning values and other metrics.</p>
3065 <h4>inout</h4>
3066 <table class="fields">
3067 <tr><td class="val" id="face">face</td><td class="desc">
3068 <p>The target face object.</p>
3069 </td></tr>
3070 </table>
3071
3072 <h4>input</h4>
3073 <table class="fields">
3074 <tr><td class="val" id="parameters">parameters</td><td class="desc">
3075 <p>A pointer to <code><a href="ft2-face_creation.html#ft_open_args">FT_Open_Args</a></code> that must be filled by the caller.</p>
3076 </td></tr>
3077 </table>
3078
3079 <h4>return</h4>
3080
3081 <p>FreeType error code. 0&nbsp;means success.</p>
3082 <h4>note</h4>
3083
3084 <p>The meaning of the &lsquo;attach&rsquo; (i.e., what really happens when the new file is read) is not fixed by FreeType itself. It really depends on the font format (and thus the font driver).</p>
3085 <p>Client applications are expected to know what they are doing when invoking this function. Most drivers simply do not implement file or stream attachments.</p>
3086 <hr>
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100 </article>
3101 </div>
3102
3103
3104 <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
3105 </div>
3106
3107 </main>
3108
3109 <footer class="md-footer">
3110
3111 <div class="md-footer-meta md-typeset">
3112 <div class="md-footer-meta__inner md-grid">
3113 <div class="md-copyright">
3114
3115 <div class="md-copyright__highlight">
3116 Copyright 2026 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
3117 </div>
3118
3119
3120 Made with
3121 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
3122 Material for MkDocs
3123 </a>
3124
3125 </div>
3126
3127 </div>
3128 </div>
3129 </footer>
3130
3131 </div>
3132 <div class="md-dialog" data-md-component="dialog">
3133 <div class="md-dialog__inner md-typeset"></div>
3134 </div>
3135
3136
3137 <script id="__config" type="application/json">{"base": ".", "features": [], "search": "assets/javascripts/workers/search.f8cc74c7.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
3138
3139
3140 <script src="assets/javascripts/bundle.c8b220af.min.js"></script>
3141
3142 <script src="javascripts/extra.js"></script>
3143
3144
3145 </body>
3146 </html>