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.12.1"> 10 11 12 13 <meta name="author" content="FreeType Contributors"> 14 15 16 <link rel="icon" href="images/favico.ico"> 17 <meta name="generator" content="mkdocs-1.2.1, mkdocs-material-7.1.9"> 18 19 20 21 <title>Glyph Color Management - FreeType-2.12.1 API Reference</title> 22 23 24 25 <link rel="stylesheet" href="assets/stylesheets/main.ca7ac06f.min.css"> 26 27 28 <link rel="stylesheet" href="assets/stylesheets/palette.f1a3b89f.min.css"> 29 30 31 32 <meta name="theme-color" content="#4cae4f"> 33 34 35 36 37 38 39 40 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 41 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,400,400i,700%7CRoboto+Mono&display=fallback"> 42 <style>:root{--md-text-font-family:"Noto Serif";--md-code-font-family:"Roboto Mono"}</style> 43 44 45 46 47 <link rel="stylesheet" href="stylesheets/extra.css"> 48 49 50 51 52 53 54 55 </head> 56 57 58 59 60 61 62 63 <body dir="ltr" data-md-color-scheme="" data-md-color-primary="green" data-md-color-accent="green"> 64 65 66 <script>function __prefix(e){return new URL(".",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script> 67 68 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off"> 69 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> 70 <label class="md-overlay" for="__drawer"></label> 71 <div data-md-component="skip"> 72 73 74 <a href="#glyph-color-management" class="md-skip"> 75 Skip to content 76 </a> 77 78 </div> 79 <div data-md-component="announce"> 80 81 </div> 82 83 <header class="md-header" data-md-component="header"> 84 <nav class="md-header__inner md-grid" aria-label="Header"> 85 <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo"> 86 87 <img src="images/favico.ico" alt="logo"> 88 89 </a> 90 <label class="md-header__button md-icon" for="__drawer"> 91 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg> 92 </label> 93 <div class="md-header__title" data-md-component="header-title"> 94 <div class="md-header__ellipsis"> 95 <div class="md-header__topic"> 96 <span class="md-ellipsis"> 97 FreeType-2.12.1 API Reference 98 </span> 99 </div> 100 <div class="md-header__topic" data-md-component="header-topic"> 101 <span class="md-ellipsis"> 102 103 Glyph Color Management 104 105 </span> 106 </div> 107 </div> 108 </div> 109 110 111 112 <label class="md-header__button md-icon" for="__search"> 113 <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.516 6.516 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 5z"/></svg> 114 </label> 115 116<div class="md-search" data-md-component="search" role="dialog"> 117 <label class="md-search__overlay" for="__search"></label> 118 <div class="md-search__inner" role="search"> 119 <form class="md-search__form" name="search"> 120 <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" data-md-state="active" required> 121 <label class="md-search__icon md-icon" for="__search"> 122 <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.516 6.516 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 5z"/></svg> 123 <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 11h12z"/></svg> 124 </label> 125 <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1"> 126 <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 12 19 6.41z"/></svg> 127 </button> 128 </form> 129 <div class="md-search__output"> 130 <div class="md-search__scrollwrap" data-md-scrollfix> 131 <div class="md-search-result" data-md-component="search-result"> 132 <div class="md-search-result__meta"> 133 Initializing search 134 </div> 135 <ol class="md-search-result__list"></ol> 136 </div> 137 </div> 138 </div> 139 </div> 140</div> 141 142 143 </nav> 144</header> 145 146 <div class="md-container" data-md-component="container"> 147 148 149 150 151 <main class="md-main" data-md-component="main"> 152 <div class="md-main__inner md-grid"> 153 154 155 156 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" > 157 <div class="md-sidebar__scrollwrap"> 158 <div class="md-sidebar__inner"> 159 160 161 162<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0"> 163 <label class="md-nav__title" for="__drawer"> 164 <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo"> 165 166 <img src="images/favico.ico" alt="logo"> 167 168 </a> 169 FreeType-2.12.1 API Reference 170 </label> 171 172 <ul class="md-nav__list" data-md-scrollfix> 173 174 175 176 177 178 179 180 181 <li class="md-nav__item"> 182 <a href="index.html" class="md-nav__link"> 183 TOC 184 </a> 185 </li> 186 187 188 189 190 191 192 193 194 195 196 <li class="md-nav__item"> 197 <a href="ft2-index.html" class="md-nav__link"> 198 Index 199 </a> 200 </li> 201 202 203 204 205 206 207 208 209 210 211 212 <li class="md-nav__item md-nav__item--nested"> 213 214 215 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" > 216 217 <label class="md-nav__link" for="__nav_3"> 218 General Remarks 219 <span class="md-nav__icon md-icon"></span> 220 </label> 221 <nav class="md-nav" aria-label="General Remarks" data-md-level="1"> 222 <label class="md-nav__title" for="__nav_3"> 223 <span class="md-nav__icon md-icon"></span> 224 General Remarks 225 </label> 226 <ul class="md-nav__list" data-md-scrollfix> 227 228 229 230 231 232 <li class="md-nav__item"> 233 <a href="ft2-preamble.html" class="md-nav__link"> 234 Preamble 235 </a> 236 </li> 237 238 239 240 241 242 243 244 <li class="md-nav__item"> 245 <a href="ft2-header_inclusion.html" class="md-nav__link"> 246 FreeType's header inclusion scheme 247 </a> 248 </li> 249 250 251 252 253 254 255 256 <li class="md-nav__item"> 257 <a href="ft2-user_allocation.html" class="md-nav__link"> 258 User allocation 259 </a> 260 </li> 261 262 263 264 </ul> 265 </nav> 266 </li> 267 268 269 270 271 272 273 274 275 276 277 278 279 280 <li class="md-nav__item md-nav__item--active md-nav__item--nested"> 281 282 283 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" checked> 284 285 <label class="md-nav__link" for="__nav_4"> 286 Core API 287 <span class="md-nav__icon md-icon"></span> 288 </label> 289 <nav class="md-nav" aria-label="Core API" data-md-level="1"> 290 <label class="md-nav__title" for="__nav_4"> 291 <span class="md-nav__icon md-icon"></span> 292 Core API 293 </label> 294 <ul class="md-nav__list" data-md-scrollfix> 295 296 297 298 299 300 <li class="md-nav__item"> 301 <a href="ft2-version.html" class="md-nav__link"> 302 FreeType Version 303 </a> 304 </li> 305 306 307 308 309 310 311 312 <li class="md-nav__item"> 313 <a href="ft2-basic_types.html" class="md-nav__link"> 314 Basic Data Types 315 </a> 316 </li> 317 318 319 320 321 322 323 324 <li class="md-nav__item"> 325 <a href="ft2-base_interface.html" class="md-nav__link"> 326 Base Interface 327 </a> 328 </li> 329 330 331 332 333 334 335 336 <li class="md-nav__item"> 337 <a href="ft2-glyph_variants.html" class="md-nav__link"> 338 Unicode Variation Sequences 339 </a> 340 </li> 341 342 343 344 345 346 347 348 349 350 <li class="md-nav__item md-nav__item--active"> 351 352 <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc"> 353 354 355 356 357 358 <label class="md-nav__link md-nav__link--active" for="__toc"> 359 Glyph Color Management 360 <span class="md-nav__icon md-icon"></span> 361 </label> 362 363 <a href="ft2-color_management.html" class="md-nav__link md-nav__link--active"> 364 Glyph Color Management 365 </a> 366 367 368<nav class="md-nav md-nav--secondary" aria-label="Table of contents"> 369 370 371 372 373 374 375 <label class="md-nav__title" for="__toc"> 376 <span class="md-nav__icon md-icon"></span> 377 Table of contents 378 </label> 379 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> 380 381 <li class="md-nav__item"> 382 <a href="#synopsis" class="md-nav__link"> 383 Synopsis 384 </a> 385 386</li> 387 388 <li class="md-nav__item"> 389 <a href="#ft_color" class="md-nav__link"> 390 FT_Color 391 </a> 392 393</li> 394 395 <li class="md-nav__item"> 396 <a href="#ft_palette_xxx" class="md-nav__link"> 397 FT_PALETTE_XXX 398 </a> 399 400</li> 401 402 <li class="md-nav__item"> 403 <a href="#ft_palette_data" class="md-nav__link"> 404 FT_Palette_Data 405 </a> 406 407</li> 408 409 <li class="md-nav__item"> 410 <a href="#ft_palette_data_get" class="md-nav__link"> 411 FT_Palette_Data_Get 412 </a> 413 414</li> 415 416 <li class="md-nav__item"> 417 <a href="#ft_palette_select" class="md-nav__link"> 418 FT_Palette_Select 419 </a> 420 421</li> 422 423 <li class="md-nav__item"> 424 <a href="#ft_palette_set_foreground_color" class="md-nav__link"> 425 FT_Palette_Set_Foreground_Color 426 </a> 427 428</li> 429 430 </ul> 431 432</nav> 433 434 </li> 435 436 437 438 439 440 441 442 <li class="md-nav__item"> 443 <a href="ft2-layer_management.html" class="md-nav__link"> 444 Glyph Layer Management 445 </a> 446 </li> 447 448 449 450 451 452 453 454 <li class="md-nav__item"> 455 <a href="ft2-glyph_management.html" class="md-nav__link"> 456 Glyph Management 457 </a> 458 </li> 459 460 461 462 463 464 465 466 <li class="md-nav__item"> 467 <a href="ft2-mac_specific.html" class="md-nav__link"> 468 Mac Specific Interface 469 </a> 470 </li> 471 472 473 474 475 476 477 478 <li class="md-nav__item"> 479 <a href="ft2-sizes_management.html" class="md-nav__link"> 480 Size Management 481 </a> 482 </li> 483 484 485 486 487 488 489 490 <li class="md-nav__item"> 491 <a href="ft2-header_file_macros.html" class="md-nav__link"> 492 Header File Macros 493 </a> 494 </li> 495 496 497 498 </ul> 499 </nav> 500 </li> 501 502 503 504 505 506 507 508 509 510 511 512 <li class="md-nav__item md-nav__item--nested"> 513 514 515 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" > 516 517 <label class="md-nav__link" for="__nav_5"> 518 Format-Specific API 519 <span class="md-nav__icon md-icon"></span> 520 </label> 521 <nav class="md-nav" aria-label="Format-Specific API" data-md-level="1"> 522 <label class="md-nav__title" for="__nav_5"> 523 <span class="md-nav__icon md-icon"></span> 524 Format-Specific API 525 </label> 526 <ul class="md-nav__list" data-md-scrollfix> 527 528 529 530 531 532 <li class="md-nav__item"> 533 <a href="ft2-multiple_masters.html" class="md-nav__link"> 534 Multiple Masters 535 </a> 536 </li> 537 538 539 540 541 542 543 544 <li class="md-nav__item"> 545 <a href="ft2-truetype_tables.html" class="md-nav__link"> 546 TrueType Tables 547 </a> 548 </li> 549 550 551 552 553 554 555 556 <li class="md-nav__item"> 557 <a href="ft2-type1_tables.html" class="md-nav__link"> 558 Type 1 Tables 559 </a> 560 </li> 561 562 563 564 565 566 567 568 <li class="md-nav__item"> 569 <a href="ft2-sfnt_names.html" class="md-nav__link"> 570 SFNT Names 571 </a> 572 </li> 573 574 575 576 577 578 579 580 <li class="md-nav__item"> 581 <a href="ft2-bdf_fonts.html" class="md-nav__link"> 582 BDF and PCF Files 583 </a> 584 </li> 585 586 587 588 589 590 591 592 <li class="md-nav__item"> 593 <a href="ft2-cid_fonts.html" class="md-nav__link"> 594 CID Fonts 595 </a> 596 </li> 597 598 599 600 601 602 603 604 <li class="md-nav__item"> 605 <a href="ft2-pfr_fonts.html" class="md-nav__link"> 606 PFR Fonts 607 </a> 608 </li> 609 610 611 612 613 614 615 616 <li class="md-nav__item"> 617 <a href="ft2-winfnt_fonts.html" class="md-nav__link"> 618 Window FNT Files 619 </a> 620 </li> 621 622 623 624 625 626 627 628 <li class="md-nav__item"> 629 <a href="ft2-svg_fonts.html" class="md-nav__link"> 630 OpenType SVG Fonts 631 </a> 632 </li> 633 634 635 636 637 638 639 640 <li class="md-nav__item"> 641 <a href="ft2-font_formats.html" class="md-nav__link"> 642 Font Formats 643 </a> 644 </li> 645 646 647 648 649 650 651 652 <li class="md-nav__item"> 653 <a href="ft2-gasp_table.html" class="md-nav__link"> 654 Gasp Table 655 </a> 656 </li> 657 658 659 660 </ul> 661 </nav> 662 </li> 663 664 665 666 667 668 669 670 671 672 673 674 <li class="md-nav__item md-nav__item--nested"> 675 676 677 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" > 678 679 <label class="md-nav__link" for="__nav_6"> 680 Controlling FreeType Modules 681 <span class="md-nav__icon md-icon"></span> 682 </label> 683 <nav class="md-nav" aria-label="Controlling FreeType Modules" data-md-level="1"> 684 <label class="md-nav__title" for="__nav_6"> 685 <span class="md-nav__icon md-icon"></span> 686 Controlling FreeType Modules 687 </label> 688 <ul class="md-nav__list" data-md-scrollfix> 689 690 691 692 693 694 <li class="md-nav__item"> 695 <a href="ft2-auto_hinter.html" class="md-nav__link"> 696 The auto-hinter 697 </a> 698 </li> 699 700 701 702 703 704 705 706 <li class="md-nav__item"> 707 <a href="ft2-cff_driver.html" class="md-nav__link"> 708 The CFF driver 709 </a> 710 </li> 711 712 713 714 715 716 717 718 <li class="md-nav__item"> 719 <a href="ft2-t1_cid_driver.html" class="md-nav__link"> 720 The Type 1 and CID drivers 721 </a> 722 </li> 723 724 725 726 727 728 729 730 <li class="md-nav__item"> 731 <a href="ft2-tt_driver.html" class="md-nav__link"> 732 The TrueType driver 733 </a> 734 </li> 735 736 737 738 739 740 741 742 <li class="md-nav__item"> 743 <a href="ft2-pcf_driver.html" class="md-nav__link"> 744 The PCF driver 745 </a> 746 </li> 747 748 749 750 751 752 753 754 <li class="md-nav__item"> 755 <a href="ft2-ot_svg_driver.html" class="md-nav__link"> 756 The SVG driver 757 </a> 758 </li> 759 760 761 762 763 764 765 766 <li class="md-nav__item"> 767 <a href="ft2-properties.html" class="md-nav__link"> 768 Driver properties 769 </a> 770 </li> 771 772 773 774 775 776 777 778 <li class="md-nav__item"> 779 <a href="ft2-parameter_tags.html" class="md-nav__link"> 780 Parameter Tags 781 </a> 782 </li> 783 784 785 786 787 788 789 790 <li class="md-nav__item"> 791 <a href="ft2-lcd_rendering.html" class="md-nav__link"> 792 Subpixel Rendering 793 </a> 794 </li> 795 796 797 798 </ul> 799 </nav> 800 </li> 801 802 803 804 805 806 807 808 809 810 811 812 <li class="md-nav__item md-nav__item--nested"> 813 814 815 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" > 816 817 <label class="md-nav__link" for="__nav_7"> 818 Cache Sub-System 819 <span class="md-nav__icon md-icon"></span> 820 </label> 821 <nav class="md-nav" aria-label="Cache Sub-System" data-md-level="1"> 822 <label class="md-nav__title" for="__nav_7"> 823 <span class="md-nav__icon md-icon"></span> 824 Cache Sub-System 825 </label> 826 <ul class="md-nav__list" data-md-scrollfix> 827 828 829 830 831 832 <li class="md-nav__item"> 833 <a href="ft2-cache_subsystem.html" class="md-nav__link"> 834 Cache Sub-System 835 </a> 836 </li> 837 838 839 840 </ul> 841 </nav> 842 </li> 843 844 845 846 847 848 849 850 851 852 853 854 <li class="md-nav__item md-nav__item--nested"> 855 856 857 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" > 858 859 <label class="md-nav__link" for="__nav_8"> 860 Support API 861 <span class="md-nav__icon md-icon"></span> 862 </label> 863 <nav class="md-nav" aria-label="Support API" data-md-level="1"> 864 <label class="md-nav__title" for="__nav_8"> 865 <span class="md-nav__icon md-icon"></span> 866 Support API 867 </label> 868 <ul class="md-nav__list" data-md-scrollfix> 869 870 871 872 873 874 <li class="md-nav__item"> 875 <a href="ft2-computations.html" class="md-nav__link"> 876 Computations 877 </a> 878 </li> 879 880 881 882 883 884 885 886 <li class="md-nav__item"> 887 <a href="ft2-list_processing.html" class="md-nav__link"> 888 List Processing 889 </a> 890 </li> 891 892 893 894 895 896 897 898 <li class="md-nav__item"> 899 <a href="ft2-outline_processing.html" class="md-nav__link"> 900 Outline Processing 901 </a> 902 </li> 903 904 905 906 907 908 909 910 <li class="md-nav__item"> 911 <a href="ft2-quick_advance.html" class="md-nav__link"> 912 Quick retrieval of advance values 913 </a> 914 </li> 915 916 917 918 919 920 921 922 <li class="md-nav__item"> 923 <a href="ft2-bitmap_handling.html" class="md-nav__link"> 924 Bitmap Handling 925 </a> 926 </li> 927 928 929 930 931 932 933 934 <li class="md-nav__item"> 935 <a href="ft2-raster.html" class="md-nav__link"> 936 Scanline Converter 937 </a> 938 </li> 939 940 941 942 943 944 945 946 <li class="md-nav__item"> 947 <a href="ft2-glyph_stroker.html" class="md-nav__link"> 948 Glyph Stroker 949 </a> 950 </li> 951 952 953 954 955 956 957 958 <li class="md-nav__item"> 959 <a href="ft2-system_interface.html" class="md-nav__link"> 960 System Interface 961 </a> 962 </li> 963 964 965 966 967 968 969 970 <li class="md-nav__item"> 971 <a href="ft2-module_management.html" class="md-nav__link"> 972 Module Management 973 </a> 974 </li> 975 976 977 978 979 980 981 982 <li class="md-nav__item"> 983 <a href="ft2-gzip.html" class="md-nav__link"> 984 GZIP Streams 985 </a> 986 </li> 987 988 989 990 991 992 993 994 <li class="md-nav__item"> 995 <a href="ft2-lzw.html" class="md-nav__link"> 996 LZW Streams 997 </a> 998 </li> 999 1000 1001 1002 1003 1004 1005 1006 <li class="md-nav__item"> 1007 <a href="ft2-bzip2.html" class="md-nav__link"> 1008 BZIP2 Streams 1009 </a> 1010 </li> 1011 1012 1013 1014 1015 1016 1017 1018 <li class="md-nav__item"> 1019 <a href="ft2-debugging_apis.html" class="md-nav__link"> 1020 External Debugging APIs 1021 </a> 1022 </li> 1023 1024 1025 1026 </ul> 1027 </nav> 1028 </li> 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 <li class="md-nav__item md-nav__item--nested"> 1041 1042 1043 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" > 1044 1045 <label class="md-nav__link" for="__nav_9"> 1046 Error Codes 1047 <span class="md-nav__icon md-icon"></span> 1048 </label> 1049 <nav class="md-nav" aria-label="Error Codes" data-md-level="1"> 1050 <label class="md-nav__title" for="__nav_9"> 1051 <span class="md-nav__icon md-icon"></span> 1052 Error Codes 1053 </label> 1054 <ul class="md-nav__list" data-md-scrollfix> 1055 1056 1057 1058 1059 1060 <li class="md-nav__item"> 1061 <a href="ft2-error_enumerations.html" class="md-nav__link"> 1062 Error Enumerations 1063 </a> 1064 </li> 1065 1066 1067 1068 1069 1070 1071 1072 <li class="md-nav__item"> 1073 <a href="ft2-error_code_values.html" class="md-nav__link"> 1074 Error Code Values 1075 </a> 1076 </li> 1077 1078 1079 1080 </ul> 1081 </nav> 1082 </li> 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 <li class="md-nav__item md-nav__item--nested"> 1095 1096 1097 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" > 1098 1099 <label class="md-nav__link" for="__nav_10"> 1100 Miscellaneous 1101 <span class="md-nav__icon md-icon"></span> 1102 </label> 1103 <nav class="md-nav" aria-label="Miscellaneous" data-md-level="1"> 1104 <label class="md-nav__title" for="__nav_10"> 1105 <span class="md-nav__icon md-icon"></span> 1106 Miscellaneous 1107 </label> 1108 <ul class="md-nav__list" data-md-scrollfix> 1109 1110 1111 1112 1113 1114 <li class="md-nav__item"> 1115 <a href="ft2-gx_validation.html" class="md-nav__link"> 1116 TrueTypeGX/AAT Validation 1117 </a> 1118 </li> 1119 1120 1121 1122 1123 1124 1125 1126 <li class="md-nav__item"> 1127 <a href="ft2-incremental.html" class="md-nav__link"> 1128 Incremental Loading 1129 </a> 1130 </li> 1131 1132 1133 1134 1135 1136 1137 1138 <li class="md-nav__item"> 1139 <a href="ft2-truetype_engine.html" class="md-nav__link"> 1140 The TrueType Engine 1141 </a> 1142 </li> 1143 1144 1145 1146 1147 1148 1149 1150 <li class="md-nav__item"> 1151 <a href="ft2-ot_validation.html" class="md-nav__link"> 1152 OpenType Validation 1153 </a> 1154 </li> 1155 1156 1157 1158 </ul> 1159 </nav> 1160 </li> 1161 1162 1163 1164 </ul> 1165</nav> 1166 </div> 1167 </div> 1168 </div> 1169 1170 1171 1172 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" > 1173 <div class="md-sidebar__scrollwrap"> 1174 <div class="md-sidebar__inner"> 1175 1176<nav class="md-nav md-nav--secondary" aria-label="Table of contents"> 1177 1178 1179 1180 1181 1182 1183 <label class="md-nav__title" for="__toc"> 1184 <span class="md-nav__icon md-icon"></span> 1185 Table of contents 1186 </label> 1187 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> 1188 1189 <li class="md-nav__item"> 1190 <a href="#synopsis" class="md-nav__link"> 1191 Synopsis 1192 </a> 1193 1194</li> 1195 1196 <li class="md-nav__item"> 1197 <a href="#ft_color" class="md-nav__link"> 1198 FT_Color 1199 </a> 1200 1201</li> 1202 1203 <li class="md-nav__item"> 1204 <a href="#ft_palette_xxx" class="md-nav__link"> 1205 FT_PALETTE_XXX 1206 </a> 1207 1208</li> 1209 1210 <li class="md-nav__item"> 1211 <a href="#ft_palette_data" class="md-nav__link"> 1212 FT_Palette_Data 1213 </a> 1214 1215</li> 1216 1217 <li class="md-nav__item"> 1218 <a href="#ft_palette_data_get" class="md-nav__link"> 1219 FT_Palette_Data_Get 1220 </a> 1221 1222</li> 1223 1224 <li class="md-nav__item"> 1225 <a href="#ft_palette_select" class="md-nav__link"> 1226 FT_Palette_Select 1227 </a> 1228 1229</li> 1230 1231 <li class="md-nav__item"> 1232 <a href="#ft_palette_set_foreground_color" class="md-nav__link"> 1233 FT_Palette_Set_Foreground_Color 1234 </a> 1235 1236</li> 1237 1238 </ul> 1239 1240</nav> 1241 </div> 1242 </div> 1243 </div> 1244 1245 1246 <div class="md-content" data-md-component="content"> 1247 <article class="md-content__inner md-typeset"> 1248 1249 1250 1251 <p><a href="https://www.freetype.org">FreeType</a> » <a href="../">Docs</a> » <a href="index.html#core-api">Core API</a> » Glyph Color Management</p> 1252<hr /> 1253<h1 id="glyph-color-management">Glyph Color Management<a class="headerlink" href="#glyph-color-management" title="Permanent link">¶</a></h1> 1254<h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">¶</a></h2> 1255<p>The functions described here allow access and manipulation of color palette entries in OpenType's ‘CPAL’ tables.</p> 1256<h2 id="ft_color">FT_Color<a class="headerlink" href="#ft_color" title="Permanent link">¶</a></h2> 1257<p>Defined in FT_COLOR_H (freetype/ftcolor.h).</p> 1258<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Color_ 1259 { 1260 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> blue; 1261 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> green; 1262 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> red; 1263 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> alpha; 1264 1265 } <b>FT_Color</b>; 1266</code></pre></div> 1267 1268<p>This structure models a BGRA color value of a ‘CPAL’ palette entry.</p> 1269<p>The used color space is sRGB; the colors are not pre-multiplied, and alpha values must be explicitly set.</p> 1270<h4>fields</h4> 1271<table class="fields"> 1272<tr><td class="val" id="blue">blue</td><td class="desc"> 1273<p>Blue value.</p> 1274</td></tr> 1275<tr><td class="val" id="green">green</td><td class="desc"> 1276<p>Green value.</p> 1277</td></tr> 1278<tr><td class="val" id="red">red</td><td class="desc"> 1279<p>Red value.</p> 1280</td></tr> 1281<tr><td class="val" id="alpha">alpha</td><td class="desc"> 1282<p>Alpha value, giving the red, green, and blue color's opacity.</p> 1283</td></tr> 1284</table> 1285 1286<h4>since</h4> 1287 1288<p>2.10</p> 1289<hr> 1290 1291<h2 id="ft_palette_xxx">FT_PALETTE_XXX<a class="headerlink" href="#ft_palette_xxx" title="Permanent link">¶</a></h2> 1292<p>Defined in FT_COLOR_H (freetype/ftcolor.h).</p> 1293<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-color_management.html#ft_palette_for_light_background">FT_PALETTE_FOR_LIGHT_BACKGROUND</a> 0x01 1294#<span class="keyword">define</span> <a href="ft2-color_management.html#ft_palette_for_dark_background">FT_PALETTE_FOR_DARK_BACKGROUND</a> 0x02 1295</code></pre></div> 1296 1297<p>A list of bit field constants used in the <code>palette_flags</code> array of the <code><a href="ft2-color_management.html#ft_palette_data">FT_Palette_Data</a></code> structure to indicate for which background a palette with a given index is usable.</p> 1298<h4>values</h4> 1299<table class="fields long"> 1300<tr><td class="val" id="ft_palette_for_light_background">FT_PALETTE_FOR_LIGHT_BACKGROUND</td><td class="desc"> 1301<p>The palette is appropriate to use when displaying the font on a light background such as white.</p> 1302</td></tr> 1303<tr><td class="val" id="ft_palette_for_dark_background">FT_PALETTE_FOR_DARK_BACKGROUND</td><td class="desc"> 1304<p>The palette is appropriate to use when displaying the font on a dark background such as black.</p> 1305</td></tr> 1306</table> 1307 1308<h4>since</h4> 1309 1310<p>2.10</p> 1311<hr> 1312 1313<h2 id="ft_palette_data">FT_Palette_Data<a class="headerlink" href="#ft_palette_data" title="Permanent link">¶</a></h2> 1314<p>Defined in FT_COLOR_H (freetype/ftcolor.h).</p> 1315<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Palette_Data_ { 1316 <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> num_palettes; 1317 <span class="keyword">const</span> <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a>* palette_name_ids; 1318 <span class="keyword">const</span> <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a>* palette_flags; 1319 1320 <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> num_palette_entries; 1321 <span class="keyword">const</span> <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a>* palette_entry_name_ids; 1322 1323 } <b>FT_Palette_Data</b>; 1324</code></pre></div> 1325 1326<p>This structure holds the data of the ‘CPAL’ table.</p> 1327<h4>fields</h4> 1328<table class="fields"> 1329<tr><td class="val" id="num_palettes">num_palettes</td><td class="desc"> 1330<p>The number of palettes.</p> 1331</td></tr> 1332<tr><td class="val" id="palette_name_ids">palette_name_ids</td><td class="desc"> 1333<p>An optional read-only array of palette name IDs with <code>num_palettes</code> elements, corresponding to entries like ‘dark’ or ‘light’ in the font's ‘name’ table.</p> 1334<p>An empty name ID in the ‘CPAL’ table gets represented as value 0xFFFF.</p> 1335<p><code>NULL</code> if the font's ‘CPAL’ table doesn't contain appropriate data.</p> 1336</td></tr> 1337<tr><td class="val" id="palette_flags">palette_flags</td><td class="desc"> 1338<p>An optional read-only array of palette flags with <code>num_palettes</code> elements. Possible values are an ORed combination of <code><a href="ft2-color_management.html#ft_palette_xxx">FT_PALETTE_FOR_LIGHT_BACKGROUND</a></code> and <code><a href="ft2-color_management.html#ft_palette_xxx">FT_PALETTE_FOR_DARK_BACKGROUND</a></code>.</p> 1339<p><code>NULL</code> if the font's ‘CPAL’ table doesn't contain appropriate data.</p> 1340</td></tr> 1341<tr><td class="val" id="num_palette_entries">num_palette_entries</td><td class="desc"> 1342<p>The number of entries in a single palette. All palettes have the same size.</p> 1343</td></tr> 1344<tr><td class="val" id="palette_entry_name_ids">palette_entry_name_ids</td><td class="desc"> 1345<p>An optional read-only array of palette entry name IDs with <code>num_palette_entries</code>. In each palette, entries with the same index have the same function. For example, index 0 might correspond to string ‘outline’ in the font's ‘name’ table to indicate that this palette entry is used for outlines, index 1 might correspond to ‘fill’ to indicate the filling color palette entry, etc.</p> 1346<p>An empty entry name ID in the ‘CPAL’ table gets represented as value 0xFFFF.</p> 1347<p><code>NULL</code> if the font's ‘CPAL’ table doesn't contain appropriate data.</p> 1348</td></tr> 1349</table> 1350 1351<h4>note</h4> 1352 1353<p>Use function <code><a href="ft2-sfnt_names.html#ft_get_sfnt_name">FT_Get_Sfnt_Name</a></code> to map name IDs and entry name IDs to name strings.</p> 1354<p>Use function <code><a href="ft2-color_management.html#ft_palette_select">FT_Palette_Select</a></code> to get the colors associated with a palette entry.</p> 1355<h4>since</h4> 1356 1357<p>2.10</p> 1358<hr> 1359 1360<h2 id="ft_palette_data_get">FT_Palette_Data_Get<a class="headerlink" href="#ft_palette_data_get" title="Permanent link">¶</a></h2> 1361<p>Defined in FT_COLOR_H (freetype/ftcolor.h).</p> 1362<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1363 <b>FT_Palette_Data_Get</b>( <a href="ft2-base_interface.html#ft_face">FT_Face</a> face, 1364 <a href="ft2-color_management.html#ft_palette_data">FT_Palette_Data</a> *apalette ); 1365</code></pre></div> 1366 1367<p>Retrieve the face's color palette data.</p> 1368<h4>input</h4> 1369<table class="fields"> 1370<tr><td class="val" id="face">face</td><td class="desc"> 1371<p>The source face handle.</p> 1372</td></tr> 1373</table> 1374 1375<h4>output</h4> 1376<table class="fields"> 1377<tr><td class="val" id="apalette">apalette</td><td class="desc"> 1378<p>A pointer to an <code><a href="ft2-color_management.html#ft_palette_data">FT_Palette_Data</a></code> structure.</p> 1379</td></tr> 1380</table> 1381 1382<h4>return</h4> 1383 1384<p>FreeType error code. 0 means success.</p> 1385<h4>note</h4> 1386 1387<p>All arrays in the returned <code><a href="ft2-color_management.html#ft_palette_data">FT_Palette_Data</a></code> structure are read-only.</p> 1388<p>This function always returns an error if the config macro <code>TT_CONFIG_OPTION_COLOR_LAYERS</code> is not defined in <code>ftoption.h</code>.</p> 1389<h4>since</h4> 1390 1391<p>2.10</p> 1392<hr> 1393 1394<h2 id="ft_palette_select">FT_Palette_Select<a class="headerlink" href="#ft_palette_select" title="Permanent link">¶</a></h2> 1395<p>Defined in FT_COLOR_H (freetype/ftcolor.h).</p> 1396<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1397 <b>FT_Palette_Select</b>( <a href="ft2-base_interface.html#ft_face">FT_Face</a> face, 1398 <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> palette_index, 1399 <a href="ft2-color_management.html#ft_color">FT_Color</a>* *apalette ); 1400</code></pre></div> 1401 1402<p>This function has two purposes.</p> 1403<p>(1) It activates a palette for rendering color glyphs, and</p> 1404<p>(2) it retrieves all (unmodified) color entries of this palette. This function returns a read-write array, which means that a calling application can modify the palette entries on demand.</p> 1405<p>A corollary of (2) is that calling the function, then modifying some values, then calling the function again with the same arguments resets all color entries to the original ‘CPAL’ values; all user modifications are lost.</p> 1406<h4>input</h4> 1407<table class="fields"> 1408<tr><td class="val" id="face">face</td><td class="desc"> 1409<p>The source face handle.</p> 1410</td></tr> 1411<tr><td class="val" id="palette_index">palette_index</td><td class="desc"> 1412<p>The palette index.</p> 1413</td></tr> 1414</table> 1415 1416<h4>output</h4> 1417<table class="fields"> 1418<tr><td class="val" id="apalette">apalette</td><td class="desc"> 1419<p>An array of color entries for a palette with index <code>palette_index</code>, having <code>num_palette_entries</code> elements (as found in the <code>FT_Palette_Data</code> structure). If <code>apalette</code> is set to <code>NULL</code>, no array gets returned (and no color entries can be modified).</p> 1420<p>In case the font doesn't support color palettes, <code>NULL</code> is returned.</p> 1421</td></tr> 1422</table> 1423 1424<h4>return</h4> 1425 1426<p>FreeType error code. 0 means success.</p> 1427<h4>note</h4> 1428 1429<p>The array pointed to by <code>apalette_entries</code> is owned and managed by FreeType.</p> 1430<p>This function always returns an error if the config macro <code>TT_CONFIG_OPTION_COLOR_LAYERS</code> is not defined in <code>ftoption.h</code>.</p> 1431<h4>since</h4> 1432 1433<p>2.10</p> 1434<hr> 1435 1436<h2 id="ft_palette_set_foreground_color">FT_Palette_Set_Foreground_Color<a class="headerlink" href="#ft_palette_set_foreground_color" title="Permanent link">¶</a></h2> 1437<p>Defined in FT_COLOR_H (freetype/ftcolor.h).</p> 1438<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1439 <b>FT_Palette_Set_Foreground_Color</b>( <a href="ft2-base_interface.html#ft_face">FT_Face</a> face, 1440 <a href="ft2-color_management.html#ft_color">FT_Color</a> foreground_color ); 1441</code></pre></div> 1442 1443<p>‘COLR’ uses palette index 0xFFFF to indicate a ‘text foreground color’. This function sets this value.</p> 1444<h4>input</h4> 1445<table class="fields"> 1446<tr><td class="val" id="face">face</td><td class="desc"> 1447<p>The source face handle.</p> 1448</td></tr> 1449<tr><td class="val" id="foreground_color">foreground_color</td><td class="desc"> 1450<p>An <code>FT_Color</code> structure to define the text foreground color.</p> 1451</td></tr> 1452</table> 1453 1454<h4>return</h4> 1455 1456<p>FreeType error code. 0 means success.</p> 1457<h4>note</h4> 1458 1459<p>If this function isn't called, the text foreground color is set to white opaque (BGRA value 0xFFFFFFFF) if <code><a href="ft2-color_management.html#ft_palette_xxx">FT_PALETTE_FOR_DARK_BACKGROUND</a></code> is present for the current palette, and black opaque (BGRA value 0x000000FF) otherwise, including the case that no palette types are available in the ‘CPAL’ table.</p> 1460<p>This function always returns an error if the config macro <code>TT_CONFIG_OPTION_COLOR_LAYERS</code> is not defined in <code>ftoption.h</code>.</p> 1461<h4>since</h4> 1462 1463<p>2.10</p> 1464<hr> 1465 1466 1467 1468 1469 1470 1471 1472 </article> 1473 </div> 1474 </div> 1475 1476 </main> 1477 1478 1479<footer class="md-footer"> 1480 1481 <nav class="md-footer__inner md-grid" aria-label="Footer"> 1482 1483 1484 <a href="ft2-glyph_variants.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: Unicode Variation Sequences" rel="prev"> 1485 <div class="md-footer__button md-icon"> 1486 <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 11h12z"/></svg> 1487 </div> 1488 <div class="md-footer__title"> 1489 <div class="md-ellipsis"> 1490 <span class="md-footer__direction"> 1491 Previous 1492 </span> 1493 Unicode Variation Sequences 1494 </div> 1495 </div> 1496 </a> 1497 1498 1499 1500 <a href="ft2-layer_management.html" class="md-footer__link md-footer__link--next" aria-label="Next: Glyph Layer Management" rel="next"> 1501 <div class="md-footer__title"> 1502 <div class="md-ellipsis"> 1503 <span class="md-footer__direction"> 1504 Next 1505 </span> 1506 Glyph Layer Management 1507 </div> 1508 </div> 1509 <div class="md-footer__button md-icon"> 1510 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg> 1511 </div> 1512 </a> 1513 1514 </nav> 1515 1516 <div class="md-footer-meta md-typeset"> 1517 <div class="md-footer-meta__inner md-grid"> 1518 <div class="md-footer-copyright"> 1519 1520 <div class="md-footer-copyright__highlight"> 1521 Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>. 1522 </div> 1523 1524 Made with 1525 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> 1526 Material for MkDocs 1527 </a> 1528 1529 </div> 1530 1531 </div> 1532 </div> 1533</footer> 1534 1535 </div> 1536 <div class="md-dialog" data-md-component="dialog"> 1537 <div class="md-dialog__inner md-typeset"></div> 1538 </div> 1539 <script id="__config" type="application/json">{"base": ".", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "assets/javascripts/workers/search.477d984a.min.js", "version": null}</script> 1540 1541 1542 <script src="assets/javascripts/bundle.82b56eb2.min.js"></script> 1543 1544 <script src="javascripts/extra.js"></script> 1545 1546 1547 </body> 1548</html>