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>Driver properties - 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="#driver-properties" 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 Driver properties 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 547 548 <li class="md-nav__item md-nav__item--active md-nav__item--nested"> 549 550 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6" checked> 551 552 <label class="md-nav__link" for="nav-6"> 553 Controlling FreeType Modules 554 </label> 555 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 556 <label class="md-nav__title" for="nav-6"> 557 Controlling FreeType Modules 558 </label> 559 <ul class="md-nav__list" data-md-scrollfix> 560 561 562 563 564 565 566 567 <li class="md-nav__item"> 568 <a href="ft2-auto_hinter.html" title="The auto-hinter" class="md-nav__link"> 569 The auto-hinter 570 </a> 571 </li> 572 573 574 575 576 577 578 579 <li class="md-nav__item"> 580 <a href="ft2-cff_driver.html" title="The CFF driver" class="md-nav__link"> 581 The CFF driver 582 </a> 583 </li> 584 585 586 587 588 589 590 591 <li class="md-nav__item"> 592 <a href="ft2-t1_cid_driver.html" title="The Type 1 and CID drivers" class="md-nav__link"> 593 The Type 1 and CID drivers 594 </a> 595 </li> 596 597 598 599 600 601 602 603 <li class="md-nav__item"> 604 <a href="ft2-tt_driver.html" title="The TrueType driver" class="md-nav__link"> 605 The TrueType driver 606 </a> 607 </li> 608 609 610 611 612 613 614 615 <li class="md-nav__item"> 616 <a href="ft2-pcf_driver.html" title="The PCF driver" class="md-nav__link"> 617 The PCF driver 618 </a> 619 </li> 620 621 622 623 624 625 626 627 628 629 <li class="md-nav__item md-nav__item--active"> 630 631 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc"> 632 633 634 635 636 <label class="md-nav__link md-nav__link--active" for="__toc"> 637 Driver properties 638 </label> 639 640 <a href="ft2-properties.html" title="Driver properties" class="md-nav__link md-nav__link--active"> 641 Driver properties 642 </a> 643 644 645<nav class="md-nav md-nav--secondary"> 646 647 648 649 650 651 <label class="md-nav__title" for="__toc">Table of contents</label> 652 <ul class="md-nav__list" data-md-scrollfix> 653 654 <li class="md-nav__item"> 655 <a href="#synopsis" class="md-nav__link"> 656 Synopsis 657 </a> 658 659</li> 660 661 <li class="md-nav__item"> 662 <a href="#ft_hinting_xxx" class="md-nav__link"> 663 FT_HINTING_XXX 664 </a> 665 666</li> 667 668 <li class="md-nav__item"> 669 <a href="#hinting-engine" class="md-nav__link"> 670 hinting-engine 671 </a> 672 673</li> 674 675 <li class="md-nav__item"> 676 <a href="#no-stem-darkening" class="md-nav__link"> 677 no-stem-darkening 678 </a> 679 680</li> 681 682 <li class="md-nav__item"> 683 <a href="#darkening-parameters" class="md-nav__link"> 684 darkening-parameters 685 </a> 686 687</li> 688 689 <li class="md-nav__item"> 690 <a href="#random-seed" class="md-nav__link"> 691 random-seed 692 </a> 693 694</li> 695 696 <li class="md-nav__item"> 697 <a href="#no-long-family-names" class="md-nav__link"> 698 no-long-family-names 699 </a> 700 701</li> 702 703 <li class="md-nav__item"> 704 <a href="#tt_interpreter_version_xxx" class="md-nav__link"> 705 TT_INTERPRETER_VERSION_XXX 706 </a> 707 708</li> 709 710 <li class="md-nav__item"> 711 <a href="#interpreter-version" class="md-nav__link"> 712 interpreter-version 713 </a> 714 715</li> 716 717 <li class="md-nav__item"> 718 <a href="#glyph-to-script-map" class="md-nav__link"> 719 glyph-to-script-map 720 </a> 721 722</li> 723 724 <li class="md-nav__item"> 725 <a href="#ft_autohinter_script_xxx" class="md-nav__link"> 726 FT_AUTOHINTER_SCRIPT_XXX 727 </a> 728 729</li> 730 731 <li class="md-nav__item"> 732 <a href="#ft_prop_glyphtoscriptmap" class="md-nav__link"> 733 FT_Prop_GlyphToScriptMap 734 </a> 735 736</li> 737 738 <li class="md-nav__item"> 739 <a href="#fallback-script" class="md-nav__link"> 740 fallback-script 741 </a> 742 743</li> 744 745 <li class="md-nav__item"> 746 <a href="#default-script" class="md-nav__link"> 747 default-script 748 </a> 749 750</li> 751 752 <li class="md-nav__item"> 753 <a href="#increase-x-height" class="md-nav__link"> 754 increase-x-height 755 </a> 756 757</li> 758 759 <li class="md-nav__item"> 760 <a href="#ft_prop_increasexheight" class="md-nav__link"> 761 FT_Prop_IncreaseXHeight 762 </a> 763 764</li> 765 766 <li class="md-nav__item"> 767 <a href="#warping" class="md-nav__link"> 768 warping 769 </a> 770 771</li> 772 773 774 775 776 777 </ul> 778 779</nav> 780 781 </li> 782 783 784 785 786 787 788 789 <li class="md-nav__item"> 790 <a href="ft2-parameter_tags.html" title="Parameter Tags" class="md-nav__link"> 791 Parameter Tags 792 </a> 793 </li> 794 795 796 797 798 799 800 801 <li class="md-nav__item"> 802 <a href="ft2-lcd_rendering.html" title="Subpixel Rendering" class="md-nav__link"> 803 Subpixel Rendering 804 </a> 805 </li> 806 807 808 </ul> 809 </nav> 810 </li> 811 812 813 814 815 816 817 818 <li class="md-nav__item md-nav__item--nested"> 819 820 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7"> 821 822 <label class="md-nav__link" for="nav-7"> 823 Cache Sub-System 824 </label> 825 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 826 <label class="md-nav__title" for="nav-7"> 827 Cache Sub-System 828 </label> 829 <ul class="md-nav__list" data-md-scrollfix> 830 831 832 833 834 835 836 837 <li class="md-nav__item"> 838 <a href="ft2-cache_subsystem.html" title="Cache Sub-System" class="md-nav__link"> 839 Cache Sub-System 840 </a> 841 </li> 842 843 844 </ul> 845 </nav> 846 </li> 847 848 849 850 851 852 853 854 <li class="md-nav__item md-nav__item--nested"> 855 856 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-8" type="checkbox" id="nav-8"> 857 858 <label class="md-nav__link" for="nav-8"> 859 Support API 860 </label> 861 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 862 <label class="md-nav__title" for="nav-8"> 863 Support API 864 </label> 865 <ul class="md-nav__list" data-md-scrollfix> 866 867 868 869 870 871 872 873 <li class="md-nav__item"> 874 <a href="ft2-computations.html" title="Computations" class="md-nav__link"> 875 Computations 876 </a> 877 </li> 878 879 880 881 882 883 884 885 <li class="md-nav__item"> 886 <a href="ft2-list_processing.html" title="List Processing" class="md-nav__link"> 887 List Processing 888 </a> 889 </li> 890 891 892 893 894 895 896 897 <li class="md-nav__item"> 898 <a href="ft2-outline_processing.html" title="Outline Processing" class="md-nav__link"> 899 Outline Processing 900 </a> 901 </li> 902 903 904 905 906 907 908 909 <li class="md-nav__item"> 910 <a href="ft2-quick_advance.html" title="Quick retrieval of advance values" class="md-nav__link"> 911 Quick retrieval of advance values 912 </a> 913 </li> 914 915 916 917 918 919 920 921 <li class="md-nav__item"> 922 <a href="ft2-bitmap_handling.html" title="Bitmap Handling" class="md-nav__link"> 923 Bitmap Handling 924 </a> 925 </li> 926 927 928 929 930 931 932 933 <li class="md-nav__item"> 934 <a href="ft2-raster.html" title="Scanline Converter" class="md-nav__link"> 935 Scanline Converter 936 </a> 937 </li> 938 939 940 941 942 943 944 945 <li class="md-nav__item"> 946 <a href="ft2-glyph_stroker.html" title="Glyph Stroker" class="md-nav__link"> 947 Glyph Stroker 948 </a> 949 </li> 950 951 952 953 954 955 956 957 <li class="md-nav__item"> 958 <a href="ft2-system_interface.html" title="System Interface" class="md-nav__link"> 959 System Interface 960 </a> 961 </li> 962 963 964 965 966 967 968 969 <li class="md-nav__item"> 970 <a href="ft2-module_management.html" title="Module Management" class="md-nav__link"> 971 Module Management 972 </a> 973 </li> 974 975 976 977 978 979 980 981 <li class="md-nav__item"> 982 <a href="ft2-gzip.html" title="GZIP Streams" class="md-nav__link"> 983 GZIP Streams 984 </a> 985 </li> 986 987 988 989 990 991 992 993 <li class="md-nav__item"> 994 <a href="ft2-lzw.html" title="LZW Streams" class="md-nav__link"> 995 LZW Streams 996 </a> 997 </li> 998 999 1000 1001 1002 1003 1004 1005 <li class="md-nav__item"> 1006 <a href="ft2-bzip2.html" title="BZIP2 Streams" class="md-nav__link"> 1007 BZIP2 Streams 1008 </a> 1009 </li> 1010 1011 1012 </ul> 1013 </nav> 1014 </li> 1015 1016 1017 1018 1019 1020 1021 1022 <li class="md-nav__item md-nav__item--nested"> 1023 1024 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9"> 1025 1026 <label class="md-nav__link" for="nav-9"> 1027 Error Codes 1028 </label> 1029 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 1030 <label class="md-nav__title" for="nav-9"> 1031 Error Codes 1032 </label> 1033 <ul class="md-nav__list" data-md-scrollfix> 1034 1035 1036 1037 1038 1039 1040 1041 <li class="md-nav__item"> 1042 <a href="ft2-error_enumerations.html" title="Error Enumerations" class="md-nav__link"> 1043 Error Enumerations 1044 </a> 1045 </li> 1046 1047 1048 1049 1050 1051 1052 1053 <li class="md-nav__item"> 1054 <a href="ft2-error_code_values.html" title="Error Code Values" class="md-nav__link"> 1055 Error Code Values 1056 </a> 1057 </li> 1058 1059 1060 </ul> 1061 </nav> 1062 </li> 1063 1064 1065 1066 1067 1068 1069 1070 <li class="md-nav__item md-nav__item--nested"> 1071 1072 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-10" type="checkbox" id="nav-10"> 1073 1074 <label class="md-nav__link" for="nav-10"> 1075 Miscellaneous 1076 </label> 1077 <nav class="md-nav" data-md-component="collapsible" data-md-level="1"> 1078 <label class="md-nav__title" for="nav-10"> 1079 Miscellaneous 1080 </label> 1081 <ul class="md-nav__list" data-md-scrollfix> 1082 1083 1084 1085 1086 1087 1088 1089 <li class="md-nav__item"> 1090 <a href="ft2-gx_validation.html" title="TrueTypeGX/AAT Validation" class="md-nav__link"> 1091 TrueTypeGX/AAT Validation 1092 </a> 1093 </li> 1094 1095 1096 1097 1098 1099 1100 1101 <li class="md-nav__item"> 1102 <a href="ft2-incremental.html" title="Incremental Loading" class="md-nav__link"> 1103 Incremental Loading 1104 </a> 1105 </li> 1106 1107 1108 1109 1110 1111 1112 1113 <li class="md-nav__item"> 1114 <a href="ft2-truetype_engine.html" title="The TrueType Engine" class="md-nav__link"> 1115 The TrueType Engine 1116 </a> 1117 </li> 1118 1119 1120 1121 1122 1123 1124 1125 <li class="md-nav__item"> 1126 <a href="ft2-ot_validation.html" title="OpenType Validation" class="md-nav__link"> 1127 OpenType Validation 1128 </a> 1129 </li> 1130 1131 1132 </ul> 1133 </nav> 1134 </li> 1135 1136 1137 </ul> 1138</nav> 1139 </div> 1140 </div> 1141 </div> 1142 1143 1144 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> 1145 <div class="md-sidebar__scrollwrap"> 1146 <div class="md-sidebar__inner"> 1147 1148<nav class="md-nav md-nav--secondary"> 1149 1150 1151 1152 1153 1154 <label class="md-nav__title" for="__toc">Table of contents</label> 1155 <ul class="md-nav__list" data-md-scrollfix> 1156 1157 <li class="md-nav__item"> 1158 <a href="#synopsis" class="md-nav__link"> 1159 Synopsis 1160 </a> 1161 1162</li> 1163 1164 <li class="md-nav__item"> 1165 <a href="#ft_hinting_xxx" class="md-nav__link"> 1166 FT_HINTING_XXX 1167 </a> 1168 1169</li> 1170 1171 <li class="md-nav__item"> 1172 <a href="#hinting-engine" class="md-nav__link"> 1173 hinting-engine 1174 </a> 1175 1176</li> 1177 1178 <li class="md-nav__item"> 1179 <a href="#no-stem-darkening" class="md-nav__link"> 1180 no-stem-darkening 1181 </a> 1182 1183</li> 1184 1185 <li class="md-nav__item"> 1186 <a href="#darkening-parameters" class="md-nav__link"> 1187 darkening-parameters 1188 </a> 1189 1190</li> 1191 1192 <li class="md-nav__item"> 1193 <a href="#random-seed" class="md-nav__link"> 1194 random-seed 1195 </a> 1196 1197</li> 1198 1199 <li class="md-nav__item"> 1200 <a href="#no-long-family-names" class="md-nav__link"> 1201 no-long-family-names 1202 </a> 1203 1204</li> 1205 1206 <li class="md-nav__item"> 1207 <a href="#tt_interpreter_version_xxx" class="md-nav__link"> 1208 TT_INTERPRETER_VERSION_XXX 1209 </a> 1210 1211</li> 1212 1213 <li class="md-nav__item"> 1214 <a href="#interpreter-version" class="md-nav__link"> 1215 interpreter-version 1216 </a> 1217 1218</li> 1219 1220 <li class="md-nav__item"> 1221 <a href="#glyph-to-script-map" class="md-nav__link"> 1222 glyph-to-script-map 1223 </a> 1224 1225</li> 1226 1227 <li class="md-nav__item"> 1228 <a href="#ft_autohinter_script_xxx" class="md-nav__link"> 1229 FT_AUTOHINTER_SCRIPT_XXX 1230 </a> 1231 1232</li> 1233 1234 <li class="md-nav__item"> 1235 <a href="#ft_prop_glyphtoscriptmap" class="md-nav__link"> 1236 FT_Prop_GlyphToScriptMap 1237 </a> 1238 1239</li> 1240 1241 <li class="md-nav__item"> 1242 <a href="#fallback-script" class="md-nav__link"> 1243 fallback-script 1244 </a> 1245 1246</li> 1247 1248 <li class="md-nav__item"> 1249 <a href="#default-script" class="md-nav__link"> 1250 default-script 1251 </a> 1252 1253</li> 1254 1255 <li class="md-nav__item"> 1256 <a href="#increase-x-height" class="md-nav__link"> 1257 increase-x-height 1258 </a> 1259 1260</li> 1261 1262 <li class="md-nav__item"> 1263 <a href="#ft_prop_increasexheight" class="md-nav__link"> 1264 FT_Prop_IncreaseXHeight 1265 </a> 1266 1267</li> 1268 1269 <li class="md-nav__item"> 1270 <a href="#warping" class="md-nav__link"> 1271 warping 1272 </a> 1273 1274</li> 1275 1276 1277 1278 1279 1280 </ul> 1281 1282</nav> 1283 </div> 1284 </div> 1285 </div> 1286 1287 1288 <div class="md-content"> 1289 <article class="md-content__inner md-typeset"> 1290 1291 1292 1293 <p><a href="https://www.freetype.org">FreeType</a> » <a href="../">Docs</a> » <a href="index.html#controlling-freetype-modules">Controlling FreeType Modules</a> » Driver properties</p> 1294<hr /> 1295<h1 id="driver-properties">Driver properties<a class="headerlink" href="#driver-properties" title="Permanent link">¶</a></h1> 1296<h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">¶</a></h2> 1297<p>Driver modules can be controlled by setting and unsetting properties, using the functions <code><a href="ft2-module_management.html#ft_property_set">FT_Property_Set</a></code> and <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code>. This section documents the available properties, together with auxiliary macros and structures.</p> 1298<h2 id="ft_hinting_xxx">FT_HINTING_XXX<a class="headerlink" href="#ft_hinting_xxx" title="Permanent link">¶</a></h2> 1299<p>Defined in FT_DRIVER_H (freetype/ftdriver.h).</p> 1300<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-properties.html#ft_hinting_freetype">FT_HINTING_FREETYPE</a> 0 1301#<span class="keyword">define</span> <a href="ft2-properties.html#ft_hinting_adobe">FT_HINTING_ADOBE</a> 1 1302 1303 /* these constants (introduced in 2.4.12) are deprecated */ 1304#<span class="keyword">define</span> FT_CFF_HINTING_FREETYPE <a href="ft2-properties.html#ft_hinting_freetype">FT_HINTING_FREETYPE</a> 1305#<span class="keyword">define</span> FT_CFF_HINTING_ADOBE <a href="ft2-properties.html#ft_hinting_adobe">FT_HINTING_ADOBE</a> 1306</code></pre></div> 1307 1308<p>A list of constants used for the <code><a href="ft2-properties.html#hinting-engine">hinting-engine</a></code> property to select the hinting engine for CFF, Type 1, and CID fonts.</p> 1309<h4>values</h4> 1310 1311<table class="fields"> 1312<tr><td class="val" id="ft_hinting_freetype">FT_HINTING_FREETYPE</td><td class="desc"> 1313<p>Use the old FreeType hinting engine.</p> 1314</td></tr> 1315<tr><td class="val" id="ft_hinting_adobe">FT_HINTING_ADOBE</td><td class="desc"> 1316<p>Use the hinting engine contributed by Adobe.</p> 1317</td></tr> 1318</table> 1319 1320<h4>since</h4> 1321 1322<p>2.9</p> 1323<hr> 1324 1325<h2 id="hinting-engine">hinting-engine<a class="headerlink" href="#hinting-engine" title="Permanent link">¶</a></h2> 1326<p>Thanks to Adobe, which contributed a new hinting (and parsing) engine, an application can select between ‘freetype’ and ‘adobe’ if compiled with <code>CFF_CONFIG_OPTION_OLD_ENGINE</code>. If this configuration macro isn't defined, ‘hinting-engine’ does nothing.</p> 1327<p>The same holds for the Type 1 and CID modules if compiled with <code>T1_CONFIG_OPTION_OLD_ENGINE</code>.</p> 1328<p>For the ‘cff’ module, the default engine is ‘freetype’ if <code>CFF_CONFIG_OPTION_OLD_ENGINE</code> is defined, and ‘adobe’ otherwise.</p> 1329<p>For both the ‘type1’ and ‘t1cid’ modules, the default engine is ‘freetype’ if <code>T1_CONFIG_OPTION_OLD_ENGINE</code> is defined, and ‘adobe’ otherwise.</p> 1330<h4>note</h4> 1331 1332<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1333<p>This property can be set via the <code>FREETYPE_PROPERTIES</code> environment variable (using values ‘adobe’ or ‘freetype’).</p> 1334<h4>example</h4> 1335 1336<p>The following example code demonstrates how to select Adobe's hinting engine for the ‘cff’ module (omitting the error handling). 1337<div class="highlight"><pre><span></span><code> FT_Library library; 1338 FT_UInt hinting_engine = FT_HINTING_ADOBE; 1339 1340 1341 FT_Init_FreeType( &library ); 1342 1343 FT_Property_Set( library, "cff", 1344 "hinting-engine", &hinting_engine ); 1345</code></pre></div></p> 1346<h4>since</h4> 1347 1348<p>2.4.12 (for ‘cff’ module)</p> 1349<p>2.9 (for ‘type1’ and ‘t1cid’ modules)</p> 1350<hr> 1351 1352<h2 id="no-stem-darkening">no-stem-darkening<a class="headerlink" href="#no-stem-darkening" title="Permanent link">¶</a></h2> 1353<p>All glyphs that pass through the auto-hinter will be emboldened unless this property is set to TRUE. The same is true for the CFF, Type 1, and CID font modules if the ‘Adobe’ engine is selected (which is the default).</p> 1354<p>Stem darkening emboldens glyphs at smaller sizes to make them more readable on common low-DPI screens when using linear alpha blending and gamma correction, see <code><a href="ft2-base_interface.html#ft_render_glyph">FT_Render_Glyph</a></code>. When not using linear alpha blending and gamma correction, glyphs will appear heavy and fuzzy!</p> 1355<p>Gamma correction essentially lightens fonts since shades of grey are shifted to higher pixel values (= higher brightness) to match the original intention to the reality of our screens. The side-effect is that glyphs ‘thin out’. Mac OS X and Adobe's proprietary font rendering library implement a counter-measure: stem darkening at smaller sizes where shades of gray dominate. By emboldening a glyph slightly in relation to its pixel size, individual pixels get higher coverage of filled-in outlines and are therefore ‘blacker’. This counteracts the ‘thinning out’ of glyphs, making text remain readable at smaller sizes.</p> 1356<p>For the auto-hinter, stem-darkening is experimental currently and thus switched off by default (this is, <code>no-stem-darkening</code> is set to TRUE by default). Total consistency with the CFF driver is not achieved right now because the emboldening method differs and glyphs must be scaled down on the Y-axis to keep outline points inside their precomputed blue zones. The smaller the size (especially 9ppem and down), the higher the loss of emboldening versus the CFF driver.</p> 1357<p>Note that stem darkening is never applied if <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_SCALE</a></code> is set.</p> 1358<h4>note</h4> 1359 1360<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1361<p>This property can be set via the <code>FREETYPE_PROPERTIES</code> environment variable (using values 1 and 0 for ‘on’ and ‘off’, respectively). It can also be set per face using <code><a href="ft2-base_interface.html#ft_face_properties">FT_Face_Properties</a></code> with <code><a href="ft2-parameter_tags.html#ft_param_tag_stem_darkening">FT_PARAM_TAG_STEM_DARKENING</a></code>.</p> 1362<h4>example</h4> 1363 1364<div class="highlight"><pre><span></span><code> FT_Library library; 1365 FT_Bool no_stem_darkening = TRUE; 1366 1367 1368 FT_Init_FreeType( &library ); 1369 1370 FT_Property_Set( library, "cff", 1371 "no-stem-darkening", &no_stem_darkening ); 1372</code></pre></div> 1373 1374<h4>since</h4> 1375 1376<p>2.4.12 (for ‘cff’ module)</p> 1377<p>2.6.2 (for ‘autofitter’ module)</p> 1378<p>2.9 (for ‘type1’ and ‘t1cid’ modules)</p> 1379<hr> 1380 1381<h2 id="darkening-parameters">darkening-parameters<a class="headerlink" href="#darkening-parameters" title="Permanent link">¶</a></h2> 1382<p>By default, the Adobe hinting engine, as used by the CFF, Type 1, and CID font drivers, darkens stems as follows (if the <code>no-stem-darkening</code> property isn't set): 1383<div class="highlight"><pre><span></span><code> stem width <= 0.5px: darkening amount = 0.4px 1384 stem width = 1px: darkening amount = 0.275px 1385 stem width = 1.667px: darkening amount = 0.275px 1386 stem width >= 2.333px: darkening amount = 0px 1387</code></pre></div></p> 1388<p>and piecewise linear in-between. At configuration time, these four control points can be set with the macro <code>CFF_CONFIG_OPTION_DARKENING_PARAMETERS</code>; the CFF, Type 1, and CID drivers share these values. At runtime, the control points can be changed using the <code>darkening-parameters</code> property (see the example below that demonstrates this for the Type 1 driver).</p> 1389<p>The x values give the stem width, and the y values the darkening amount. The unit is 1000<sup>th</sup> of pixels. All coordinate values must be positive; the x values must be monotonically increasing; the y values must be monotonically decreasing and smaller than or equal to 500 (corresponding to half a pixel); the slope of each linear piece must be shallower than -1 (e.g., -.4).</p> 1390<p>The auto-hinter provides this property, too, as an experimental feature. See <code><a href="ft2-properties.html#no-stem-darkening">no-stem-darkening</a></code> for more.</p> 1391<h4>note</h4> 1392 1393<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1394<p>This property can be set via the <code>FREETYPE_PROPERTIES</code> environment variable, using eight comma-separated integers without spaces. Here the above example, using <code>\</code> to break the line for readability. 1395<div class="highlight"><pre><span></span><code> FREETYPE_PROPERTIES=\ 1396 type1:darkening-parameters=500,300,1000,200,1500,100,2000,0 1397</code></pre></div></p> 1398<h4>example</h4> 1399 1400<div class="highlight"><pre><span></span><code> FT_Library library; 1401 FT_Int darken_params[8] = { 500, 300, // x1, y1 1402 1000, 200, // x2, y2 1403 1500, 100, // x3, y3 1404 2000, 0 }; // x4, y4 1405 1406 1407 FT_Init_FreeType( &library ); 1408 1409 FT_Property_Set( library, "type1", 1410 "darkening-parameters", darken_params ); 1411</code></pre></div> 1412 1413<h4>since</h4> 1414 1415<p>2.5.1 (for ‘cff’ module)</p> 1416<p>2.6.2 (for ‘autofitter’ module)</p> 1417<p>2.9 (for ‘type1’ and ‘t1cid’ modules)</p> 1418<hr> 1419 1420<h2 id="random-seed">random-seed<a class="headerlink" href="#random-seed" title="Permanent link">¶</a></h2> 1421<p>By default, the seed value for the CFF ‘random’ operator and the similar ‘0 28 callothersubr pop’ command for the Type 1 and CID drivers is set to a random value. However, mainly for debugging purposes, it is often necessary to use a known value as a seed so that the pseudo-random number sequences generated by ‘random’ are repeatable.</p> 1422<p>The <code>random-seed</code> property does that. Its argument is a signed 32bit integer; if the value is zero or negative, the seed given by the <code>intitialRandomSeed</code> private DICT operator in a CFF file gets used (or a default value if there is no such operator). If the value is positive, use it instead of <code>initialRandomSeed</code>, which is consequently ignored.</p> 1423<h4>note</h4> 1424 1425<p>This property can be set via the <code>FREETYPE_PROPERTIES</code> environment variable. It can also be set per face using <code><a href="ft2-base_interface.html#ft_face_properties">FT_Face_Properties</a></code> with <code><a href="ft2-parameter_tags.html#ft_param_tag_random_seed">FT_PARAM_TAG_RANDOM_SEED</a></code>.</p> 1426<h4>since</h4> 1427 1428<p>2.8 (for ‘cff’ module)</p> 1429<p>2.9 (for ‘type1’ and ‘t1cid’ modules)</p> 1430<hr> 1431 1432<h2 id="no-long-family-names">no-long-family-names<a class="headerlink" href="#no-long-family-names" title="Permanent link">¶</a></h2> 1433<p>If <code>PCF_CONFIG_OPTION_LONG_FAMILY_NAMES</code> is active while compiling FreeType, the PCF driver constructs long family names.</p> 1434<p>There are many PCF fonts just called ‘Fixed’ which look completely different, and which have nothing to do with each other. When selecting ‘Fixed’ in KDE or Gnome one gets results that appear rather random, the style changes often if one changes the size and one cannot select some fonts at all. The improve this situation, the PCF module prepends the foundry name (plus a space) to the family name. It also checks whether there are ‘wide’ characters; all put together, family names like ‘Sony Fixed’ or ‘Misc Fixed Wide’ are constructed.</p> 1435<p>If <code>no-long-family-names</code> is set, this feature gets switched off.</p> 1436<h4>note</h4> 1437 1438<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1439<p>This property can be set via the <code>FREETYPE_PROPERTIES</code> environment variable (using values 1 and 0 for ‘on’ and ‘off’, respectively).</p> 1440<h4>example</h4> 1441 1442<div class="highlight"><pre><span></span><code> FT_Library library; 1443 FT_Bool no_long_family_names = TRUE; 1444 1445 1446 FT_Init_FreeType( &library ); 1447 1448 FT_Property_Set( library, "pcf", 1449 "no-long-family-names", 1450 &no_long_family_names ); 1451</code></pre></div> 1452 1453<h4>since</h4> 1454 1455<p>2.8</p> 1456<hr> 1457 1458<h2 id="tt_interpreter_version_xxx">TT_INTERPRETER_VERSION_XXX<a class="headerlink" href="#tt_interpreter_version_xxx" title="Permanent link">¶</a></h2> 1459<p>Defined in FT_DRIVER_H (freetype/ftdriver.h).</p> 1460<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-properties.html#tt_interpreter_version_35">TT_INTERPRETER_VERSION_35</a> 35 1461#<span class="keyword">define</span> <a href="ft2-properties.html#tt_interpreter_version_38">TT_INTERPRETER_VERSION_38</a> 38 1462#<span class="keyword">define</span> <a href="ft2-properties.html#tt_interpreter_version_40">TT_INTERPRETER_VERSION_40</a> 40 1463</code></pre></div> 1464 1465<p>A list of constants used for the <code><a href="ft2-properties.html#interpreter-version">interpreter-version</a></code> property to select the hinting engine for Truetype fonts.</p> 1466<p>The numeric value in the constant names represents the version number as returned by the ‘GETINFO’ bytecode instruction.</p> 1467<h4>values</h4> 1468 1469<table class="fields"> 1470<tr><td class="val" id="tt_interpreter_version_35">TT_INTERPRETER_VERSION_35</td><td class="desc"> 1471<p>Version 35 corresponds to MS rasterizer v.1.7 as used e.g. in Windows 98; only grayscale and B/W rasterizing is supported.</p> 1472</td></tr> 1473<tr><td class="val" id="tt_interpreter_version_38">TT_INTERPRETER_VERSION_38</td><td class="desc"> 1474<p>Version 38 corresponds to MS rasterizer v.1.9; it is roughly equivalent to the hinting provided by DirectWrite ClearType (as can be found, for example, in the Internet Explorer 9 running on Windows 7). It is used in FreeType to select the ‘Infinality’ subpixel hinting code. The code may be removed in a future version.</p> 1475</td></tr> 1476<tr><td class="val" id="tt_interpreter_version_40">TT_INTERPRETER_VERSION_40</td><td class="desc"> 1477<p>Version 40 corresponds to MS rasterizer v.2.1; it is roughly equivalent to the hinting provided by DirectWrite ClearType (as can be found, for example, in Microsoft's Edge Browser on Windows 10). It is used in FreeType to select the ‘minimal’ subpixel hinting code, a stripped-down and higher performance version of the ‘Infinality’ code.</p> 1478</td></tr> 1479</table> 1480 1481<h4>note</h4> 1482 1483<p>This property controls the behaviour of the bytecode interpreter and thus how outlines get hinted. It does <strong>not</strong> control how glyph get rasterized! In particular, it does not control subpixel color filtering.</p> 1484<p>If FreeType has not been compiled with the configuration option <code>TT_CONFIG_OPTION_SUBPIXEL_HINTING</code>, selecting version 38 or 40 causes an <code>FT_Err_Unimplemented_Feature</code> error.</p> 1485<p>Depending on the graphics framework, Microsoft uses different bytecode and rendering engines. As a consequence, the version numbers returned by a call to the ‘GETINFO’ bytecode instruction are more convoluted than desired.</p> 1486<p>Here are two tables that try to shed some light on the possible values for the MS rasterizer engine, together with the additional features introduced by it. 1487<div class="highlight"><pre><span></span><code> GETINFO framework version feature 1488 ------------------------------------------------------------------- 1489 3 GDI (Win 3.1), v1.0 16-bit, first version 1490 TrueImage 1491 33 GDI (Win NT 3.1), v1.5 32-bit 1492 HP Laserjet 1493 34 GDI (Win 95) v1.6 font smoothing, 1494 new SCANTYPE opcode 1495 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET 1496 bits in composite glyphs 1497 36 MGDI (Win CE 2) v1.6+ classic ClearType 1498 37 GDI (XP and later), v1.8 ClearType 1499 GDI+ old (before Vista) 1500 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType, 1501 WPF Y-direction ClearType, 1502 additional error checking 1503 39 DWrite (before Win 8) v2.0 subpixel ClearType flags 1504 in GETINFO opcode, 1505 bug fixes 1506 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag 1507 DWrite (Win 8) in GETINFO opcode, 1508 Gray ClearType 1509</code></pre></div></p> 1510<p>The ‘version’ field gives a rough orientation only, since some applications provided certain features much earlier (as an example, Microsoft Reader used subpixel and Y-direction ClearType already in Windows 2000). Similarly, updates to a given framework might include improved hinting support. 1511<div class="highlight"><pre><span></span><code> version sampling rendering comment 1512 x y x y 1513 -------------------------------------------------------------- 1514 v1.0 normal normal B/W B/W bi-level 1515 v1.6 high high gray gray grayscale 1516 v1.8 high normal color-filter B/W (GDI) ClearType 1517 v1.9 high high color-filter gray Color ClearType 1518 v2.1 high normal gray B/W Gray ClearType 1519 v2.1 high high gray gray Gray ClearType 1520</code></pre></div></p> 1521<p>Color and Gray ClearType are the two available variants of ‘Y-direction ClearType’, meaning grayscale rasterization along the Y-direction; the name used in the TrueType specification for this feature is ‘symmetric smoothing’. ‘Classic ClearType’ is the original algorithm used before introducing a modified version in Win XP. Another name for v1.6's grayscale rendering is ‘font smoothing’, and ‘Color ClearType’ is sometimes also called ‘DWrite ClearType’. To differentiate between today's Color ClearType and the earlier ClearType variant with B/W rendering along the vertical axis, the latter is sometimes called ‘GDI ClearType’.</p> 1522<p>‘Normal’ and ‘high’ sampling describe the (virtual) resolution to access the rasterized outline after the hinting process. ‘Normal’ means 1 sample per grid line (i.e., B/W). In the current Microsoft implementation, ‘high’ means an extra virtual resolution of 16x16 (or 16x1) grid lines per pixel for bytecode instructions like ‘MIRP’. After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid lines for color filtering if Color ClearType is activated.</p> 1523<p>Note that ‘Gray ClearType’ is essentially the same as v1.6's grayscale rendering. However, the GETINFO instruction handles it differently: v1.6 returns bit 12 (hinting for grayscale), while v2.1 returns bits 13 (hinting for ClearType), 18 (symmetrical smoothing), and 19 (Gray ClearType). Also, this mode respects bits 2 and 3 for the version 1 gasp table exclusively (like Color ClearType), while v1.6 only respects the values of version 0 (bits 0 and 1).</p> 1524<p>Keep in mind that the features of the above interpreter versions might not map exactly to FreeType features or behavior because it is a fundamentally different library with different internals.</p> 1525<hr> 1526 1527<h2 id="interpreter-version">interpreter-version<a class="headerlink" href="#interpreter-version" title="Permanent link">¶</a></h2> 1528<p>Currently, three versions are available, two representing the bytecode interpreter with subpixel hinting support (old ‘Infinality’ code and new stripped-down and higher performance ‘minimal’ code) and one without, respectively. The default is subpixel support if <code>TT_CONFIG_OPTION_SUBPIXEL_HINTING</code> is defined, and no subpixel support otherwise (since it isn't available then).</p> 1529<p>If subpixel hinting is on, many TrueType bytecode instructions behave differently compared to B/W or grayscale rendering (except if ‘native ClearType’ is selected by the font). Microsoft's main idea is to render at a much increased horizontal resolution, then sampling down the created output to subpixel precision. However, many older fonts are not suited to this and must be specially taken care of by applying (hardcoded) tweaks in Microsoft's interpreter.</p> 1530<p>Details on subpixel hinting and some of the necessary tweaks can be found in Greg Hitchcock's whitepaper at ‘<a href="https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx">https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx</a>’. Note that FreeType currently doesn't really ‘subpixel hint’ (6x1, 6x2, or 6x5 supersampling) like discussed in the paper. Depending on the chosen interpreter, it simply ignores instructions on vertical stems to arrive at very similar results.</p> 1531<h4>note</h4> 1532 1533<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1534<p>This property can be set via the <code>FREETYPE_PROPERTIES</code> environment variable (using values ‘35’, ‘38’, or ‘40’).</p> 1535<h4>example</h4> 1536 1537<p>The following example code demonstrates how to deactivate subpixel hinting (omitting the error handling). 1538<div class="highlight"><pre><span></span><code> FT_Library library; 1539 FT_Face face; 1540 FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35; 1541 1542 1543 FT_Init_FreeType( &library ); 1544 1545 FT_Property_Set( library, "truetype", 1546 "interpreter-version", 1547 &interpreter_version ); 1548</code></pre></div></p> 1549<h4>since</h4> 1550 1551<p>2.5</p> 1552<hr> 1553 1554<h2 id="glyph-to-script-map">glyph-to-script-map<a class="headerlink" href="#glyph-to-script-map" title="Permanent link">¶</a></h2> 1555<p><strong>Experimental only</strong></p> 1556<p>The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below.</p> 1557<p>OpenType fonts, however, often provide much more glyphs than character codes (small caps, superscripts, ligatures, swashes, etc.), to be controlled by so-called ‘features’. Handling OpenType features can be quite complicated and thus needs a separate library on top of FreeType.</p> 1558<p>The mapping between glyph indices and scripts (in the auto-hinter sense, see the <code><a href="ft2-properties.html#ft_autohinter_script_xxx">FT_AUTOHINTER_SCRIPT_XXX</a></code> values) is stored as an array with <code>num_glyphs</code> elements, as found in the font's <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> structure. The <code>glyph-to-script-map</code> property returns a pointer to this array, which can be modified as needed. Note that the modification should happen before the first glyph gets processed by the auto-hinter so that the global analysis of the font shapes actually uses the modified mapping.</p> 1559<h4>example</h4> 1560 1561<p>The following example code demonstrates how to access it (omitting the error handling). 1562<div class="highlight"><pre><span></span><code> FT_Library library; 1563 FT_Face face; 1564 FT_Prop_GlyphToScriptMap prop; 1565 1566 1567 FT_Init_FreeType( &library ); 1568 FT_New_Face( library, "foo.ttf", 0, &face ); 1569 1570 prop.face = face; 1571 1572 FT_Property_Get( library, "autofitter", 1573 "glyph-to-script-map", &prop ); 1574 1575 // adjust `prop.map' as needed right here 1576 1577 FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT ); 1578</code></pre></div></p> 1579<h4>since</h4> 1580 1581<p>2.4.11</p> 1582<hr> 1583 1584<h2 id="ft_autohinter_script_xxx">FT_AUTOHINTER_SCRIPT_XXX<a class="headerlink" href="#ft_autohinter_script_xxx" title="Permanent link">¶</a></h2> 1585<p>Defined in FT_DRIVER_H (freetype/ftdriver.h).</p> 1586<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-properties.html#ft_autohinter_script_none">FT_AUTOHINTER_SCRIPT_NONE</a> 0 1587#<span class="keyword">define</span> <a href="ft2-properties.html#ft_autohinter_script_latin">FT_AUTOHINTER_SCRIPT_LATIN</a> 1 1588#<span class="keyword">define</span> <a href="ft2-properties.html#ft_autohinter_script_cjk">FT_AUTOHINTER_SCRIPT_CJK</a> 2 1589#<span class="keyword">define</span> <a href="ft2-properties.html#ft_autohinter_script_indic">FT_AUTOHINTER_SCRIPT_INDIC</a> 3 1590</code></pre></div> 1591 1592<p><strong>Experimental only</strong></p> 1593<p>A list of constants used for the <code><a href="ft2-properties.html#glyph-to-script-map">glyph-to-script-map</a></code> property to specify the script submodule the auto-hinter should use for hinting a particular glyph.</p> 1594<h4>values</h4> 1595 1596<table class="fields long"> 1597<tr><td class="val" id="ft_autohinter_script_none">FT_AUTOHINTER_SCRIPT_NONE</td><td class="desc"> 1598<p>Don't auto-hint this glyph.</p> 1599</td></tr> 1600<tr><td class="val" id="ft_autohinter_script_latin">FT_AUTOHINTER_SCRIPT_LATIN</td><td class="desc"> 1601<p>Apply the latin auto-hinter. For the auto-hinter, ‘latin’ is a very broad term, including Cyrillic and Greek also since characters from those scripts share the same design constraints.</p> 1602<p>By default, characters from the following Unicode ranges are assigned to this submodule.</p> 1603<pre><code> U+0020 - U+007F // Basic Latin (no control characters) 1604 U+00A0 - U+00FF // Latin-1 Supplement (no control characters) 1605 U+0100 - U+017F // Latin Extended-A 1606 U+0180 - U+024F // Latin Extended-B 1607 U+0250 - U+02AF // IPA Extensions 1608 U+02B0 - U+02FF // Spacing Modifier Letters 1609 U+0300 - U+036F // Combining Diacritical Marks 1610 U+0370 - U+03FF // Greek and Coptic 1611 U+0400 - U+04FF // Cyrillic 1612 U+0500 - U+052F // Cyrillic Supplement 1613 U+1D00 - U+1D7F // Phonetic Extensions 1614 U+1D80 - U+1DBF // Phonetic Extensions Supplement 1615 U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement 1616 U+1E00 - U+1EFF // Latin Extended Additional 1617 U+1F00 - U+1FFF // Greek Extended 1618 U+2000 - U+206F // General Punctuation 1619 U+2070 - U+209F // Superscripts and Subscripts 1620 U+20A0 - U+20CF // Currency Symbols 1621 U+2150 - U+218F // Number Forms 1622 U+2460 - U+24FF // Enclosed Alphanumerics 1623 U+2C60 - U+2C7F // Latin Extended-C 1624 U+2DE0 - U+2DFF // Cyrillic Extended-A 1625 U+2E00 - U+2E7F // Supplemental Punctuation 1626 U+A640 - U+A69F // Cyrillic Extended-B 1627 U+A720 - U+A7FF // Latin Extended-D 1628 U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures) 1629 U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols 1630 U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement 1631</code></pre> 1632</td></tr> 1633<tr><td class="val" id="ft_autohinter_script_cjk">FT_AUTOHINTER_SCRIPT_CJK</td><td class="desc"> 1634<p>Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old Vietnamese, and some other scripts.</p> 1635<p>By default, characters from the following Unicode ranges are assigned to this submodule.</p> 1636<pre><code> U+1100 - U+11FF // Hangul Jamo 1637 U+2E80 - U+2EFF // CJK Radicals Supplement 1638 U+2F00 - U+2FDF // Kangxi Radicals 1639 U+2FF0 - U+2FFF // Ideographic Description Characters 1640 U+3000 - U+303F // CJK Symbols and Punctuation 1641 U+3040 - U+309F // Hiragana 1642 U+30A0 - U+30FF // Katakana 1643 U+3100 - U+312F // Bopomofo 1644 U+3130 - U+318F // Hangul Compatibility Jamo 1645 U+3190 - U+319F // Kanbun 1646 U+31A0 - U+31BF // Bopomofo Extended 1647 U+31C0 - U+31EF // CJK Strokes 1648 U+31F0 - U+31FF // Katakana Phonetic Extensions 1649 U+3200 - U+32FF // Enclosed CJK Letters and Months 1650 U+3300 - U+33FF // CJK Compatibility 1651 U+3400 - U+4DBF // CJK Unified Ideographs Extension A 1652 U+4DC0 - U+4DFF // Yijing Hexagram Symbols 1653 U+4E00 - U+9FFF // CJK Unified Ideographs 1654 U+A960 - U+A97F // Hangul Jamo Extended-A 1655 U+AC00 - U+D7AF // Hangul Syllables 1656 U+D7B0 - U+D7FF // Hangul Jamo Extended-B 1657 U+F900 - U+FAFF // CJK Compatibility Ideographs 1658 U+FE10 - U+FE1F // Vertical forms 1659 U+FE30 - U+FE4F // CJK Compatibility Forms 1660 U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms 1661 U+1B000 - U+1B0FF // Kana Supplement 1662 U+1D300 - U+1D35F // Tai Xuan Hing Symbols 1663 U+1F200 - U+1F2FF // Enclosed Ideographic Supplement 1664 U+20000 - U+2A6DF // CJK Unified Ideographs Extension B 1665 U+2A700 - U+2B73F // CJK Unified Ideographs Extension C 1666 U+2B740 - U+2B81F // CJK Unified Ideographs Extension D 1667 U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement 1668</code></pre> 1669</td></tr> 1670<tr><td class="val" id="ft_autohinter_script_indic">FT_AUTOHINTER_SCRIPT_INDIC</td><td class="desc"> 1671<p>Apply the indic auto-hinter, covering all major scripts from the Indian sub-continent and some other related scripts like Thai, Lao, or Tibetan.</p> 1672<p>By default, characters from the following Unicode ranges are assigned to this submodule.</p> 1673<pre><code> U+0900 - U+0DFF // Indic Range 1674 U+0F00 - U+0FFF // Tibetan 1675 U+1900 - U+194F // Limbu 1676 U+1B80 - U+1BBF // Sundanese 1677 U+A800 - U+A82F // Syloti Nagri 1678 U+ABC0 - U+ABFF // Meetei Mayek 1679 U+11800 - U+118DF // Sharada 1680</code></pre> 1681<p>Note that currently Indic support is rudimentary only, missing blue zone support.</p> 1682</td></tr> 1683</table> 1684 1685<h4>since</h4> 1686 1687<p>2.4.11</p> 1688<hr> 1689 1690<h2 id="ft_prop_glyphtoscriptmap">FT_Prop_GlyphToScriptMap<a class="headerlink" href="#ft_prop_glyphtoscriptmap" title="Permanent link">¶</a></h2> 1691<p>Defined in FT_DRIVER_H (freetype/ftdriver.h).</p> 1692<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Prop_GlyphToScriptMap_ 1693 { 1694 <a href="ft2-base_interface.html#ft_face">FT_Face</a> face; 1695 <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a>* map; 1696 1697 } <b>FT_Prop_GlyphToScriptMap</b>; 1698</code></pre></div> 1699 1700<p><strong>Experimental only</strong></p> 1701<p>The data exchange structure for the <code><a href="ft2-properties.html#glyph-to-script-map">glyph-to-script-map</a></code> property.</p> 1702<h4>since</h4> 1703 1704<p>2.4.11</p> 1705<hr> 1706 1707<h2 id="fallback-script">fallback-script<a class="headerlink" href="#fallback-script" title="Permanent link">¶</a></h2> 1708<p><strong>Experimental only</strong></p> 1709<p>If no auto-hinter script module can be assigned to a glyph, a fallback script gets assigned to it (see also the <code><a href="ft2-properties.html#glyph-to-script-map">glyph-to-script-map</a></code> property). By default, this is <code><a href="ft2-properties.html#ft_autohinter_script_xxx">FT_AUTOHINTER_SCRIPT_CJK</a></code>. Using the <code>fallback-script</code> property, this fallback value can be changed.</p> 1710<h4>note</h4> 1711 1712<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1713<p>It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the fallback script value gets triggered either by setting or reading a face-specific property like <code><a href="ft2-properties.html#glyph-to-script-map">glyph-to-script-map</a></code>, or by auto-hinting any glyph from that face. In particular, if you have already created an <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> structure but not loaded any glyph (using the auto-hinter), a change of the fallback script will affect this face.</p> 1714<h4>example</h4> 1715 1716<div class="highlight"><pre><span></span><code> FT_Library library; 1717 FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE; 1718 1719 1720 FT_Init_FreeType( &library ); 1721 1722 FT_Property_Set( library, "autofitter", 1723 "fallback-script", &fallback_script ); 1724</code></pre></div> 1725 1726<h4>since</h4> 1727 1728<p>2.4.11</p> 1729<hr> 1730 1731<h2 id="default-script">default-script<a class="headerlink" href="#default-script" title="Permanent link">¶</a></h2> 1732<p><strong>Experimental only</strong></p> 1733<p>If FreeType gets compiled with <code>FT_CONFIG_OPTION_USE_HARFBUZZ</code> to make the HarfBuzz library access OpenType features for getting better glyph coverages, this property sets the (auto-fitter) script to be used for the default (OpenType) script data of a font's GSUB table. Features for the default script are intended for all scripts not explicitly handled in GSUB; an example is a ‘dlig’ feature, containing the combination of the characters ‘T’, ‘E’, and ‘L’ to form a ‘TEL’ ligature.</p> 1734<p>By default, this is <code><a href="ft2-properties.html#ft_autohinter_script_xxx">FT_AUTOHINTER_SCRIPT_LATIN</a></code>. Using the <code>default-script</code> property, this default value can be changed.</p> 1735<h4>note</h4> 1736 1737<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1738<p>It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the default script value gets triggered either by setting or reading a face-specific property like <code><a href="ft2-properties.html#glyph-to-script-map">glyph-to-script-map</a></code>, or by auto-hinting any glyph from that face. In particular, if you have already created an <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> structure but not loaded any glyph (using the auto-hinter), a change of the default script will affect this face.</p> 1739<h4>example</h4> 1740 1741<div class="highlight"><pre><span></span><code> FT_Library library; 1742 FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE; 1743 1744 1745 FT_Init_FreeType( &library ); 1746 1747 FT_Property_Set( library, "autofitter", 1748 "default-script", &default_script ); 1749</code></pre></div> 1750 1751<h4>since</h4> 1752 1753<p>2.5.3</p> 1754<hr> 1755 1756<h2 id="increase-x-height">increase-x-height<a class="headerlink" href="#increase-x-height" title="Permanent link">¶</a></h2> 1757<p>For ppem values in the range 6 <= ppem <= <code>increase-x-height</code>, round up the font's x height much more often than normally. If the value is set to 0, which is the default, this feature is switched off. Use this property to improve the legibility of small font sizes if necessary.</p> 1758<h4>note</h4> 1759 1760<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1761<p>Set this value right after calling <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code>, but before loading any glyph (using the auto-hinter).</p> 1762<h4>example</h4> 1763 1764<div class="highlight"><pre><span></span><code> FT_Library library; 1765 FT_Face face; 1766 FT_Prop_IncreaseXHeight prop; 1767 1768 1769 FT_Init_FreeType( &library ); 1770 FT_New_Face( library, "foo.ttf", 0, &face ); 1771 FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 ); 1772 1773 prop.face = face; 1774 prop.limit = 14; 1775 1776 FT_Property_Set( library, "autofitter", 1777 "increase-x-height", &prop ); 1778</code></pre></div> 1779 1780<h4>since</h4> 1781 1782<p>2.4.11</p> 1783<hr> 1784 1785<h2 id="ft_prop_increasexheight">FT_Prop_IncreaseXHeight<a class="headerlink" href="#ft_prop_increasexheight" title="Permanent link">¶</a></h2> 1786<p>Defined in FT_DRIVER_H (freetype/ftdriver.h).</p> 1787<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Prop_IncreaseXHeight_ 1788 { 1789 <a href="ft2-base_interface.html#ft_face">FT_Face</a> face; 1790 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> limit; 1791 1792 } <b>FT_Prop_IncreaseXHeight</b>; 1793</code></pre></div> 1794 1795<p>The data exchange structure for the <code><a href="ft2-properties.html#increase-x-height">increase-x-height</a></code> property.</p> 1796<hr> 1797 1798<h2 id="warping">warping<a class="headerlink" href="#warping" title="Permanent link">¶</a></h2> 1799<p><strong>Experimental only</strong></p> 1800<p>If FreeType gets compiled with option <code>AF_CONFIG_OPTION_USE_WARPER</code> to activate the warp hinting code in the auto-hinter, this property switches warping on and off.</p> 1801<p>Warping only works in ‘normal’ auto-hinting mode replacing it. The idea of the code is to slightly scale and shift a glyph along the non-hinted dimension (which is usually the horizontal axis) so that as much of its segments are aligned (more or less) to the grid. To find out a glyph's optimal scaling and shifting value, various parameter combinations are tried and scored.</p> 1802<p>By default, warping is off.</p> 1803<h4>note</h4> 1804 1805<p>This property can be used with <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code> also.</p> 1806<p>This property can be set via the <code>FREETYPE_PROPERTIES</code> environment variable (using values 1 and 0 for ‘on’ and ‘off’, respectively).</p> 1807<p>The warping code can also change advance widths. Have a look at the <code>lsb_delta</code> and <code>rsb_delta</code> fields in the <code><a href="ft2-base_interface.html#ft_glyphslotrec">FT_GlyphSlotRec</a></code> structure for details on improving inter-glyph distances while rendering.</p> 1808<p>Since warping is a global property of the auto-hinter it is best to change its value before rendering any face. Otherwise, you should reload all faces that get auto-hinted in ‘normal’ hinting mode.</p> 1809<h4>example</h4> 1810 1811<p>This example shows how to switch on warping (omitting the error handling). 1812<div class="highlight"><pre><span></span><code> FT_Library library; 1813 FT_Bool warping = 1; 1814 1815 1816 FT_Init_FreeType( &library ); 1817 1818 FT_Property_Set( library, "autofitter", "warping", &warping ); 1819</code></pre></div></p> 1820<h4>since</h4> 1821 1822<p>2.6</p> 1823<hr> 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 </article> 1835 </div> 1836 </div> 1837 </main> 1838 1839 1840<footer class="md-footer"> 1841 1842 <div class="md-footer-nav"> 1843 <nav class="md-footer-nav__inner md-grid"> 1844 1845 <a href="ft2-pcf_driver.html" title="The PCF driver" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> 1846 <div class="md-flex__cell md-flex__cell--shrink"> 1847 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> 1848 </div> 1849 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> 1850 <span class="md-flex__ellipsis"> 1851 <span class="md-footer-nav__direction"> 1852 Previous 1853 </span> 1854 The PCF driver 1855 </span> 1856 </div> 1857 </a> 1858 1859 1860 <a href="ft2-parameter_tags.html" title="Parameter Tags" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> 1861 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> 1862 <span class="md-flex__ellipsis"> 1863 <span class="md-footer-nav__direction"> 1864 Next 1865 </span> 1866 Parameter Tags 1867 </span> 1868 </div> 1869 <div class="md-flex__cell md-flex__cell--shrink"> 1870 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> 1871 </div> 1872 </a> 1873 1874 </nav> 1875 </div> 1876 1877 <div class="md-footer-meta md-typeset"> 1878 <div class="md-footer-meta__inner md-grid"> 1879 <div class="md-footer-copyright"> 1880 1881 <div class="md-footer-copyright__highlight"> 1882 Copyright 2020 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>. 1883 </div> 1884 1885 powered by 1886 <a href="https://www.mkdocs.org" target="_blank" rel="noopener">MkDocs</a> 1887 and 1888 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> 1889 Material for MkDocs</a> 1890 </div> 1891 1892 </div> 1893 </div> 1894</footer> 1895 1896 </div> 1897 1898 <script src="assets/javascripts/application.c33a9706.js"></script> 1899 1900 <script>app.initialize({version:"1.1",url:{base:"."}})</script> 1901 1902 <script src="javascripts/extra.js"></script> 1903 1904 1905 </body> 1906</html>