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