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>Cache Sub-System - 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="#cache-sub-system" 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 Cache Sub-System 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 <li class="md-nav__item md-nav__item--nested"> 259 260 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4"> 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 <li class="md-nav__item"> 338 <a href="ft2-layer_management.html" title="Glyph Layer Management" class="md-nav__link"> 339 Glyph Layer Management 340 </a> 341 </li> 342 343 344 345 346 347 348 349 <li class="md-nav__item"> 350 <a href="ft2-glyph_management.html" title="Glyph Management" class="md-nav__link"> 351 Glyph Management 352 </a> 353 </li> 354 355 356 357 358 359 360 361 <li class="md-nav__item"> 362 <a href="ft2-mac_specific.html" title="Mac Specific Interface" class="md-nav__link"> 363 Mac Specific Interface 364 </a> 365 </li> 366 367 368 369 370 371 372 373 <li class="md-nav__item"> 374 <a href="ft2-sizes_management.html" title="Size Management" class="md-nav__link"> 375 Size Management 376 </a> 377 </li> 378 379 380 381 382 383 384 385 <li class="md-nav__item"> 386 <a href="ft2-header_file_macros.html" title="Header File Macros" class="md-nav__link"> 387 Header File Macros 388 </a> 389 </li> 390 391 392 </ul> 393 </nav> 394 </li> 395 396 397 398 399 400 401 402 <li class="md-nav__item md-nav__item--nested"> 403 404 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5"> 405 406 <label class="md-nav__link" for="nav-5"> 407 Format-Specific API 408 </label> 409 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 410 <label class="md-nav__title" for="nav-5"> 411 Format-Specific API 412 </label> 413 <ul class="md-nav__list" data-md-scrollfix> 414 415 416 417 418 419 420 421 <li class="md-nav__item"> 422 <a href="ft2-multiple_masters.html" title="Multiple Masters" class="md-nav__link"> 423 Multiple Masters 424 </a> 425 </li> 426 427 428 429 430 431 432 433 <li class="md-nav__item"> 434 <a href="ft2-truetype_tables.html" title="TrueType Tables" class="md-nav__link"> 435 TrueType Tables 436 </a> 437 </li> 438 439 440 441 442 443 444 445 <li class="md-nav__item"> 446 <a href="ft2-type1_tables.html" title="Type 1 Tables" class="md-nav__link"> 447 Type 1 Tables 448 </a> 449 </li> 450 451 452 453 454 455 456 457 <li class="md-nav__item"> 458 <a href="ft2-sfnt_names.html" title="SFNT Names" class="md-nav__link"> 459 SFNT Names 460 </a> 461 </li> 462 463 464 465 466 467 468 469 <li class="md-nav__item"> 470 <a href="ft2-bdf_fonts.html" title="BDF and PCF Files" class="md-nav__link"> 471 BDF and PCF Files 472 </a> 473 </li> 474 475 476 477 478 479 480 481 <li class="md-nav__item"> 482 <a href="ft2-cid_fonts.html" title="CID Fonts" class="md-nav__link"> 483 CID Fonts 484 </a> 485 </li> 486 487 488 489 490 491 492 493 <li class="md-nav__item"> 494 <a href="ft2-pfr_fonts.html" title="PFR Fonts" class="md-nav__link"> 495 PFR Fonts 496 </a> 497 </li> 498 499 500 501 502 503 504 505 <li class="md-nav__item"> 506 <a href="ft2-winfnt_fonts.html" title="Window FNT Files" class="md-nav__link"> 507 Window FNT Files 508 </a> 509 </li> 510 511 512 513 514 515 516 517 <li class="md-nav__item"> 518 <a href="ft2-font_formats.html" title="Font Formats" class="md-nav__link"> 519 Font Formats 520 </a> 521 </li> 522 523 524 525 526 527 528 529 <li class="md-nav__item"> 530 <a href="ft2-gasp_table.html" title="Gasp Table" class="md-nav__link"> 531 Gasp Table 532 </a> 533 </li> 534 535 536 </ul> 537 </nav> 538 </li> 539 540 541 542 543 544 545 546 <li class="md-nav__item md-nav__item--nested"> 547 548 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6"> 549 550 <label class="md-nav__link" for="nav-6"> 551 Controlling FreeType Modules 552 </label> 553 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 554 <label class="md-nav__title" for="nav-6"> 555 Controlling FreeType Modules 556 </label> 557 <ul class="md-nav__list" data-md-scrollfix> 558 559 560 561 562 563 564 565 <li class="md-nav__item"> 566 <a href="ft2-auto_hinter.html" title="The auto-hinter" class="md-nav__link"> 567 The auto-hinter 568 </a> 569 </li> 570 571 572 573 574 575 576 577 <li class="md-nav__item"> 578 <a href="ft2-cff_driver.html" title="The CFF driver" class="md-nav__link"> 579 The CFF driver 580 </a> 581 </li> 582 583 584 585 586 587 588 589 <li class="md-nav__item"> 590 <a href="ft2-t1_cid_driver.html" title="The Type 1 and CID drivers" class="md-nav__link"> 591 The Type 1 and CID drivers 592 </a> 593 </li> 594 595 596 597 598 599 600 601 <li class="md-nav__item"> 602 <a href="ft2-tt_driver.html" title="The TrueType driver" class="md-nav__link"> 603 The TrueType driver 604 </a> 605 </li> 606 607 608 609 610 611 612 613 <li class="md-nav__item"> 614 <a href="ft2-pcf_driver.html" title="The PCF driver" class="md-nav__link"> 615 The PCF driver 616 </a> 617 </li> 618 619 620 621 622 623 624 625 <li class="md-nav__item"> 626 <a href="ft2-properties.html" title="Driver properties" class="md-nav__link"> 627 Driver properties 628 </a> 629 </li> 630 631 632 633 634 635 636 637 <li class="md-nav__item"> 638 <a href="ft2-parameter_tags.html" title="Parameter Tags" class="md-nav__link"> 639 Parameter Tags 640 </a> 641 </li> 642 643 644 645 646 647 648 649 <li class="md-nav__item"> 650 <a href="ft2-lcd_rendering.html" title="Subpixel Rendering" class="md-nav__link"> 651 Subpixel Rendering 652 </a> 653 </li> 654 655 656 </ul> 657 </nav> 658 </li> 659 660 661 662 663 664 665 666 667 668 <li class="md-nav__item md-nav__item--active md-nav__item--nested"> 669 670 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7" checked> 671 672 <label class="md-nav__link" for="nav-7"> 673 Cache Sub-System 674 </label> 675 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 676 <label class="md-nav__title" for="nav-7"> 677 Cache Sub-System 678 </label> 679 <ul class="md-nav__list" data-md-scrollfix> 680 681 682 683 684 685 686 687 688 689 <li class="md-nav__item md-nav__item--active"> 690 691 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc"> 692 693 694 695 696 <label class="md-nav__link md-nav__link--active" for="__toc"> 697 Cache Sub-System 698 </label> 699 700 <a href="ft2-cache_subsystem.html" title="Cache Sub-System" class="md-nav__link md-nav__link--active"> 701 Cache Sub-System 702 </a> 703 704 705<nav class="md-nav md-nav--secondary"> 706 707 708 709 710 711 <label class="md-nav__title" for="__toc">Table of contents</label> 712 <ul class="md-nav__list" data-md-scrollfix> 713 714 <li class="md-nav__item"> 715 <a href="#synopsis" class="md-nav__link"> 716 Synopsis 717 </a> 718 719</li> 720 721 <li class="md-nav__item"> 722 <a href="#ftc_manager" class="md-nav__link"> 723 FTC_Manager 724 </a> 725 726</li> 727 728 <li class="md-nav__item"> 729 <a href="#ftc_faceid" class="md-nav__link"> 730 FTC_FaceID 731 </a> 732 733</li> 734 735 <li class="md-nav__item"> 736 <a href="#ftc_face_requester" class="md-nav__link"> 737 FTC_Face_Requester 738 </a> 739 740</li> 741 742 <li class="md-nav__item"> 743 <a href="#ftc_manager_new" class="md-nav__link"> 744 FTC_Manager_New 745 </a> 746 747</li> 748 749 <li class="md-nav__item"> 750 <a href="#ftc_manager_reset" class="md-nav__link"> 751 FTC_Manager_Reset 752 </a> 753 754</li> 755 756 <li class="md-nav__item"> 757 <a href="#ftc_manager_done" class="md-nav__link"> 758 FTC_Manager_Done 759 </a> 760 761</li> 762 763 <li class="md-nav__item"> 764 <a href="#ftc_manager_lookupface" class="md-nav__link"> 765 FTC_Manager_LookupFace 766 </a> 767 768</li> 769 770 <li class="md-nav__item"> 771 <a href="#ftc_manager_lookupsize" class="md-nav__link"> 772 FTC_Manager_LookupSize 773 </a> 774 775</li> 776 777 <li class="md-nav__item"> 778 <a href="#ftc_manager_removefaceid" class="md-nav__link"> 779 FTC_Manager_RemoveFaceID 780 </a> 781 782</li> 783 784 <li class="md-nav__item"> 785 <a href="#ftc_node" class="md-nav__link"> 786 FTC_Node 787 </a> 788 789</li> 790 791 <li class="md-nav__item"> 792 <a href="#ftc_node_unref" class="md-nav__link"> 793 FTC_Node_Unref 794 </a> 795 796</li> 797 798 <li class="md-nav__item"> 799 <a href="#ftc_imagecache" class="md-nav__link"> 800 FTC_ImageCache 801 </a> 802 803</li> 804 805 <li class="md-nav__item"> 806 <a href="#ftc_imagecache_new" class="md-nav__link"> 807 FTC_ImageCache_New 808 </a> 809 810</li> 811 812 <li class="md-nav__item"> 813 <a href="#ftc_imagecache_lookup" class="md-nav__link"> 814 FTC_ImageCache_Lookup 815 </a> 816 817</li> 818 819 <li class="md-nav__item"> 820 <a href="#ftc_sbit" class="md-nav__link"> 821 FTC_SBit 822 </a> 823 824</li> 825 826 <li class="md-nav__item"> 827 <a href="#ftc_sbitcache" class="md-nav__link"> 828 FTC_SBitCache 829 </a> 830 831</li> 832 833 <li class="md-nav__item"> 834 <a href="#ftc_sbitcache_new" class="md-nav__link"> 835 FTC_SBitCache_New 836 </a> 837 838</li> 839 840 <li class="md-nav__item"> 841 <a href="#ftc_sbitcache_lookup" class="md-nav__link"> 842 FTC_SBitCache_Lookup 843 </a> 844 845</li> 846 847 <li class="md-nav__item"> 848 <a href="#ftc_cmapcache" class="md-nav__link"> 849 FTC_CMapCache 850 </a> 851 852</li> 853 854 <li class="md-nav__item"> 855 <a href="#ftc_cmapcache_new" class="md-nav__link"> 856 FTC_CMapCache_New 857 </a> 858 859</li> 860 861 <li class="md-nav__item"> 862 <a href="#ftc_cmapcache_lookup" class="md-nav__link"> 863 FTC_CMapCache_Lookup 864 </a> 865 866</li> 867 868 <li class="md-nav__item"> 869 <a href="#ftc_scalerrec" class="md-nav__link"> 870 FTC_ScalerRec 871 </a> 872 873</li> 874 875 <li class="md-nav__item"> 876 <a href="#ftc_scaler" class="md-nav__link"> 877 FTC_Scaler 878 </a> 879 880</li> 881 882 <li class="md-nav__item"> 883 <a href="#ftc_imagetyperec" class="md-nav__link"> 884 FTC_ImageTypeRec 885 </a> 886 887</li> 888 889 <li class="md-nav__item"> 890 <a href="#ftc_imagetype" class="md-nav__link"> 891 FTC_ImageType 892 </a> 893 894</li> 895 896 <li class="md-nav__item"> 897 <a href="#ftc_imagecache_lookupscaler" class="md-nav__link"> 898 FTC_ImageCache_LookupScaler 899 </a> 900 901</li> 902 903 <li class="md-nav__item"> 904 <a href="#ftc_sbitrec" class="md-nav__link"> 905 FTC_SBitRec 906 </a> 907 908</li> 909 910 <li class="md-nav__item"> 911 <a href="#ftc_sbitcache_lookupscaler" class="md-nav__link"> 912 FTC_SBitCache_LookupScaler 913 </a> 914 915</li> 916 917 918 919 920 921 </ul> 922 923</nav> 924 925 </li> 926 927 928 </ul> 929 </nav> 930 </li> 931 932 933 934 935 936 937 938 <li class="md-nav__item md-nav__item--nested"> 939 940 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-8" type="checkbox" id="nav-8"> 941 942 <label class="md-nav__link" for="nav-8"> 943 Support API 944 </label> 945 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 946 <label class="md-nav__title" for="nav-8"> 947 Support API 948 </label> 949 <ul class="md-nav__list" data-md-scrollfix> 950 951 952 953 954 955 956 957 <li class="md-nav__item"> 958 <a href="ft2-computations.html" title="Computations" class="md-nav__link"> 959 Computations 960 </a> 961 </li> 962 963 964 965 966 967 968 969 <li class="md-nav__item"> 970 <a href="ft2-list_processing.html" title="List Processing" class="md-nav__link"> 971 List Processing 972 </a> 973 </li> 974 975 976 977 978 979 980 981 <li class="md-nav__item"> 982 <a href="ft2-outline_processing.html" title="Outline Processing" class="md-nav__link"> 983 Outline Processing 984 </a> 985 </li> 986 987 988 989 990 991 992 993 <li class="md-nav__item"> 994 <a href="ft2-quick_advance.html" title="Quick retrieval of advance values" class="md-nav__link"> 995 Quick retrieval of advance values 996 </a> 997 </li> 998 999 1000 1001 1002 1003 1004 1005 <li class="md-nav__item"> 1006 <a href="ft2-bitmap_handling.html" title="Bitmap Handling" class="md-nav__link"> 1007 Bitmap Handling 1008 </a> 1009 </li> 1010 1011 1012 1013 1014 1015 1016 1017 <li class="md-nav__item"> 1018 <a href="ft2-raster.html" title="Scanline Converter" class="md-nav__link"> 1019 Scanline Converter 1020 </a> 1021 </li> 1022 1023 1024 1025 1026 1027 1028 1029 <li class="md-nav__item"> 1030 <a href="ft2-glyph_stroker.html" title="Glyph Stroker" class="md-nav__link"> 1031 Glyph Stroker 1032 </a> 1033 </li> 1034 1035 1036 1037 1038 1039 1040 1041 <li class="md-nav__item"> 1042 <a href="ft2-system_interface.html" title="System Interface" class="md-nav__link"> 1043 System Interface 1044 </a> 1045 </li> 1046 1047 1048 1049 1050 1051 1052 1053 <li class="md-nav__item"> 1054 <a href="ft2-module_management.html" title="Module Management" class="md-nav__link"> 1055 Module Management 1056 </a> 1057 </li> 1058 1059 1060 1061 1062 1063 1064 1065 <li class="md-nav__item"> 1066 <a href="ft2-gzip.html" title="GZIP Streams" class="md-nav__link"> 1067 GZIP Streams 1068 </a> 1069 </li> 1070 1071 1072 1073 1074 1075 1076 1077 <li class="md-nav__item"> 1078 <a href="ft2-lzw.html" title="LZW Streams" class="md-nav__link"> 1079 LZW Streams 1080 </a> 1081 </li> 1082 1083 1084 1085 1086 1087 1088 1089 <li class="md-nav__item"> 1090 <a href="ft2-bzip2.html" title="BZIP2 Streams" class="md-nav__link"> 1091 BZIP2 Streams 1092 </a> 1093 </li> 1094 1095 1096 </ul> 1097 </nav> 1098 </li> 1099 1100 1101 1102 1103 1104 1105 1106 <li class="md-nav__item md-nav__item--nested"> 1107 1108 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9"> 1109 1110 <label class="md-nav__link" for="nav-9"> 1111 Error Codes 1112 </label> 1113 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 1114 <label class="md-nav__title" for="nav-9"> 1115 Error Codes 1116 </label> 1117 <ul class="md-nav__list" data-md-scrollfix> 1118 1119 1120 1121 1122 1123 1124 1125 <li class="md-nav__item"> 1126 <a href="ft2-error_enumerations.html" title="Error Enumerations" class="md-nav__link"> 1127 Error Enumerations 1128 </a> 1129 </li> 1130 1131 1132 1133 1134 1135 1136 1137 <li class="md-nav__item"> 1138 <a href="ft2-error_code_values.html" title="Error Code Values" class="md-nav__link"> 1139 Error Code Values 1140 </a> 1141 </li> 1142 1143 1144 </ul> 1145 </nav> 1146 </li> 1147 1148 1149 1150 1151 1152 1153 1154 <li class="md-nav__item md-nav__item--nested"> 1155 1156 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-10" type="checkbox" id="nav-10"> 1157 1158 <label class="md-nav__link" for="nav-10"> 1159 Miscellaneous 1160 </label> 1161 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 1162 <label class="md-nav__title" for="nav-10"> 1163 Miscellaneous 1164 </label> 1165 <ul class="md-nav__list" data-md-scrollfix> 1166 1167 1168 1169 1170 1171 1172 1173 <li class="md-nav__item"> 1174 <a href="ft2-gx_validation.html" title="TrueTypeGX/AAT Validation" class="md-nav__link"> 1175 TrueTypeGX/AAT Validation 1176 </a> 1177 </li> 1178 1179 1180 1181 1182 1183 1184 1185 <li class="md-nav__item"> 1186 <a href="ft2-incremental.html" title="Incremental Loading" class="md-nav__link"> 1187 Incremental Loading 1188 </a> 1189 </li> 1190 1191 1192 1193 1194 1195 1196 1197 <li class="md-nav__item"> 1198 <a href="ft2-truetype_engine.html" title="The TrueType Engine" class="md-nav__link"> 1199 The TrueType Engine 1200 </a> 1201 </li> 1202 1203 1204 1205 1206 1207 1208 1209 <li class="md-nav__item"> 1210 <a href="ft2-ot_validation.html" title="OpenType Validation" class="md-nav__link"> 1211 OpenType Validation 1212 </a> 1213 </li> 1214 1215 1216 </ul> 1217 </nav> 1218 </li> 1219 1220 1221 </ul> 1222</nav> 1223 </div> 1224 </div> 1225 </div> 1226 1227 1228 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> 1229 <div class="md-sidebar__scrollwrap"> 1230 <div class="md-sidebar__inner"> 1231 1232<nav class="md-nav md-nav--secondary"> 1233 1234 1235 1236 1237 1238 <label class="md-nav__title" for="__toc">Table of contents</label> 1239 <ul class="md-nav__list" data-md-scrollfix> 1240 1241 <li class="md-nav__item"> 1242 <a href="#synopsis" class="md-nav__link"> 1243 Synopsis 1244 </a> 1245 1246</li> 1247 1248 <li class="md-nav__item"> 1249 <a href="#ftc_manager" class="md-nav__link"> 1250 FTC_Manager 1251 </a> 1252 1253</li> 1254 1255 <li class="md-nav__item"> 1256 <a href="#ftc_faceid" class="md-nav__link"> 1257 FTC_FaceID 1258 </a> 1259 1260</li> 1261 1262 <li class="md-nav__item"> 1263 <a href="#ftc_face_requester" class="md-nav__link"> 1264 FTC_Face_Requester 1265 </a> 1266 1267</li> 1268 1269 <li class="md-nav__item"> 1270 <a href="#ftc_manager_new" class="md-nav__link"> 1271 FTC_Manager_New 1272 </a> 1273 1274</li> 1275 1276 <li class="md-nav__item"> 1277 <a href="#ftc_manager_reset" class="md-nav__link"> 1278 FTC_Manager_Reset 1279 </a> 1280 1281</li> 1282 1283 <li class="md-nav__item"> 1284 <a href="#ftc_manager_done" class="md-nav__link"> 1285 FTC_Manager_Done 1286 </a> 1287 1288</li> 1289 1290 <li class="md-nav__item"> 1291 <a href="#ftc_manager_lookupface" class="md-nav__link"> 1292 FTC_Manager_LookupFace 1293 </a> 1294 1295</li> 1296 1297 <li class="md-nav__item"> 1298 <a href="#ftc_manager_lookupsize" class="md-nav__link"> 1299 FTC_Manager_LookupSize 1300 </a> 1301 1302</li> 1303 1304 <li class="md-nav__item"> 1305 <a href="#ftc_manager_removefaceid" class="md-nav__link"> 1306 FTC_Manager_RemoveFaceID 1307 </a> 1308 1309</li> 1310 1311 <li class="md-nav__item"> 1312 <a href="#ftc_node" class="md-nav__link"> 1313 FTC_Node 1314 </a> 1315 1316</li> 1317 1318 <li class="md-nav__item"> 1319 <a href="#ftc_node_unref" class="md-nav__link"> 1320 FTC_Node_Unref 1321 </a> 1322 1323</li> 1324 1325 <li class="md-nav__item"> 1326 <a href="#ftc_imagecache" class="md-nav__link"> 1327 FTC_ImageCache 1328 </a> 1329 1330</li> 1331 1332 <li class="md-nav__item"> 1333 <a href="#ftc_imagecache_new" class="md-nav__link"> 1334 FTC_ImageCache_New 1335 </a> 1336 1337</li> 1338 1339 <li class="md-nav__item"> 1340 <a href="#ftc_imagecache_lookup" class="md-nav__link"> 1341 FTC_ImageCache_Lookup 1342 </a> 1343 1344</li> 1345 1346 <li class="md-nav__item"> 1347 <a href="#ftc_sbit" class="md-nav__link"> 1348 FTC_SBit 1349 </a> 1350 1351</li> 1352 1353 <li class="md-nav__item"> 1354 <a href="#ftc_sbitcache" class="md-nav__link"> 1355 FTC_SBitCache 1356 </a> 1357 1358</li> 1359 1360 <li class="md-nav__item"> 1361 <a href="#ftc_sbitcache_new" class="md-nav__link"> 1362 FTC_SBitCache_New 1363 </a> 1364 1365</li> 1366 1367 <li class="md-nav__item"> 1368 <a href="#ftc_sbitcache_lookup" class="md-nav__link"> 1369 FTC_SBitCache_Lookup 1370 </a> 1371 1372</li> 1373 1374 <li class="md-nav__item"> 1375 <a href="#ftc_cmapcache" class="md-nav__link"> 1376 FTC_CMapCache 1377 </a> 1378 1379</li> 1380 1381 <li class="md-nav__item"> 1382 <a href="#ftc_cmapcache_new" class="md-nav__link"> 1383 FTC_CMapCache_New 1384 </a> 1385 1386</li> 1387 1388 <li class="md-nav__item"> 1389 <a href="#ftc_cmapcache_lookup" class="md-nav__link"> 1390 FTC_CMapCache_Lookup 1391 </a> 1392 1393</li> 1394 1395 <li class="md-nav__item"> 1396 <a href="#ftc_scalerrec" class="md-nav__link"> 1397 FTC_ScalerRec 1398 </a> 1399 1400</li> 1401 1402 <li class="md-nav__item"> 1403 <a href="#ftc_scaler" class="md-nav__link"> 1404 FTC_Scaler 1405 </a> 1406 1407</li> 1408 1409 <li class="md-nav__item"> 1410 <a href="#ftc_imagetyperec" class="md-nav__link"> 1411 FTC_ImageTypeRec 1412 </a> 1413 1414</li> 1415 1416 <li class="md-nav__item"> 1417 <a href="#ftc_imagetype" class="md-nav__link"> 1418 FTC_ImageType 1419 </a> 1420 1421</li> 1422 1423 <li class="md-nav__item"> 1424 <a href="#ftc_imagecache_lookupscaler" class="md-nav__link"> 1425 FTC_ImageCache_LookupScaler 1426 </a> 1427 1428</li> 1429 1430 <li class="md-nav__item"> 1431 <a href="#ftc_sbitrec" class="md-nav__link"> 1432 FTC_SBitRec 1433 </a> 1434 1435</li> 1436 1437 <li class="md-nav__item"> 1438 <a href="#ftc_sbitcache_lookupscaler" class="md-nav__link"> 1439 FTC_SBitCache_LookupScaler 1440 </a> 1441 1442</li> 1443 1444 1445 1446 1447 1448 </ul> 1449 1450</nav> 1451 </div> 1452 </div> 1453 </div> 1454 1455 1456 <div class="md-content"> 1457 <article class="md-content__inner md-typeset"> 1458 1459 1460 1461 <p><a href="https://www.freetype.org">FreeType</a> » <a href="../">Docs</a> » <a href="index.html#cache-sub-system">Cache Sub-System</a> » Cache Sub-System</p> 1462<hr /> 1463<h1 id="cache-sub-system">Cache Sub-System<a class="headerlink" href="#cache-sub-system" title="Permanent link">¶</a></h1> 1464<h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">¶</a></h2> 1465<p>This section describes the FreeType 2 cache sub-system, which is used to limit the number of concurrently opened <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> and <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage.</p> 1466<p>Note that all types and functions begin with the <code>FTC_</code> prefix.</p> 1467<p>The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme:</p> 1468<p>First, available or installed font faces are uniquely identified by <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code> values, provided to the cache by the client. Note that the cache only stores and compares these values, and doesn't try to interpret them in any way.</p> 1469<p>Second, the cache calls, only when needed, a client-provided function to convert an <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code> into a new <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> object. The latter is then completely managed by the cache, including its termination through <code><a href="ft2-base_interface.html#ft_done_face">FT_Done_Face</a></code>. To monitor termination of face objects, the finalizer callback in the <code>generic</code> field of the <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> object can be used, which might also be used to store the <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code> of the face.</p> 1470<p>Clients are free to map face IDs to anything else. The most simple usage is to associate them to a (pathname,face_index) pair that is used to call <code><a href="ft2-base_interface.html#ft_new_face">FT_New_Face</a></code>. However, more complex schemes are also possible.</p> 1471<p>Note that for the cache to work correctly, the face ID values must be <strong>persistent</strong>, which means that the contents they point to should not change at runtime, or that their value should not become invalid.</p> 1472<p>If this is unavoidable (e.g., when a font is uninstalled at runtime), you should call <code><a href="ft2-cache_subsystem.html#ftc_manager_removefaceid">FTC_Manager_RemoveFaceID</a></code> as soon as possible, to let the cache get rid of any references to the old <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code> it may keep internally. Failure to do so will lead to incorrect behaviour or even crashes.</p> 1473<p>To use the cache, start with calling <code><a href="ft2-cache_subsystem.html#ftc_manager_new">FTC_Manager_New</a></code> to create a new <code><a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a></code> object, which models a single cache instance. You can then look up <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> and <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects with <code><a href="ft2-cache_subsystem.html#ftc_manager_lookupface">FTC_Manager_LookupFace</a></code> and <code><a href="ft2-cache_subsystem.html#ftc_manager_lookupsize">FTC_Manager_LookupSize</a></code>, respectively.</p> 1474<p>If you want to use the charmap caching, call <code><a href="ft2-cache_subsystem.html#ftc_cmapcache_new">FTC_CMapCache_New</a></code>, then later use <code><a href="ft2-cache_subsystem.html#ftc_cmapcache_lookup">FTC_CMapCache_Lookup</a></code> to perform the equivalent of <code><a href="ft2-base_interface.html#ft_get_char_index">FT_Get_Char_Index</a></code>, only much faster.</p> 1475<p>If you want to use the <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> caching, call <code><a href="ft2-cache_subsystem.html#ftc_imagecache">FTC_ImageCache</a></code>, then later use <code><a href="ft2-cache_subsystem.html#ftc_imagecache_lookup">FTC_ImageCache_Lookup</a></code> to retrieve the corresponding <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> objects from the cache.</p> 1476<p>If you need lots of small bitmaps, it is much more memory efficient to call <code><a href="ft2-cache_subsystem.html#ftc_sbitcache_new">FTC_SBitCache_New</a></code> followed by <code><a href="ft2-cache_subsystem.html#ftc_sbitcache_lookup">FTC_SBitCache_Lookup</a></code>. This returns <code><a href="ft2-cache_subsystem.html#ftc_sbitrec">FTC_SBitRec</a></code> structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers).</p> 1477<p>We hope to also provide a kerning cache in the near future.</p> 1478<h2 id="ftc_manager">FTC_Manager<a class="headerlink" href="#ftc_manager" title="Permanent link">¶</a></h2> 1479<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1480<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ManagerRec_* <b>FTC_Manager</b>; 1481</code></pre></div> 1482 1483<p>This object corresponds to one instance of the cache-subsystem. It is used to cache one or more <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> objects, along with corresponding <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects.</p> 1484<p>The manager intentionally limits the total number of opened <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> and <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects to control memory usage. See the <code>max_faces</code> and <code>max_sizes</code> parameters of <code><a href="ft2-cache_subsystem.html#ftc_manager_new">FTC_Manager_New</a></code>.</p> 1485<p>The manager is also used to cache ‘nodes’ of various types while limiting their total memory usage.</p> 1486<p>All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones.</p> 1487<hr> 1488 1489<h2 id="ftc_faceid">FTC_FaceID<a class="headerlink" href="#ftc_faceid" title="Permanent link">¶</a></h2> 1490<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1491<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> <b>FTC_FaceID</b>; 1492</code></pre></div> 1493 1494<p>An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent.</p> 1495<p>These pointers are typically used to point to a user-defined structure containing a font file path, and face index.</p> 1496<h4>note</h4> 1497 1498<p>Never use <code>NULL</code> as a valid <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code>.</p> 1499<p>Face IDs are passed by the client to the cache manager that calls, when needed, the <code><a href="ft2-cache_subsystem.html#ftc_face_requester">FTC_Face_Requester</a></code> to translate them into new <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> objects.</p> 1500<p>If the content of a given face ID changes at runtime, or if the value becomes invalid (e.g., when uninstalling a font), you should immediately call <code><a href="ft2-cache_subsystem.html#ftc_manager_removefaceid">FTC_Manager_RemoveFaceID</a></code> before any other cache function.</p> 1501<p>Failure to do so will result in incorrect behaviour or even memory leaks and crashes.</p> 1502<hr> 1503 1504<h2 id="ftc_face_requester">FTC_Face_Requester<a class="headerlink" href="#ftc_face_requester" title="Permanent link">¶</a></h2> 1505<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1506<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <a href="ft2-basic_types.html#ft_error">FT_Error</a> 1507 (*<b>FTC_Face_Requester</b>)( <a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a> face_id, 1508 <a href="ft2-base_interface.html#ft_library">FT_Library</a> library, 1509 <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> req_data, 1510 <a href="ft2-base_interface.html#ft_face">FT_Face</a>* aface ); 1511</code></pre></div> 1512 1513<p>A callback function provided by client applications. It is used by the cache manager to translate a given <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code> into a new valid <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> object, on demand.</p> 1514<h4>input</h4> 1515 1516<table class="fields"> 1517<tr><td class="val" id="face_id">face_id</td><td class="desc"> 1518<p>The face ID to resolve.</p> 1519</td></tr> 1520<tr><td class="val" id="library">library</td><td class="desc"> 1521<p>A handle to a FreeType library object.</p> 1522</td></tr> 1523<tr><td class="val" id="req_data">req_data</td><td class="desc"> 1524<p>Application-provided request data (see note below).</p> 1525</td></tr> 1526</table> 1527 1528<h4>output</h4> 1529 1530<table class="fields"> 1531<tr><td class="val" id="aface">aface</td><td class="desc"> 1532<p>A new <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> handle.</p> 1533</td></tr> 1534</table> 1535 1536<h4>return</h4> 1537 1538<p>FreeType error code. 0 means success.</p> 1539<h4>note</h4> 1540 1541<p>The third parameter <code>req_data</code> is the same as the one passed by the client when <code><a href="ft2-cache_subsystem.html#ftc_manager_new">FTC_Manager_New</a></code> is called.</p> 1542<p>The face requester should not perform funny things on the returned face object, like creating a new <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> for it, or setting a transformation through <code><a href="ft2-base_interface.html#ft_set_transform">FT_Set_Transform</a></code>!</p> 1543<hr> 1544 1545<h2 id="ftc_manager_new">FTC_Manager_New<a class="headerlink" href="#ftc_manager_new" title="Permanent link">¶</a></h2> 1546<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1547<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1548 <b>FTC_Manager_New</b>( <a href="ft2-base_interface.html#ft_library">FT_Library</a> library, 1549 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> max_faces, 1550 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> max_sizes, 1551 <a href="ft2-basic_types.html#ft_ulong">FT_ULong</a> max_bytes, 1552 <a href="ft2-cache_subsystem.html#ftc_face_requester">FTC_Face_Requester</a> requester, 1553 <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> req_data, 1554 <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> *amanager ); 1555</code></pre></div> 1556 1557<p>Create a new cache manager.</p> 1558<h4>input</h4> 1559 1560<table class="fields"> 1561<tr><td class="val" id="library">library</td><td class="desc"> 1562<p>The parent FreeType library handle to use.</p> 1563</td></tr> 1564<tr><td class="val" id="max_faces">max_faces</td><td class="desc"> 1565<p>Maximum number of opened <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> objects managed by this cache instance. Use 0 for defaults.</p> 1566</td></tr> 1567<tr><td class="val" id="max_sizes">max_sizes</td><td class="desc"> 1568<p>Maximum number of opened <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects managed by this cache instance. Use 0 for defaults.</p> 1569</td></tr> 1570<tr><td class="val" id="max_bytes">max_bytes</td><td class="desc"> 1571<p>Maximum number of bytes to use for cached data nodes. Use 0 for defaults. Note that this value does not account for managed <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> and <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects.</p> 1572</td></tr> 1573<tr><td class="val" id="requester">requester</td><td class="desc"> 1574<p>An application-provided callback used to translate face IDs into real <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> objects.</p> 1575</td></tr> 1576<tr><td class="val" id="req_data">req_data</td><td class="desc"> 1577<p>A generic pointer that is passed to the requester each time it is called (see <code><a href="ft2-cache_subsystem.html#ftc_face_requester">FTC_Face_Requester</a></code>).</p> 1578</td></tr> 1579</table> 1580 1581<h4>output</h4> 1582 1583<table class="fields"> 1584<tr><td class="val" id="amanager">amanager</td><td class="desc"> 1585<p>A handle to a new manager object. 0 in case of failure.</p> 1586</td></tr> 1587</table> 1588 1589<h4>return</h4> 1590 1591<p>FreeType error code. 0 means success.</p> 1592<hr> 1593 1594<h2 id="ftc_manager_reset">FTC_Manager_Reset<a class="headerlink" href="#ftc_manager_reset" title="Permanent link">¶</a></h2> 1595<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1596<div class = "codehilite"><pre><code> FT_EXPORT( <span class="keyword">void</span> ) 1597 <b>FTC_Manager_Reset</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager ); 1598</code></pre></div> 1599 1600<p>Empty a given cache manager. This simply gets rid of all the currently cached <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> and <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects within the manager.</p> 1601<h4>inout</h4> 1602 1603<table class="fields"> 1604<tr><td class="val" id="manager">manager</td><td class="desc"> 1605<p>A handle to the manager.</p> 1606</td></tr> 1607</table> 1608 1609<hr> 1610 1611<h2 id="ftc_manager_done">FTC_Manager_Done<a class="headerlink" href="#ftc_manager_done" title="Permanent link">¶</a></h2> 1612<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1613<div class = "codehilite"><pre><code> FT_EXPORT( <span class="keyword">void</span> ) 1614 <b>FTC_Manager_Done</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager ); 1615</code></pre></div> 1616 1617<p>Destroy a given manager after emptying it.</p> 1618<h4>input</h4> 1619 1620<table class="fields"> 1621<tr><td class="val" id="manager">manager</td><td class="desc"> 1622<p>A handle to the target cache manager object.</p> 1623</td></tr> 1624</table> 1625 1626<hr> 1627 1628<h2 id="ftc_manager_lookupface">FTC_Manager_LookupFace<a class="headerlink" href="#ftc_manager_lookupface" title="Permanent link">¶</a></h2> 1629<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1630<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1631 <b>FTC_Manager_LookupFace</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager, 1632 <a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a> face_id, 1633 <a href="ft2-base_interface.html#ft_face">FT_Face</a> *aface ); 1634</code></pre></div> 1635 1636<p>Retrieve the <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> object that corresponds to a given face ID through a cache manager.</p> 1637<h4>input</h4> 1638 1639<table class="fields"> 1640<tr><td class="val" id="manager">manager</td><td class="desc"> 1641<p>A handle to the cache manager.</p> 1642</td></tr> 1643<tr><td class="val" id="face_id">face_id</td><td class="desc"> 1644<p>The ID of the face object.</p> 1645</td></tr> 1646</table> 1647 1648<h4>output</h4> 1649 1650<table class="fields"> 1651<tr><td class="val" id="aface">aface</td><td class="desc"> 1652<p>A handle to the face object.</p> 1653</td></tr> 1654</table> 1655 1656<h4>return</h4> 1657 1658<p>FreeType error code. 0 means success.</p> 1659<h4>note</h4> 1660 1661<p>The returned <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> object is always owned by the manager. You should never try to discard it yourself.</p> 1662<p>The <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> object doesn't necessarily have a current size object (i.e., face->size can be 0). If you need a specific ‘font size’, use <code><a href="ft2-cache_subsystem.html#ftc_manager_lookupsize">FTC_Manager_LookupSize</a></code> instead.</p> 1663<p>Never change the face's transformation matrix (i.e., never call the <code><a href="ft2-base_interface.html#ft_set_transform">FT_Set_Transform</a></code> function) on a returned face! If you need to transform glyphs, do it yourself after glyph loading.</p> 1664<p>When you perform a lookup, out-of-memory errors are detected <em>within</em> the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.</p> 1665<p>If a lookup fails with <code>FT_Err_Out_Of_Memory</code> the cache has already been completely flushed, and still no memory was available for the operation.</p> 1666<hr> 1667 1668<h2 id="ftc_manager_lookupsize">FTC_Manager_LookupSize<a class="headerlink" href="#ftc_manager_lookupsize" title="Permanent link">¶</a></h2> 1669<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1670<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1671 <b>FTC_Manager_LookupSize</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager, 1672 <a href="ft2-cache_subsystem.html#ftc_scaler">FTC_Scaler</a> scaler, 1673 <a href="ft2-base_interface.html#ft_size">FT_Size</a> *asize ); 1674</code></pre></div> 1675 1676<p>Retrieve the <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> object that corresponds to a given <code><a href="ft2-cache_subsystem.html#ftc_scalerrec">FTC_ScalerRec</a></code> pointer through a cache manager.</p> 1677<h4>input</h4> 1678 1679<table class="fields"> 1680<tr><td class="val" id="manager">manager</td><td class="desc"> 1681<p>A handle to the cache manager.</p> 1682</td></tr> 1683<tr><td class="val" id="scaler">scaler</td><td class="desc"> 1684<p>A scaler handle.</p> 1685</td></tr> 1686</table> 1687 1688<h4>output</h4> 1689 1690<table class="fields"> 1691<tr><td class="val" id="asize">asize</td><td class="desc"> 1692<p>A handle to the size object.</p> 1693</td></tr> 1694</table> 1695 1696<h4>return</h4> 1697 1698<p>FreeType error code. 0 means success.</p> 1699<h4>note</h4> 1700 1701<p>The returned <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> object is always owned by the manager. You should never try to discard it by yourself.</p> 1702<p>You can access the parent <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> object simply as <code>size->face</code> if you need it. Note that this object is also owned by the manager.</p> 1703<h4>note</h4> 1704 1705<p>When you perform a lookup, out-of-memory errors are detected <em>within</em> the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.</p> 1706<p>If a lookup fails with <code>FT_Err_Out_Of_Memory</code> the cache has already been completely flushed, and still no memory is available for the operation.</p> 1707<hr> 1708 1709<h2 id="ftc_manager_removefaceid">FTC_Manager_RemoveFaceID<a class="headerlink" href="#ftc_manager_removefaceid" title="Permanent link">¶</a></h2> 1710<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1711<div class = "codehilite"><pre><code> FT_EXPORT( <span class="keyword">void</span> ) 1712 <b>FTC_Manager_RemoveFaceID</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager, 1713 <a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a> face_id ); 1714</code></pre></div> 1715 1716<p>A special function used to indicate to the cache manager that a given <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code> is no longer valid, either because its content changed, or because it was deallocated or uninstalled.</p> 1717<h4>input</h4> 1718 1719<table class="fields"> 1720<tr><td class="val" id="manager">manager</td><td class="desc"> 1721<p>The cache manager handle.</p> 1722</td></tr> 1723<tr><td class="val" id="face_id">face_id</td><td class="desc"> 1724<p>The <code><a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a></code> to be removed.</p> 1725</td></tr> 1726</table> 1727 1728<h4>note</h4> 1729 1730<p>This function flushes all nodes from the cache corresponding to this <code>face_id</code>, with the exception of nodes with a non-null reference count.</p> 1731<p>Such nodes are however modified internally so as to never appear in later lookups with the same <code>face_id</code> value, and to be immediately destroyed when released by all their users.</p> 1732<hr> 1733 1734<h2 id="ftc_node">FTC_Node<a class="headerlink" href="#ftc_node" title="Permanent link">¶</a></h2> 1735<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1736<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_NodeRec_* <b>FTC_Node</b>; 1737</code></pre></div> 1738 1739<p>An opaque handle to a cache node object. Each cache node is reference-counted. A node with a count of 0 might be flushed out of a full cache whenever a lookup request is performed.</p> 1740<p>If you look up nodes, you have the ability to ‘acquire’ them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly ‘release’ it (see <code><a href="ft2-cache_subsystem.html#ftc_node_unref">FTC_Node_Unref</a></code>).</p> 1741<p>See also <code><a href="ft2-cache_subsystem.html#ftc_sbitcache_lookup">FTC_SBitCache_Lookup</a></code> and <code><a href="ft2-cache_subsystem.html#ftc_imagecache_lookup">FTC_ImageCache_Lookup</a></code>.</p> 1742<hr> 1743 1744<h2 id="ftc_node_unref">FTC_Node_Unref<a class="headerlink" href="#ftc_node_unref" title="Permanent link">¶</a></h2> 1745<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1746<div class = "codehilite"><pre><code> FT_EXPORT( <span class="keyword">void</span> ) 1747 <b>FTC_Node_Unref</b>( <a href="ft2-cache_subsystem.html#ftc_node">FTC_Node</a> node, 1748 <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager ); 1749</code></pre></div> 1750 1751<p>Decrement a cache node's internal reference count. When the count reaches 0, it is not destroyed but becomes eligible for subsequent cache flushes.</p> 1752<h4>input</h4> 1753 1754<table class="fields"> 1755<tr><td class="val" id="node">node</td><td class="desc"> 1756<p>The cache node handle.</p> 1757</td></tr> 1758<tr><td class="val" id="manager">manager</td><td class="desc"> 1759<p>The cache manager handle.</p> 1760</td></tr> 1761</table> 1762 1763<hr> 1764 1765<h2 id="ftc_imagecache">FTC_ImageCache<a class="headerlink" href="#ftc_imagecache" title="Permanent link">¶</a></h2> 1766<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1767<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageCacheRec_* <b>FTC_ImageCache</b>; 1768</code></pre></div> 1769 1770<p>A handle to a glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.</p> 1771<hr> 1772 1773<h2 id="ftc_imagecache_new">FTC_ImageCache_New<a class="headerlink" href="#ftc_imagecache_new" title="Permanent link">¶</a></h2> 1774<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1775<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1776 <b>FTC_ImageCache_New</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager, 1777 <a href="ft2-cache_subsystem.html#ftc_imagecache">FTC_ImageCache</a> *acache ); 1778</code></pre></div> 1779 1780<p>Create a new glyph image cache.</p> 1781<h4>input</h4> 1782 1783<table class="fields"> 1784<tr><td class="val" id="manager">manager</td><td class="desc"> 1785<p>The parent manager for the image cache.</p> 1786</td></tr> 1787</table> 1788 1789<h4>output</h4> 1790 1791<table class="fields"> 1792<tr><td class="val" id="acache">acache</td><td class="desc"> 1793<p>A handle to the new glyph image cache object.</p> 1794</td></tr> 1795</table> 1796 1797<h4>return</h4> 1798 1799<p>FreeType error code. 0 means success.</p> 1800<hr> 1801 1802<h2 id="ftc_imagecache_lookup">FTC_ImageCache_Lookup<a class="headerlink" href="#ftc_imagecache_lookup" title="Permanent link">¶</a></h2> 1803<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1804<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1805 <b>FTC_ImageCache_Lookup</b>( <a href="ft2-cache_subsystem.html#ftc_imagecache">FTC_ImageCache</a> cache, 1806 <a href="ft2-cache_subsystem.html#ftc_imagetype">FTC_ImageType</a> type, 1807 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> gindex, 1808 <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> *aglyph, 1809 <a href="ft2-cache_subsystem.html#ftc_node">FTC_Node</a> *anode ); 1810</code></pre></div> 1811 1812<p>Retrieve a given glyph image from a glyph image cache.</p> 1813<h4>input</h4> 1814 1815<table class="fields"> 1816<tr><td class="val" id="cache">cache</td><td class="desc"> 1817<p>A handle to the source glyph image cache.</p> 1818</td></tr> 1819<tr><td class="val" id="type">type</td><td class="desc"> 1820<p>A pointer to a glyph image type descriptor.</p> 1821</td></tr> 1822<tr><td class="val" id="gindex">gindex</td><td class="desc"> 1823<p>The glyph index to retrieve.</p> 1824</td></tr> 1825</table> 1826 1827<h4>output</h4> 1828 1829<table class="fields"> 1830<tr><td class="val" id="aglyph">aglyph</td><td class="desc"> 1831<p>The corresponding <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> object. 0 in case of failure.</p> 1832</td></tr> 1833<tr><td class="val" id="anode">anode</td><td class="desc"> 1834<p>Used to return the address of the corresponding cache node after incrementing its reference count (see note below).</p> 1835</td></tr> 1836</table> 1837 1838<h4>return</h4> 1839 1840<p>FreeType error code. 0 means success.</p> 1841<h4>note</h4> 1842 1843<p>The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with <code><a href="ft2-glyph_management.html#ft_glyph_copy">FT_Glyph_Copy</a></code> and modify the new one.</p> 1844<p>If <code>anode</code> is <em>not</em> <code>NULL</code>, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>) will always be kept in the cache until you call <code><a href="ft2-cache_subsystem.html#ftc_node_unref">FTC_Node_Unref</a></code> to ‘release’ it.</p> 1845<p>If <code>anode</code> is <code>NULL</code>, the cache node is left unchanged, which means that the <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p> 1846<hr> 1847 1848<h2 id="ftc_sbit">FTC_SBit<a class="headerlink" href="#ftc_sbit" title="Permanent link">¶</a></h2> 1849<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1850<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitRec_* <b>FTC_SBit</b>; 1851</code></pre></div> 1852 1853<p>A handle to a small bitmap descriptor. See the <code><a href="ft2-cache_subsystem.html#ftc_sbitrec">FTC_SBitRec</a></code> structure for details.</p> 1854<hr> 1855 1856<h2 id="ftc_sbitcache">FTC_SBitCache<a class="headerlink" href="#ftc_sbitcache" title="Permanent link">¶</a></h2> 1857<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1858<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitCacheRec_* <b>FTC_SBitCache</b>; 1859</code></pre></div> 1860 1861<p>A handle to a small bitmap cache. These are special cache objects used to store small glyph bitmaps (and anti-aliased pixmaps) in a much more efficient way than the traditional glyph image cache implemented by <code><a href="ft2-cache_subsystem.html#ftc_imagecache">FTC_ImageCache</a></code>.</p> 1862<hr> 1863 1864<h2 id="ftc_sbitcache_new">FTC_SBitCache_New<a class="headerlink" href="#ftc_sbitcache_new" title="Permanent link">¶</a></h2> 1865<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1866<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1867 <b>FTC_SBitCache_New</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager, 1868 <a href="ft2-cache_subsystem.html#ftc_sbitcache">FTC_SBitCache</a> *acache ); 1869</code></pre></div> 1870 1871<p>Create a new cache to store small glyph bitmaps.</p> 1872<h4>input</h4> 1873 1874<table class="fields"> 1875<tr><td class="val" id="manager">manager</td><td class="desc"> 1876<p>A handle to the source cache manager.</p> 1877</td></tr> 1878</table> 1879 1880<h4>output</h4> 1881 1882<table class="fields"> 1883<tr><td class="val" id="acache">acache</td><td class="desc"> 1884<p>A handle to the new sbit cache. <code>NULL</code> in case of error.</p> 1885</td></tr> 1886</table> 1887 1888<h4>return</h4> 1889 1890<p>FreeType error code. 0 means success.</p> 1891<hr> 1892 1893<h2 id="ftc_sbitcache_lookup">FTC_SBitCache_Lookup<a class="headerlink" href="#ftc_sbitcache_lookup" title="Permanent link">¶</a></h2> 1894<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1895<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1896 <b>FTC_SBitCache_Lookup</b>( <a href="ft2-cache_subsystem.html#ftc_sbitcache">FTC_SBitCache</a> cache, 1897 <a href="ft2-cache_subsystem.html#ftc_imagetype">FTC_ImageType</a> type, 1898 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> gindex, 1899 <a href="ft2-cache_subsystem.html#ftc_sbit">FTC_SBit</a> *sbit, 1900 <a href="ft2-cache_subsystem.html#ftc_node">FTC_Node</a> *anode ); 1901</code></pre></div> 1902 1903<p>Look up a given small glyph bitmap in a given sbit cache and ‘lock’ it to prevent its flushing from the cache until needed.</p> 1904<h4>input</h4> 1905 1906<table class="fields"> 1907<tr><td class="val" id="cache">cache</td><td class="desc"> 1908<p>A handle to the source sbit cache.</p> 1909</td></tr> 1910<tr><td class="val" id="type">type</td><td class="desc"> 1911<p>A pointer to the glyph image type descriptor.</p> 1912</td></tr> 1913<tr><td class="val" id="gindex">gindex</td><td class="desc"> 1914<p>The glyph index.</p> 1915</td></tr> 1916</table> 1917 1918<h4>output</h4> 1919 1920<table class="fields"> 1921<tr><td class="val" id="sbit">sbit</td><td class="desc"> 1922<p>A handle to a small bitmap descriptor.</p> 1923</td></tr> 1924<tr><td class="val" id="anode">anode</td><td class="desc"> 1925<p>Used to return the address of the corresponding cache node after incrementing its reference count (see note below).</p> 1926</td></tr> 1927</table> 1928 1929<h4>return</h4> 1930 1931<p>FreeType error code. 0 means success.</p> 1932<h4>note</h4> 1933 1934<p>The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.</p> 1935<p>The descriptor's <code>buffer</code> field is set to 0 to indicate a missing glyph bitmap.</p> 1936<p>If <code>anode</code> is <em>not</em> <code>NULL</code>, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call <code><a href="ft2-cache_subsystem.html#ftc_node_unref">FTC_Node_Unref</a></code> to ‘release’ it.</p> 1937<p>If <code>anode</code> is <code>NULL</code>, the cache node is left unchanged, which means that the bitmap could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p> 1938<hr> 1939 1940<h2 id="ftc_cmapcache">FTC_CMapCache<a class="headerlink" href="#ftc_cmapcache" title="Permanent link">¶</a></h2> 1941<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1942<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_CMapCacheRec_* <b>FTC_CMapCache</b>; 1943</code></pre></div> 1944 1945<p>An opaque handle used to model a charmap cache. This cache is to hold character codes -> glyph indices mappings.</p> 1946<hr> 1947 1948<h2 id="ftc_cmapcache_new">FTC_CMapCache_New<a class="headerlink" href="#ftc_cmapcache_new" title="Permanent link">¶</a></h2> 1949<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1950<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 1951 <b>FTC_CMapCache_New</b>( <a href="ft2-cache_subsystem.html#ftc_manager">FTC_Manager</a> manager, 1952 <a href="ft2-cache_subsystem.html#ftc_cmapcache">FTC_CMapCache</a> *acache ); 1953</code></pre></div> 1954 1955<p>Create a new charmap cache.</p> 1956<h4>input</h4> 1957 1958<table class="fields"> 1959<tr><td class="val" id="manager">manager</td><td class="desc"> 1960<p>A handle to the cache manager.</p> 1961</td></tr> 1962</table> 1963 1964<h4>output</h4> 1965 1966<table class="fields"> 1967<tr><td class="val" id="acache">acache</td><td class="desc"> 1968<p>A new cache handle. <code>NULL</code> in case of error.</p> 1969</td></tr> 1970</table> 1971 1972<h4>return</h4> 1973 1974<p>FreeType error code. 0 means success.</p> 1975<h4>note</h4> 1976 1977<p>Like all other caches, this one will be destroyed with the cache manager.</p> 1978<hr> 1979 1980<h2 id="ftc_cmapcache_lookup">FTC_CMapCache_Lookup<a class="headerlink" href="#ftc_cmapcache_lookup" title="Permanent link">¶</a></h2> 1981<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 1982<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> ) 1983 <b>FTC_CMapCache_Lookup</b>( <a href="ft2-cache_subsystem.html#ftc_cmapcache">FTC_CMapCache</a> cache, 1984 <a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a> face_id, 1985 <a href="ft2-basic_types.html#ft_int">FT_Int</a> cmap_index, 1986 <a href="ft2-basic_types.html#ft_uint32">FT_UInt32</a> char_code ); 1987</code></pre></div> 1988 1989<p>Translate a character code into a glyph index, using the charmap cache.</p> 1990<h4>input</h4> 1991 1992<table class="fields"> 1993<tr><td class="val" id="cache">cache</td><td class="desc"> 1994<p>A charmap cache handle.</p> 1995</td></tr> 1996<tr><td class="val" id="face_id">face_id</td><td class="desc"> 1997<p>The source face ID.</p> 1998</td></tr> 1999<tr><td class="val" id="cmap_index">cmap_index</td><td class="desc"> 2000<p>The index of the charmap in the source face. Any negative value means to use the cache <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code>'s default charmap.</p> 2001</td></tr> 2002<tr><td class="val" id="char_code">char_code</td><td class="desc"> 2003<p>The character code (in the corresponding charmap).</p> 2004</td></tr> 2005</table> 2006 2007<h4>return</h4> 2008 2009<p>Glyph index. 0 means ‘no glyph’.</p> 2010<hr> 2011 2012<h2 id="ftc_scalerrec">FTC_ScalerRec<a class="headerlink" href="#ftc_scalerrec" title="Permanent link">¶</a></h2> 2013<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 2014<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ScalerRec_ 2015 { 2016 <a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a> face_id; 2017 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> width; 2018 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> height; 2019 <a href="ft2-basic_types.html#ft_int">FT_Int</a> pixel; 2020 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> x_res; 2021 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> y_res; 2022 2023 } <b>FTC_ScalerRec</b>; 2024</code></pre></div> 2025 2026<p>A structure used to describe a given character size in either pixels or points to the cache manager. See <code><a href="ft2-cache_subsystem.html#ftc_manager_lookupsize">FTC_Manager_LookupSize</a></code>.</p> 2027<h4>fields</h4> 2028 2029<table class="fields"> 2030<tr><td class="val" id="face_id">face_id</td><td class="desc"> 2031<p>The source face ID.</p> 2032</td></tr> 2033<tr><td class="val" id="width">width</td><td class="desc"> 2034<p>The character width.</p> 2035</td></tr> 2036<tr><td class="val" id="height">height</td><td class="desc"> 2037<p>The character height.</p> 2038</td></tr> 2039<tr><td class="val" id="pixel">pixel</td><td class="desc"> 2040<p>A Boolean. If 1, the <code>width</code> and <code>height</code> fields are interpreted as integer pixel character sizes. Otherwise, they are expressed as 1/64th of points.</p> 2041</td></tr> 2042<tr><td class="val" id="x_res">x_res</td><td class="desc"> 2043<p>Only used when <code>pixel</code> is value 0 to indicate the horizontal resolution in dpi.</p> 2044</td></tr> 2045<tr><td class="val" id="y_res">y_res</td><td class="desc"> 2046<p>Only used when <code>pixel</code> is value 0 to indicate the vertical resolution in dpi.</p> 2047</td></tr> 2048</table> 2049 2050<h4>note</h4> 2051 2052<p>This type is mainly used to retrieve <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> objects through the cache manager.</p> 2053<hr> 2054 2055<h2 id="ftc_scaler">FTC_Scaler<a class="headerlink" href="#ftc_scaler" title="Permanent link">¶</a></h2> 2056<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 2057<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ScalerRec_* <b>FTC_Scaler</b>; 2058</code></pre></div> 2059 2060<p>A handle to an <code><a href="ft2-cache_subsystem.html#ftc_scalerrec">FTC_ScalerRec</a></code> structure.</p> 2061<hr> 2062 2063<h2 id="ftc_imagetyperec">FTC_ImageTypeRec<a class="headerlink" href="#ftc_imagetyperec" title="Permanent link">¶</a></h2> 2064<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 2065<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageTypeRec_ 2066 { 2067 <a href="ft2-cache_subsystem.html#ftc_faceid">FTC_FaceID</a> face_id; 2068 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> width; 2069 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> height; 2070 <a href="ft2-basic_types.html#ft_int32">FT_Int32</a> flags; 2071 2072 } <b>FTC_ImageTypeRec</b>; 2073</code></pre></div> 2074 2075<p>A structure used to model the type of images in a glyph cache.</p> 2076<h4>fields</h4> 2077 2078<table class="fields"> 2079<tr><td class="val" id="face_id">face_id</td><td class="desc"> 2080<p>The face ID.</p> 2081</td></tr> 2082<tr><td class="val" id="width">width</td><td class="desc"> 2083<p>The width in pixels.</p> 2084</td></tr> 2085<tr><td class="val" id="height">height</td><td class="desc"> 2086<p>The height in pixels.</p> 2087</td></tr> 2088<tr><td class="val" id="flags">flags</td><td class="desc"> 2089<p>The load flags, as in <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code>.</p> 2090</td></tr> 2091</table> 2092 2093<hr> 2094 2095<h2 id="ftc_imagetype">FTC_ImageType<a class="headerlink" href="#ftc_imagetype" title="Permanent link">¶</a></h2> 2096<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 2097<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageTypeRec_* <b>FTC_ImageType</b>; 2098</code></pre></div> 2099 2100<p>A handle to an <code><a href="ft2-cache_subsystem.html#ftc_imagetyperec">FTC_ImageTypeRec</a></code> structure.</p> 2101<hr> 2102 2103<h2 id="ftc_imagecache_lookupscaler">FTC_ImageCache_LookupScaler<a class="headerlink" href="#ftc_imagecache_lookupscaler" title="Permanent link">¶</a></h2> 2104<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 2105<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 2106 <b>FTC_ImageCache_LookupScaler</b>( <a href="ft2-cache_subsystem.html#ftc_imagecache">FTC_ImageCache</a> cache, 2107 <a href="ft2-cache_subsystem.html#ftc_scaler">FTC_Scaler</a> scaler, 2108 <a href="ft2-basic_types.html#ft_ulong">FT_ULong</a> load_flags, 2109 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> gindex, 2110 <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> *aglyph, 2111 <a href="ft2-cache_subsystem.html#ftc_node">FTC_Node</a> *anode ); 2112</code></pre></div> 2113 2114<p>A variant of <code><a href="ft2-cache_subsystem.html#ftc_imagecache_lookup">FTC_ImageCache_Lookup</a></code> that uses an <code><a href="ft2-cache_subsystem.html#ftc_scalerrec">FTC_ScalerRec</a></code> to specify the face ID and its size.</p> 2115<h4>input</h4> 2116 2117<table class="fields"> 2118<tr><td class="val" id="cache">cache</td><td class="desc"> 2119<p>A handle to the source glyph image cache.</p> 2120</td></tr> 2121<tr><td class="val" id="scaler">scaler</td><td class="desc"> 2122<p>A pointer to a scaler descriptor.</p> 2123</td></tr> 2124<tr><td class="val" id="load_flags">load_flags</td><td class="desc"> 2125<p>The corresponding load flags.</p> 2126</td></tr> 2127<tr><td class="val" id="gindex">gindex</td><td class="desc"> 2128<p>The glyph index to retrieve.</p> 2129</td></tr> 2130</table> 2131 2132<h4>output</h4> 2133 2134<table class="fields"> 2135<tr><td class="val" id="aglyph">aglyph</td><td class="desc"> 2136<p>The corresponding <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> object. 0 in case of failure.</p> 2137</td></tr> 2138<tr><td class="val" id="anode">anode</td><td class="desc"> 2139<p>Used to return the address of the corresponding cache node after incrementing its reference count (see note below).</p> 2140</td></tr> 2141</table> 2142 2143<h4>return</h4> 2144 2145<p>FreeType error code. 0 means success.</p> 2146<h4>note</h4> 2147 2148<p>The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with <code><a href="ft2-glyph_management.html#ft_glyph_copy">FT_Glyph_Copy</a></code> and modify the new one.</p> 2149<p>If <code>anode</code> is <em>not</em> <code>NULL</code>, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>) will always be kept in the cache until you call <code><a href="ft2-cache_subsystem.html#ftc_node_unref">FTC_Node_Unref</a></code> to ‘release’ it.</p> 2150<p>If <code>anode</code> is <code>NULL</code>, the cache node is left unchanged, which means that the <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p> 2151<p>Calls to <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code> and friends have no effect on cached glyphs; you should always use the FreeType cache API instead.</p> 2152<hr> 2153 2154<h2 id="ftc_sbitrec">FTC_SBitRec<a class="headerlink" href="#ftc_sbitrec" title="Permanent link">¶</a></h2> 2155<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 2156<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitRec_ 2157 { 2158 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> width; 2159 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> height; 2160 <a href="ft2-basic_types.html#ft_char">FT_Char</a> left; 2161 <a href="ft2-basic_types.html#ft_char">FT_Char</a> top; 2162 2163 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> format; 2164 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a> max_grays; 2165 <a href="ft2-basic_types.html#ft_short">FT_Short</a> pitch; 2166 <a href="ft2-basic_types.html#ft_char">FT_Char</a> xadvance; 2167 <a href="ft2-basic_types.html#ft_char">FT_Char</a> yadvance; 2168 2169 <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>* buffer; 2170 2171 } <b>FTC_SBitRec</b>; 2172</code></pre></div> 2173 2174<p>A very compact structure used to describe a small glyph bitmap.</p> 2175<h4>fields</h4> 2176 2177<table class="fields"> 2178<tr><td class="val" id="width">width</td><td class="desc"> 2179<p>The bitmap width in pixels.</p> 2180</td></tr> 2181<tr><td class="val" id="height">height</td><td class="desc"> 2182<p>The bitmap height in pixels.</p> 2183</td></tr> 2184<tr><td class="val" id="left">left</td><td class="desc"> 2185<p>The horizontal distance from the pen position to the left bitmap border (a.k.a. ‘left side bearing’, or ‘lsb’).</p> 2186</td></tr> 2187<tr><td class="val" id="top">top</td><td class="desc"> 2188<p>The vertical distance from the pen position (on the baseline) to the upper bitmap border (a.k.a. ‘top side bearing’). The distance is positive for upwards y coordinates.</p> 2189</td></tr> 2190<tr><td class="val" id="format">format</td><td class="desc"> 2191<p>The format of the glyph bitmap (monochrome or gray).</p> 2192</td></tr> 2193<tr><td class="val" id="max_grays">max_grays</td><td class="desc"> 2194<p>Maximum gray level value (in the range 1 to 255).</p> 2195</td></tr> 2196<tr><td class="val" id="pitch">pitch</td><td class="desc"> 2197<p>The number of bytes per bitmap line. May be positive or negative.</p> 2198</td></tr> 2199<tr><td class="val" id="xadvance">xadvance</td><td class="desc"> 2200<p>The horizontal advance width in pixels.</p> 2201</td></tr> 2202<tr><td class="val" id="yadvance">yadvance</td><td class="desc"> 2203<p>The vertical advance height in pixels.</p> 2204</td></tr> 2205<tr><td class="val" id="buffer">buffer</td><td class="desc"> 2206<p>A pointer to the bitmap pixels.</p> 2207</td></tr> 2208</table> 2209 2210<hr> 2211 2212<h2 id="ftc_sbitcache_lookupscaler">FTC_SBitCache_LookupScaler<a class="headerlink" href="#ftc_sbitcache_lookupscaler" title="Permanent link">¶</a></h2> 2213<p>Defined in FT_CACHE_H (freetype/ftcache.h).</p> 2214<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> ) 2215 <b>FTC_SBitCache_LookupScaler</b>( <a href="ft2-cache_subsystem.html#ftc_sbitcache">FTC_SBitCache</a> cache, 2216 <a href="ft2-cache_subsystem.html#ftc_scaler">FTC_Scaler</a> scaler, 2217 <a href="ft2-basic_types.html#ft_ulong">FT_ULong</a> load_flags, 2218 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> gindex, 2219 <a href="ft2-cache_subsystem.html#ftc_sbit">FTC_SBit</a> *sbit, 2220 <a href="ft2-cache_subsystem.html#ftc_node">FTC_Node</a> *anode ); 2221</code></pre></div> 2222 2223<p>A variant of <code><a href="ft2-cache_subsystem.html#ftc_sbitcache_lookup">FTC_SBitCache_Lookup</a></code> that uses an <code><a href="ft2-cache_subsystem.html#ftc_scalerrec">FTC_ScalerRec</a></code> to specify the face ID and its size.</p> 2224<h4>input</h4> 2225 2226<table class="fields"> 2227<tr><td class="val" id="cache">cache</td><td class="desc"> 2228<p>A handle to the source sbit cache.</p> 2229</td></tr> 2230<tr><td class="val" id="scaler">scaler</td><td class="desc"> 2231<p>A pointer to the scaler descriptor.</p> 2232</td></tr> 2233<tr><td class="val" id="load_flags">load_flags</td><td class="desc"> 2234<p>The corresponding load flags.</p> 2235</td></tr> 2236<tr><td class="val" id="gindex">gindex</td><td class="desc"> 2237<p>The glyph index.</p> 2238</td></tr> 2239</table> 2240 2241<h4>output</h4> 2242 2243<table class="fields"> 2244<tr><td class="val" id="sbit">sbit</td><td class="desc"> 2245<p>A handle to a small bitmap descriptor.</p> 2246</td></tr> 2247<tr><td class="val" id="anode">anode</td><td class="desc"> 2248<p>Used to return the address of the corresponding cache node after incrementing its reference count (see note below).</p> 2249</td></tr> 2250</table> 2251 2252<h4>return</h4> 2253 2254<p>FreeType error code. 0 means success.</p> 2255<h4>note</h4> 2256 2257<p>The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.</p> 2258<p>The descriptor's <code>buffer</code> field is set to 0 to indicate a missing glyph bitmap.</p> 2259<p>If <code>anode</code> is <em>not</em> <code>NULL</code>, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call <code><a href="ft2-cache_subsystem.html#ftc_node_unref">FTC_Node_Unref</a></code> to ‘release’ it.</p> 2260<p>If <code>anode</code> is <code>NULL</code>, the cache node is left unchanged, which means that the bitmap could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p> 2261<hr> 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 </article> 2273 </div> 2274 </div> 2275 </main> 2276 2277 2278<footer class="md-footer"> 2279 2280 <div class="md-footer-nav"> 2281 <nav class="md-footer-nav__inner md-grid"> 2282 2283 <a href="ft2-lcd_rendering.html" title="Subpixel Rendering" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> 2284 <div class="md-flex__cell md-flex__cell--shrink"> 2285 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> 2286 </div> 2287 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> 2288 <span class="md-flex__ellipsis"> 2289 <span class="md-footer-nav__direction"> 2290 Previous 2291 </span> 2292 Subpixel Rendering 2293 </span> 2294 </div> 2295 </a> 2296 2297 2298 <a href="ft2-computations.html" title="Computations" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> 2299 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> 2300 <span class="md-flex__ellipsis"> 2301 <span class="md-footer-nav__direction"> 2302 Next 2303 </span> 2304 Computations 2305 </span> 2306 </div> 2307 <div class="md-flex__cell md-flex__cell--shrink"> 2308 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> 2309 </div> 2310 </a> 2311 2312 </nav> 2313 </div> 2314 2315 <div class="md-footer-meta md-typeset"> 2316 <div class="md-footer-meta__inner md-grid"> 2317 <div class="md-footer-copyright"> 2318 2319 <div class="md-footer-copyright__highlight"> 2320 Copyright 2020 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>. 2321 </div> 2322 2323 powered by 2324 <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a> 2325 and 2326 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> 2327 Material for MkDocs</a> 2328 </div> 2329 2330 </div> 2331 </div> 2332</footer> 2333 2334 </div> 2335 2336 <script src="assets/javascripts/application.c33a9706.js"></script> 2337 2338 <script>app.initialize({version:"1.1",url:{base:"."}})</script> 2339 2340 <script src="javascripts/extra.js"></script> 2341 2342 2343 </body> 2344</html>