Imported Upstream version 2.10.1
[platform/upstream/freetype2.git] / docs / reference / site / ft2-layer_management.html
1
2
3
4
5 <!doctype html>
6 <html lang="en" class="no-js">
7   <head>
8     
9       <meta charset="utf-8">
10       <meta name="viewport" content="width=device-width,initial-scale=1">
11       <meta http-equiv="x-ua-compatible" content="ie=edge">
12       
13         <meta name="description" content="API Reference Documentation for FreeType-2.10.1">
14       
15       
16       
17         <meta name="author" content="FreeType Contributors">
18       
19       
20         <meta name="lang:clipboard.copy" content="Copy to clipboard">
21       
22         <meta name="lang:clipboard.copied" content="Copied to clipboard">
23       
24         <meta name="lang:search.language" content="en">
25       
26         <meta name="lang:search.pipeline.stopwords" content="True">
27       
28         <meta name="lang:search.pipeline.trimmer" content="True">
29       
30         <meta name="lang:search.result.none" content="No matching documents">
31       
32         <meta name="lang:search.result.one" content="1 matching document">
33       
34         <meta name="lang:search.result.other" content="# matching documents">
35       
36         <meta name="lang:search.tokenizer" content="[\s\-]+">
37       
38       <link rel="shortcut icon" href="images/favico.ico">
39       <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.0.2">
40     
41     
42       
43         <title>Glyph Layer Management - FreeType-2.10.1 API Reference</title>
44       
45     
46     
47       <link rel="stylesheet" href="assets/stylesheets/application.982221ab.css">
48       
49         <link rel="stylesheet" href="assets/stylesheets/application-palette.224b79ff.css">
50       
51       
52         
53         
54         <meta name="theme-color" content="#4caf50">
55       
56     
57     
58       <script src="assets/javascripts/modernizr.1f0bcf2b.js"></script>
59     
60     
61       
62         <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
63         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,400,400i,700|Roboto+Mono">
64         <style>body,input{font-family:"Noto Serif","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
65       
66     
67     <link rel="stylesheet" href="assets/fonts/material-icons.css">
68     
69     
70       <link rel="stylesheet" href="stylesheets/extra.css">
71     
72     
73       
74     
75     
76   </head>
77   
78     
79     
80     <body dir="ltr" data-md-color-primary="green" data-md-color-accent="green">
81   
82     <svg class="md-svg">
83       <defs>
84         
85         
86       </defs>
87     </svg>
88     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
89     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
90     <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
91     
92       <a href="#glyph-layer-management" tabindex="1" class="md-skip">
93         Skip to content
94       </a>
95     
96     
97       <header class="md-header" data-md-component="header">
98   <nav class="md-header-nav md-grid">
99     <div class="md-flex">
100       <div class="md-flex__cell md-flex__cell--shrink">
101         <a href="index.html" title="FreeType-2.10.1 API Reference" class="md-header-nav__button md-logo">
102           
103             <img src="images/favico.ico" width="24" height="24">
104           
105         </a>
106       </div>
107       <div class="md-flex__cell md-flex__cell--shrink">
108         <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
109       </div>
110       <div class="md-flex__cell md-flex__cell--stretch">
111         <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
112           
113             <span class="md-header-nav__topic">
114               FreeType-2.10.1 API Reference
115             </span>
116             <span class="md-header-nav__topic">
117               Glyph Layer Management
118             </span>
119           
120         </div>
121       </div>
122       <div class="md-flex__cell md-flex__cell--shrink">
123         
124           <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
125           
126 <div class="md-search" data-md-component="search" role="dialog">
127   <label class="md-search__overlay" for="__search"></label>
128   <div class="md-search__inner" role="search">
129     <form class="md-search__form" name="search">
130       <input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
131       <label class="md-icon md-search__icon" for="__search"></label>
132       <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
133         &#xE5CD;
134       </button>
135     </form>
136     <div class="md-search__output">
137       <div class="md-search__scrollwrap" data-md-scrollfix>
138         <div class="md-search-result" data-md-component="result">
139           <div class="md-search-result__meta">
140             Type to start searching
141           </div>
142           <ol class="md-search-result__list"></ol>
143         </div>
144       </div>
145     </div>
146   </div>
147 </div>
148         
149       </div>
150       
151     </div>
152   </nav>
153 </header>
154     
155     <div class="md-container">
156       
157         
158       
159       
160       <main class="md-main">
161         <div class="md-main__inner md-grid" data-md-component="container">
162           
163             
164               <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
165                 <div class="md-sidebar__scrollwrap">
166                   <div class="md-sidebar__inner">
167                     <nav class="md-nav md-nav--primary" data-md-level="0">
168   <label class="md-nav__title md-nav__title--site" for="__drawer">
169     <a href="index.html" title="FreeType-2.10.1 API Reference" class="md-nav__button md-logo">
170       
171         <img src="images/favico.ico" width="48" height="48">
172       
173     </a>
174     FreeType-2.10.1 API Reference
175   </label>
176   
177   <ul class="md-nav__list" data-md-scrollfix>
178     
179       
180       
181       
182
183
184   <li class="md-nav__item">
185     <a href="index.html" title="TOC" class="md-nav__link">
186       TOC
187     </a>
188   </li>
189
190     
191       
192       
193       
194
195
196   <li class="md-nav__item">
197     <a href="ft2-index.html" title="Index" class="md-nav__link">
198       Index
199     </a>
200   </li>
201
202     
203       
204       
205       
206
207
208   <li class="md-nav__item md-nav__item--nested">
209     
210       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
211     
212     <label class="md-nav__link" for="nav-3">
213       General Remarks
214     </label>
215     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
216       <label class="md-nav__title" for="nav-3">
217         General Remarks
218       </label>
219       <ul class="md-nav__list" data-md-scrollfix>
220         
221         
222           
223           
224           
225
226
227   <li class="md-nav__item">
228     <a href="ft2-header_inclusion.html" title="FreeType's header inclusion scheme" class="md-nav__link">
229       FreeType's header inclusion scheme
230     </a>
231   </li>
232
233         
234           
235           
236           
237
238
239   <li class="md-nav__item">
240     <a href="ft2-user_allocation.html" title="User allocation" class="md-nav__link">
241       User allocation
242     </a>
243   </li>
244
245         
246       </ul>
247     </nav>
248   </li>
249
250     
251       
252       
253       
254
255   
256
257
258   <li class="md-nav__item md-nav__item--active md-nav__item--nested">
259     
260       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" checked>
261     
262     <label class="md-nav__link" for="nav-4">
263       Core API
264     </label>
265     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
266       <label class="md-nav__title" for="nav-4">
267         Core API
268       </label>
269       <ul class="md-nav__list" data-md-scrollfix>
270         
271         
272           
273           
274           
275
276
277   <li class="md-nav__item">
278     <a href="ft2-version.html" title="FreeType Version" class="md-nav__link">
279       FreeType Version
280     </a>
281   </li>
282
283         
284           
285           
286           
287
288
289   <li class="md-nav__item">
290     <a href="ft2-basic_types.html" title="Basic Data Types" class="md-nav__link">
291       Basic Data Types
292     </a>
293   </li>
294
295         
296           
297           
298           
299
300
301   <li class="md-nav__item">
302     <a href="ft2-base_interface.html" title="Base Interface" class="md-nav__link">
303       Base Interface
304     </a>
305   </li>
306
307         
308           
309           
310           
311
312
313   <li class="md-nav__item">
314     <a href="ft2-glyph_variants.html" title="Unicode Variation Sequences" class="md-nav__link">
315       Unicode Variation Sequences
316     </a>
317   </li>
318
319         
320           
321           
322           
323
324
325   <li class="md-nav__item">
326     <a href="ft2-color_management.html" title="Glyph Color Management" class="md-nav__link">
327       Glyph Color Management
328     </a>
329   </li>
330
331         
332           
333           
334           
335
336   
337
338
339   <li class="md-nav__item md-nav__item--active">
340     
341     <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
342     
343       
344     
345     
346       <label class="md-nav__link md-nav__link--active" for="__toc">
347         Glyph Layer Management
348       </label>
349     
350     <a href="ft2-layer_management.html" title="Glyph Layer Management" class="md-nav__link md-nav__link--active">
351       Glyph Layer Management
352     </a>
353     
354       
355 <nav class="md-nav md-nav--secondary">
356   
357   
358     
359   
360   
361     <label class="md-nav__title" for="__toc">Table of contents</label>
362     <ul class="md-nav__list" data-md-scrollfix>
363       
364         <li class="md-nav__item">
365   <a href="#synopsis" title="Synopsis" class="md-nav__link">
366     Synopsis
367   </a>
368   
369 </li>
370       
371         <li class="md-nav__item">
372   <a href="#ft_layeriterator" title="FT_LayerIterator" class="md-nav__link">
373     FT_LayerIterator
374   </a>
375   
376 </li>
377       
378         <li class="md-nav__item">
379   <a href="#ft_get_color_glyph_layer" title="FT_Get_Color_Glyph_Layer" class="md-nav__link">
380     FT_Get_Color_Glyph_Layer
381   </a>
382   
383 </li>
384       
385       
386       
387       
388       
389     </ul>
390   
391 </nav>
392     
393   </li>
394
395         
396           
397           
398           
399
400
401   <li class="md-nav__item">
402     <a href="ft2-glyph_management.html" title="Glyph Management" class="md-nav__link">
403       Glyph Management
404     </a>
405   </li>
406
407         
408           
409           
410           
411
412
413   <li class="md-nav__item">
414     <a href="ft2-mac_specific.html" title="Mac Specific Interface" class="md-nav__link">
415       Mac Specific Interface
416     </a>
417   </li>
418
419         
420           
421           
422           
423
424
425   <li class="md-nav__item">
426     <a href="ft2-sizes_management.html" title="Size Management" class="md-nav__link">
427       Size Management
428     </a>
429   </li>
430
431         
432           
433           
434           
435
436
437   <li class="md-nav__item">
438     <a href="ft2-header_file_macros.html" title="Header File Macros" class="md-nav__link">
439       Header File Macros
440     </a>
441   </li>
442
443         
444       </ul>
445     </nav>
446   </li>
447
448     
449       
450       
451       
452
453
454   <li class="md-nav__item md-nav__item--nested">
455     
456       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
457     
458     <label class="md-nav__link" for="nav-5">
459       Format-Specific API
460     </label>
461     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
462       <label class="md-nav__title" for="nav-5">
463         Format-Specific API
464       </label>
465       <ul class="md-nav__list" data-md-scrollfix>
466         
467         
468           
469           
470           
471
472
473   <li class="md-nav__item">
474     <a href="ft2-multiple_masters.html" title="Multiple Masters" class="md-nav__link">
475       Multiple Masters
476     </a>
477   </li>
478
479         
480           
481           
482           
483
484
485   <li class="md-nav__item">
486     <a href="ft2-truetype_tables.html" title="TrueType Tables" class="md-nav__link">
487       TrueType Tables
488     </a>
489   </li>
490
491         
492           
493           
494           
495
496
497   <li class="md-nav__item">
498     <a href="ft2-type1_tables.html" title="Type 1 Tables" class="md-nav__link">
499       Type 1 Tables
500     </a>
501   </li>
502
503         
504           
505           
506           
507
508
509   <li class="md-nav__item">
510     <a href="ft2-sfnt_names.html" title="SFNT Names" class="md-nav__link">
511       SFNT Names
512     </a>
513   </li>
514
515         
516           
517           
518           
519
520
521   <li class="md-nav__item">
522     <a href="ft2-bdf_fonts.html" title="BDF and PCF Files" class="md-nav__link">
523       BDF and PCF Files
524     </a>
525   </li>
526
527         
528           
529           
530           
531
532
533   <li class="md-nav__item">
534     <a href="ft2-cid_fonts.html" title="CID Fonts" class="md-nav__link">
535       CID Fonts
536     </a>
537   </li>
538
539         
540           
541           
542           
543
544
545   <li class="md-nav__item">
546     <a href="ft2-pfr_fonts.html" title="PFR Fonts" class="md-nav__link">
547       PFR Fonts
548     </a>
549   </li>
550
551         
552           
553           
554           
555
556
557   <li class="md-nav__item">
558     <a href="ft2-winfnt_fonts.html" title="Window FNT Files" class="md-nav__link">
559       Window FNT Files
560     </a>
561   </li>
562
563         
564           
565           
566           
567
568
569   <li class="md-nav__item">
570     <a href="ft2-font_formats.html" title="Font Formats" class="md-nav__link">
571       Font Formats
572     </a>
573   </li>
574
575         
576           
577           
578           
579
580
581   <li class="md-nav__item">
582     <a href="ft2-gasp_table.html" title="Gasp Table" class="md-nav__link">
583       Gasp Table
584     </a>
585   </li>
586
587         
588       </ul>
589     </nav>
590   </li>
591
592     
593       
594       
595       
596
597
598   <li class="md-nav__item md-nav__item--nested">
599     
600       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6">
601     
602     <label class="md-nav__link" for="nav-6">
603       Controlling FreeType Modules
604     </label>
605     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
606       <label class="md-nav__title" for="nav-6">
607         Controlling FreeType Modules
608       </label>
609       <ul class="md-nav__list" data-md-scrollfix>
610         
611         
612           
613           
614           
615
616
617   <li class="md-nav__item">
618     <a href="ft2-auto_hinter.html" title="The auto-hinter" class="md-nav__link">
619       The auto-hinter
620     </a>
621   </li>
622
623         
624           
625           
626           
627
628
629   <li class="md-nav__item">
630     <a href="ft2-cff_driver.html" title="The CFF driver" class="md-nav__link">
631       The CFF driver
632     </a>
633   </li>
634
635         
636           
637           
638           
639
640
641   <li class="md-nav__item">
642     <a href="ft2-t1_cid_driver.html" title="The Type 1 and CID drivers" class="md-nav__link">
643       The Type 1 and CID drivers
644     </a>
645   </li>
646
647         
648           
649           
650           
651
652
653   <li class="md-nav__item">
654     <a href="ft2-tt_driver.html" title="The TrueType driver" class="md-nav__link">
655       The TrueType driver
656     </a>
657   </li>
658
659         
660           
661           
662           
663
664
665   <li class="md-nav__item">
666     <a href="ft2-pcf_driver.html" title="The PCF driver" class="md-nav__link">
667       The PCF driver
668     </a>
669   </li>
670
671         
672           
673           
674           
675
676
677   <li class="md-nav__item">
678     <a href="ft2-properties.html" title="Driver properties" class="md-nav__link">
679       Driver properties
680     </a>
681   </li>
682
683         
684           
685           
686           
687
688
689   <li class="md-nav__item">
690     <a href="ft2-parameter_tags.html" title="Parameter Tags" class="md-nav__link">
691       Parameter Tags
692     </a>
693   </li>
694
695         
696           
697           
698           
699
700
701   <li class="md-nav__item">
702     <a href="ft2-lcd_rendering.html" title="Subpixel Rendering" class="md-nav__link">
703       Subpixel Rendering
704     </a>
705   </li>
706
707         
708       </ul>
709     </nav>
710   </li>
711
712     
713       
714       
715       
716
717
718   <li class="md-nav__item md-nav__item--nested">
719     
720       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7">
721     
722     <label class="md-nav__link" for="nav-7">
723       Cache Sub-System
724     </label>
725     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
726       <label class="md-nav__title" for="nav-7">
727         Cache Sub-System
728       </label>
729       <ul class="md-nav__list" data-md-scrollfix>
730         
731         
732           
733           
734           
735
736
737   <li class="md-nav__item">
738     <a href="ft2-cache_subsystem.html" title="Cache Sub-System" class="md-nav__link">
739       Cache Sub-System
740     </a>
741   </li>
742
743         
744       </ul>
745     </nav>
746   </li>
747
748     
749       
750       
751       
752
753
754   <li class="md-nav__item md-nav__item--nested">
755     
756       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-8" type="checkbox" id="nav-8">
757     
758     <label class="md-nav__link" for="nav-8">
759       Support API
760     </label>
761     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
762       <label class="md-nav__title" for="nav-8">
763         Support API
764       </label>
765       <ul class="md-nav__list" data-md-scrollfix>
766         
767         
768           
769           
770           
771
772
773   <li class="md-nav__item">
774     <a href="ft2-computations.html" title="Computations" class="md-nav__link">
775       Computations
776     </a>
777   </li>
778
779         
780           
781           
782           
783
784
785   <li class="md-nav__item">
786     <a href="ft2-list_processing.html" title="List Processing" class="md-nav__link">
787       List Processing
788     </a>
789   </li>
790
791         
792           
793           
794           
795
796
797   <li class="md-nav__item">
798     <a href="ft2-outline_processing.html" title="Outline Processing" class="md-nav__link">
799       Outline Processing
800     </a>
801   </li>
802
803         
804           
805           
806           
807
808
809   <li class="md-nav__item">
810     <a href="ft2-quick_advance.html" title="Quick retrieval of advance values" class="md-nav__link">
811       Quick retrieval of advance values
812     </a>
813   </li>
814
815         
816           
817           
818           
819
820
821   <li class="md-nav__item">
822     <a href="ft2-bitmap_handling.html" title="Bitmap Handling" class="md-nav__link">
823       Bitmap Handling
824     </a>
825   </li>
826
827         
828           
829           
830           
831
832
833   <li class="md-nav__item">
834     <a href="ft2-raster.html" title="Scanline Converter" class="md-nav__link">
835       Scanline Converter
836     </a>
837   </li>
838
839         
840           
841           
842           
843
844
845   <li class="md-nav__item">
846     <a href="ft2-glyph_stroker.html" title="Glyph Stroker" class="md-nav__link">
847       Glyph Stroker
848     </a>
849   </li>
850
851         
852           
853           
854           
855
856
857   <li class="md-nav__item">
858     <a href="ft2-system_interface.html" title="System Interface" class="md-nav__link">
859       System Interface
860     </a>
861   </li>
862
863         
864           
865           
866           
867
868
869   <li class="md-nav__item">
870     <a href="ft2-module_management.html" title="Module Management" class="md-nav__link">
871       Module Management
872     </a>
873   </li>
874
875         
876           
877           
878           
879
880
881   <li class="md-nav__item">
882     <a href="ft2-gzip.html" title="GZIP Streams" class="md-nav__link">
883       GZIP Streams
884     </a>
885   </li>
886
887         
888           
889           
890           
891
892
893   <li class="md-nav__item">
894     <a href="ft2-lzw.html" title="LZW Streams" class="md-nav__link">
895       LZW Streams
896     </a>
897   </li>
898
899         
900           
901           
902           
903
904
905   <li class="md-nav__item">
906     <a href="ft2-bzip2.html" title="BZIP2 Streams" class="md-nav__link">
907       BZIP2 Streams
908     </a>
909   </li>
910
911         
912       </ul>
913     </nav>
914   </li>
915
916     
917       
918       
919       
920
921
922   <li class="md-nav__item md-nav__item--nested">
923     
924       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9">
925     
926     <label class="md-nav__link" for="nav-9">
927       Error Codes
928     </label>
929     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
930       <label class="md-nav__title" for="nav-9">
931         Error Codes
932       </label>
933       <ul class="md-nav__list" data-md-scrollfix>
934         
935         
936           
937           
938           
939
940
941   <li class="md-nav__item">
942     <a href="ft2-error_enumerations.html" title="Error Enumerations" class="md-nav__link">
943       Error Enumerations
944     </a>
945   </li>
946
947         
948           
949           
950           
951
952
953   <li class="md-nav__item">
954     <a href="ft2-error_code_values.html" title="Error Code Values" class="md-nav__link">
955       Error Code Values
956     </a>
957   </li>
958
959         
960       </ul>
961     </nav>
962   </li>
963
964     
965       
966       
967       
968
969
970   <li class="md-nav__item md-nav__item--nested">
971     
972       <input class="md-toggle md-nav__toggle" data-md-toggle="nav-10" type="checkbox" id="nav-10">
973     
974     <label class="md-nav__link" for="nav-10">
975       Miscellaneous
976     </label>
977     <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
978       <label class="md-nav__title" for="nav-10">
979         Miscellaneous
980       </label>
981       <ul class="md-nav__list" data-md-scrollfix>
982         
983         
984           
985           
986           
987
988
989   <li class="md-nav__item">
990     <a href="ft2-ot_validation.html" title="OpenType Validation" class="md-nav__link">
991       OpenType Validation
992     </a>
993   </li>
994
995         
996           
997           
998           
999
1000
1001   <li class="md-nav__item">
1002     <a href="ft2-incremental.html" title="Incremental Loading" class="md-nav__link">
1003       Incremental Loading
1004     </a>
1005   </li>
1006
1007         
1008           
1009           
1010           
1011
1012
1013   <li class="md-nav__item">
1014     <a href="ft2-truetype_engine.html" title="The TrueType Engine" class="md-nav__link">
1015       The TrueType Engine
1016     </a>
1017   </li>
1018
1019         
1020           
1021           
1022           
1023
1024
1025   <li class="md-nav__item">
1026     <a href="ft2-gx_validation.html" title="TrueTypeGX/AAT Validation" class="md-nav__link">
1027       TrueTypeGX/AAT Validation
1028     </a>
1029   </li>
1030
1031         
1032       </ul>
1033     </nav>
1034   </li>
1035
1036     
1037   </ul>
1038 </nav>
1039                   </div>
1040                 </div>
1041               </div>
1042             
1043             
1044               <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
1045                 <div class="md-sidebar__scrollwrap">
1046                   <div class="md-sidebar__inner">
1047                     
1048 <nav class="md-nav md-nav--secondary">
1049   
1050   
1051     
1052   
1053   
1054     <label class="md-nav__title" for="__toc">Table of contents</label>
1055     <ul class="md-nav__list" data-md-scrollfix>
1056       
1057         <li class="md-nav__item">
1058   <a href="#synopsis" title="Synopsis" class="md-nav__link">
1059     Synopsis
1060   </a>
1061   
1062 </li>
1063       
1064         <li class="md-nav__item">
1065   <a href="#ft_layeriterator" title="FT_LayerIterator" class="md-nav__link">
1066     FT_LayerIterator
1067   </a>
1068   
1069 </li>
1070       
1071         <li class="md-nav__item">
1072   <a href="#ft_get_color_glyph_layer" title="FT_Get_Color_Glyph_Layer" class="md-nav__link">
1073     FT_Get_Color_Glyph_Layer
1074   </a>
1075   
1076 </li>
1077       
1078       
1079       
1080       
1081       
1082     </ul>
1083   
1084 </nav>
1085                   </div>
1086                 </div>
1087               </div>
1088             
1089           
1090           <div class="md-content">
1091             <article class="md-content__inner md-typeset">
1092               
1093                 
1094                 
1095                 <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; Glyph Layer Management</p>
1096 <hr />
1097 <h1 id="glyph-layer-management">Glyph Layer Management<a class="headerlink" href="#glyph-layer-management" title="Permanent link">&para;</a></h1>
1098 <h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
1099 <p>The functions described here allow access of colored glyph layer data in OpenType's &lsquo;COLR&rsquo; tables.</p>
1100 <h2 id="ft_layeriterator">FT_LayerIterator<a class="headerlink" href="#ft_layeriterator" title="Permanent link">&para;</a></h2>
1101 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
1102 <div class = "codehilite">
1103 <pre>
1104   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_LayerIterator_
1105   {
1106     <a href="ft2-basic_types.html#ft_uint">FT_UInt</a>   num_layers;
1107     <a href="ft2-basic_types.html#ft_uint">FT_UInt</a>   layer;
1108     <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>*  p;
1109
1110   } <b>FT_LayerIterator</b>;
1111 </pre>
1112 </div>
1113
1114 <p>This iterator object is needed for <code><a href="ft2-layer_management.html#ft_get_color_glyph_layer">FT_Get_Color_Glyph_Layer</a></code>.</p>
1115 <h4>fields</h4>
1116
1117 <table class="fields">
1118 <tr><td class="val" id="num_layers">num_layers</td><td class="desc">
1119 <p>The number of glyph layers for the requested glyph index. Will be set by <code><a href="ft2-layer_management.html#ft_get_color_glyph_layer">FT_Get_Color_Glyph_Layer</a></code>.</p>
1120 </td></tr>
1121 <tr><td class="val" id="layer">layer</td><td class="desc">
1122 <p>The current layer. Will be set by <code><a href="ft2-layer_management.html#ft_get_color_glyph_layer">FT_Get_Color_Glyph_Layer</a></code>.</p>
1123 </td></tr>
1124 <tr><td class="val" id="p">p</td><td class="desc">
1125 <p>An opaque pointer into &lsquo;COLR&rsquo; table data. The caller must set this to <code>NULL</code> before the first call of <code><a href="ft2-layer_management.html#ft_get_color_glyph_layer">FT_Get_Color_Glyph_Layer</a></code>.</p>
1126 </td></tr>
1127 </table>
1128
1129 <hr>
1130
1131 <h2 id="ft_get_color_glyph_layer">FT_Get_Color_Glyph_Layer<a class="headerlink" href="#ft_get_color_glyph_layer" title="Permanent link">&para;</a></h2>
1132 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
1133 <div class = "codehilite">
1134 <pre>
1135   FT_EXPORT( <a href="ft2-basic_types.html#ft_bool">FT_Bool</a> )
1136   <b>FT_Get_Color_Glyph_Layer</b>( <a href="ft2-base_interface.html#ft_face">FT_Face</a>            face,
1137                             <a href="ft2-basic_types.html#ft_uint">FT_UInt</a>            base_glyph,
1138                             <a href="ft2-basic_types.html#ft_uint">FT_UInt</a>           *aglyph_index,
1139                             <a href="ft2-basic_types.html#ft_uint">FT_UInt</a>           *acolor_index,
1140                             <a href="ft2-layer_management.html#ft_layeriterator">FT_LayerIterator</a>*  iterator );
1141 </pre>
1142 </div>
1143
1144 <p>This is an interface to the &lsquo;COLR&rsquo; table in OpenType fonts to iteratively retrieve the colored glyph layers associated with the current glyph slot.</p>
1145 <p><a href="https://docs.microsoft.com/en-us/typography/opentype/spec/colr">https://docs.microsoft.com/en-us/typography/opentype/spec/colr</a></p>
1146 <p>The glyph layer data for a given glyph index, if present, provides an alternative, multi-colour glyph representation: Instead of rendering the outline or bitmap with the given glyph index, glyphs with the indices and colors returned by this function are rendered layer by layer.</p>
1147 <p>The returned elements are ordered in the z&nbsp;direction from bottom to top; the 'n'th element should be rendered with the associated palette color and blended on top of the already rendered layers (elements 0, 1, ..., n-1).</p>
1148 <h4>input</h4>
1149
1150 <table class="fields">
1151 <tr><td class="val" id="face">face</td><td class="desc">
1152 <p>A handle to the parent face object.</p>
1153 </td></tr>
1154 <tr><td class="val" id="base_glyph">base_glyph</td><td class="desc">
1155 <p>The glyph index the colored glyph layers are associated with.</p>
1156 </td></tr>
1157 </table>
1158
1159 <h4>inout</h4>
1160
1161 <table class="fields">
1162 <tr><td class="val" id="iterator">iterator</td><td class="desc">
1163 <p>An <code><a href="ft2-layer_management.html#ft_layeriterator">FT_LayerIterator</a></code> object. For the first call you should set <code>iterator-&gt;p</code> to <code>NULL</code>. For all following calls, simply use the same object again.</p>
1164 </td></tr>
1165 </table>
1166
1167 <h4>output</h4>
1168
1169 <table class="fields">
1170 <tr><td class="val" id="aglyph_index">aglyph_index</td><td class="desc">
1171 <p>The glyph index of the current layer.</p>
1172 </td></tr>
1173 <tr><td class="val" id="acolor_index">acolor_index</td><td class="desc">
1174 <p>The color index into the font face's color palette of the current layer. The value 0xFFFF is special; it doesn't reference a palette entry but indicates that the text foreground color should be used instead (to be set up by the application outside of FreeType).</p>
1175 <p>The color palette can be retrieved with <code><a href="ft2-color_management.html#ft_palette_select">FT_Palette_Select</a></code>.</p>
1176 </td></tr>
1177 </table>
1178
1179 <h4>return</h4>
1180
1181 <p>Value&nbsp;1 if everything is OK. If there are no more layers (or if there are no layers at all), value&nbsp;0 gets returned. In case of an error, value&nbsp;0 is returned also.</p>
1182 <h4>note</h4>
1183
1184 <p>This function is necessary if you want to handle glyph layers by yourself. In particular, functions that operate with <code><a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a></code> objects (like <code><a href="ft2-glyph_management.html#ft_get_glyph">FT_Get_Glyph</a></code> or <code><a href="ft2-glyph_management.html#ft_glyph_to_bitmap">FT_Glyph_To_Bitmap</a></code>) don't have access to this information.</p>
1185 <p>Note that <code><a href="ft2-base_interface.html#ft_render_glyph">FT_Render_Glyph</a></code> is able to handle colored glyph layers automatically if the <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_COLOR</a></code> flag is passed to a previous call to <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code>. [This is an experimental feature.]</p>
1186 <h4>example</h4>
1187
1188 <div class="codehilite"><pre><span></span>  FT_Color*         palette;
1189   FT_LayerIterator  iterator;
1190
1191   FT_Bool  have_layers;
1192   FT_UInt  layer_glyph_index;
1193   FT_UInt  layer_color_index;
1194
1195
1196   error = FT_Palette_Select( face, palette_index, &amp;palette );
1197   if ( error )
1198     palette = NULL;
1199
1200   iterator.p  = NULL;
1201   have_layers = FT_Get_Color_Glyph_Layer( face,
1202                                           glyph_index,
1203                                           &amp;layer_glyph_index,
1204                                           &amp;layer_color_index,
1205                                           &amp;iterator );
1206
1207   if ( palette &amp;&amp; have_layers )
1208   {
1209     do
1210     {
1211       FT_Color  layer_color;
1212
1213
1214       if ( layer_color_index == 0xFFFF )
1215         layer_color = text_foreground_color;
1216       else
1217         layer_color = palette[layer_color_index];
1218
1219       // Load and render glyph `layer_glyph_index&#39;, then
1220       // blend resulting pixmap (using color `layer_color&#39;)
1221       // with previously created pixmaps.
1222
1223     } while ( FT_Get_Color_Glyph_Layer( face,
1224                                         glyph_index,
1225                                         &amp;layer_glyph_index,
1226                                         &amp;layer_color_index,
1227                                         &amp;iterator ) );
1228   }
1229 </pre></div>
1230
1231 <hr>
1232                 
1233                   
1234                 
1235               
1236               
1237                 
1238
1239
1240               
1241             </article>
1242           </div>
1243         </div>
1244       </main>
1245       
1246         
1247 <footer class="md-footer">
1248   
1249     <div class="md-footer-nav">
1250       <nav class="md-footer-nav__inner md-grid">
1251         
1252           <a href="ft2-color_management.html" title="Glyph Color Management" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
1253             <div class="md-flex__cell md-flex__cell--shrink">
1254               <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
1255             </div>
1256             <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
1257               <span class="md-flex__ellipsis">
1258                 <span class="md-footer-nav__direction">
1259                   Previous
1260                 </span>
1261                 Glyph Color Management
1262               </span>
1263             </div>
1264           </a>
1265         
1266         
1267           <a href="ft2-glyph_management.html" title="Glyph Management" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
1268             <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
1269               <span class="md-flex__ellipsis">
1270                 <span class="md-footer-nav__direction">
1271                   Next
1272                 </span>
1273                 Glyph Management
1274               </span>
1275             </div>
1276             <div class="md-flex__cell md-flex__cell--shrink">
1277               <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
1278             </div>
1279           </a>
1280         
1281       </nav>
1282     </div>
1283   
1284   <div class="md-footer-meta md-typeset">
1285     <div class="md-footer-meta__inner md-grid">
1286       <div class="md-footer-copyright">
1287         
1288           <div class="md-footer-copyright__highlight">
1289             Copyright 2019 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
1290           </div>
1291         
1292         powered by
1293         <a href="https://www.mkdocs.org">MkDocs</a>
1294         and
1295         <a href="https://squidfunk.github.io/mkdocs-material/">
1296           Material for MkDocs</a>
1297       </div>
1298       
1299     </div>
1300   </div>
1301 </footer>
1302       
1303     </div>
1304     
1305       <script src="assets/javascripts/application.d9aa80ab.js"></script>
1306       
1307       <script>app.initialize({version:"1.0.4",url:{base:"."}})</script>
1308       
1309         <script src="javascripts/extra.js"></script>
1310       
1311     
1312   </body>
1313 </html>