6 <html lang="en" class="no-js">
10 <meta name="viewport" content="width=device-width,initial-scale=1">
11 <meta http-equiv="x-ua-compatible" content="ie=edge">
13 <meta name="description" content="API Reference Documentation for FreeType-2.10.1">
17 <meta name="author" content="FreeType Contributors">
20 <meta name="lang:clipboard.copy" content="Copy to clipboard">
22 <meta name="lang:clipboard.copied" content="Copied to clipboard">
24 <meta name="lang:search.language" content="en">
26 <meta name="lang:search.pipeline.stopwords" content="True">
28 <meta name="lang:search.pipeline.trimmer" content="True">
30 <meta name="lang:search.result.none" content="No matching documents">
32 <meta name="lang:search.result.one" content="1 matching document">
34 <meta name="lang:search.result.other" content="# matching documents">
36 <meta name="lang:search.tokenizer" content="[\s\-]+">
38 <link rel="shortcut icon" href="images/favico.ico">
39 <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.0.2">
43 <title>The CFF driver - FreeType-2.10.1 API Reference</title>
47 <link rel="stylesheet" href="assets/stylesheets/application.982221ab.css">
49 <link rel="stylesheet" href="assets/stylesheets/application-palette.224b79ff.css">
54 <meta name="theme-color" content="#4caf50">
58 <script src="assets/javascripts/modernizr.1f0bcf2b.js"></script>
62 <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
63 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,400,400i,700|Roboto+Mono">
64 <style>body,input{font-family:"Noto Serif","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
67 <link rel="stylesheet" href="assets/fonts/material-icons.css">
70 <link rel="stylesheet" href="stylesheets/extra.css">
80 <body dir="ltr" data-md-color-primary="green" data-md-color-accent="green">
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>
92 <a href="#the-cff-driver" tabindex="1" class="md-skip">
97 <header class="md-header" data-md-component="header">
98 <nav class="md-header-nav md-grid">
100 <div class="md-flex__cell md-flex__cell--shrink">
101 <a href="index.html" title="FreeType-2.10.1 API Reference" class="md-header-nav__button md-logo">
103 <img src="images/favico.ico" width="24" height="24">
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>
110 <div class="md-flex__cell md-flex__cell--stretch">
111 <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
113 <span class="md-header-nav__topic">
114 FreeType-2.10.1 API Reference
116 <span class="md-header-nav__topic">
122 <div class="md-flex__cell md-flex__cell--shrink">
124 <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
126 <div class="md-search" data-md-component="search" role="dialog">
127 <label class="md-search__overlay" for="__search"></label>
128 <div class="md-search__inner" role="search">
129 <form class="md-search__form" name="search">
130 <input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
131 <label class="md-icon md-search__icon" for="__search"></label>
132 <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
136 <div class="md-search__output">
137 <div class="md-search__scrollwrap" data-md-scrollfix>
138 <div class="md-search-result" data-md-component="result">
139 <div class="md-search-result__meta">
140 Type to start searching
142 <ol class="md-search-result__list"></ol>
155 <div class="md-container">
160 <main class="md-main">
161 <div class="md-main__inner md-grid" data-md-component="container">
164 <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
165 <div class="md-sidebar__scrollwrap">
166 <div class="md-sidebar__inner">
167 <nav class="md-nav md-nav--primary" data-md-level="0">
168 <label class="md-nav__title md-nav__title--site" for="__drawer">
169 <a href="index.html" title="FreeType-2.10.1 API Reference" class="md-nav__button md-logo">
171 <img src="images/favico.ico" width="48" height="48">
174 FreeType-2.10.1 API Reference
177 <ul class="md-nav__list" data-md-scrollfix>
184 <li class="md-nav__item">
185 <a href="index.html" title="TOC" class="md-nav__link">
196 <li class="md-nav__item">
197 <a href="ft2-index.html" title="Index" class="md-nav__link">
208 <li class="md-nav__item md-nav__item--nested">
210 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
212 <label class="md-nav__link" for="nav-3">
215 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
216 <label class="md-nav__title" for="nav-3">
219 <ul class="md-nav__list" data-md-scrollfix>
227 <li class="md-nav__item">
228 <a href="ft2-header_inclusion.html" title="FreeType's header inclusion scheme" class="md-nav__link">
229 FreeType's header inclusion scheme
239 <li class="md-nav__item">
240 <a href="ft2-user_allocation.html" title="User allocation" class="md-nav__link">
256 <li class="md-nav__item md-nav__item--nested">
258 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
260 <label class="md-nav__link" for="nav-4">
263 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
264 <label class="md-nav__title" for="nav-4">
267 <ul class="md-nav__list" data-md-scrollfix>
275 <li class="md-nav__item">
276 <a href="ft2-version.html" title="FreeType Version" class="md-nav__link">
287 <li class="md-nav__item">
288 <a href="ft2-basic_types.html" title="Basic Data Types" class="md-nav__link">
299 <li class="md-nav__item">
300 <a href="ft2-base_interface.html" title="Base Interface" class="md-nav__link">
311 <li class="md-nav__item">
312 <a href="ft2-glyph_variants.html" title="Unicode Variation Sequences" class="md-nav__link">
313 Unicode Variation Sequences
323 <li class="md-nav__item">
324 <a href="ft2-color_management.html" title="Glyph Color Management" class="md-nav__link">
325 Glyph Color Management
335 <li class="md-nav__item">
336 <a href="ft2-layer_management.html" title="Glyph Layer Management" class="md-nav__link">
337 Glyph Layer Management
347 <li class="md-nav__item">
348 <a href="ft2-glyph_management.html" title="Glyph Management" class="md-nav__link">
359 <li class="md-nav__item">
360 <a href="ft2-mac_specific.html" title="Mac Specific Interface" class="md-nav__link">
361 Mac Specific Interface
371 <li class="md-nav__item">
372 <a href="ft2-sizes_management.html" title="Size Management" class="md-nav__link">
383 <li class="md-nav__item">
384 <a href="ft2-header_file_macros.html" title="Header File Macros" class="md-nav__link">
400 <li class="md-nav__item md-nav__item--nested">
402 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
404 <label class="md-nav__link" for="nav-5">
407 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
408 <label class="md-nav__title" for="nav-5">
411 <ul class="md-nav__list" data-md-scrollfix>
419 <li class="md-nav__item">
420 <a href="ft2-multiple_masters.html" title="Multiple Masters" class="md-nav__link">
431 <li class="md-nav__item">
432 <a href="ft2-truetype_tables.html" title="TrueType Tables" class="md-nav__link">
443 <li class="md-nav__item">
444 <a href="ft2-type1_tables.html" title="Type 1 Tables" class="md-nav__link">
455 <li class="md-nav__item">
456 <a href="ft2-sfnt_names.html" title="SFNT Names" class="md-nav__link">
467 <li class="md-nav__item">
468 <a href="ft2-bdf_fonts.html" title="BDF and PCF Files" class="md-nav__link">
479 <li class="md-nav__item">
480 <a href="ft2-cid_fonts.html" title="CID Fonts" class="md-nav__link">
491 <li class="md-nav__item">
492 <a href="ft2-pfr_fonts.html" title="PFR Fonts" class="md-nav__link">
503 <li class="md-nav__item">
504 <a href="ft2-winfnt_fonts.html" title="Window FNT Files" class="md-nav__link">
515 <li class="md-nav__item">
516 <a href="ft2-font_formats.html" title="Font Formats" class="md-nav__link">
527 <li class="md-nav__item">
528 <a href="ft2-gasp_table.html" title="Gasp Table" class="md-nav__link">
546 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
548 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6" checked>
550 <label class="md-nav__link" for="nav-6">
551 Controlling FreeType Modules
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
557 <ul class="md-nav__list" data-md-scrollfix>
565 <li class="md-nav__item">
566 <a href="ft2-auto_hinter.html" title="The auto-hinter" class="md-nav__link">
579 <li class="md-nav__item md-nav__item--active">
581 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
586 <label class="md-nav__link md-nav__link--active" for="__toc">
590 <a href="ft2-cff_driver.html" title="The CFF driver" class="md-nav__link md-nav__link--active">
595 <nav class="md-nav md-nav--secondary">
601 <label class="md-nav__title" for="__toc">Table of contents</label>
602 <ul class="md-nav__list" data-md-scrollfix>
604 <li class="md-nav__item">
605 <a href="#synopsis" title="Synopsis" class="md-nav__link">
627 <li class="md-nav__item">
628 <a href="ft2-t1_cid_driver.html" title="The Type 1 and CID drivers" class="md-nav__link">
629 The Type 1 and CID drivers
639 <li class="md-nav__item">
640 <a href="ft2-tt_driver.html" title="The TrueType driver" class="md-nav__link">
651 <li class="md-nav__item">
652 <a href="ft2-pcf_driver.html" title="The PCF driver" class="md-nav__link">
663 <li class="md-nav__item">
664 <a href="ft2-properties.html" title="Driver properties" class="md-nav__link">
675 <li class="md-nav__item">
676 <a href="ft2-parameter_tags.html" title="Parameter Tags" class="md-nav__link">
687 <li class="md-nav__item">
688 <a href="ft2-lcd_rendering.html" title="Subpixel Rendering" class="md-nav__link">
704 <li class="md-nav__item md-nav__item--nested">
706 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-7" type="checkbox" id="nav-7">
708 <label class="md-nav__link" for="nav-7">
711 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
712 <label class="md-nav__title" for="nav-7">
715 <ul class="md-nav__list" data-md-scrollfix>
723 <li class="md-nav__item">
724 <a href="ft2-cache_subsystem.html" title="Cache Sub-System" class="md-nav__link">
740 <li class="md-nav__item md-nav__item--nested">
742 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-8" type="checkbox" id="nav-8">
744 <label class="md-nav__link" for="nav-8">
747 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
748 <label class="md-nav__title" for="nav-8">
751 <ul class="md-nav__list" data-md-scrollfix>
759 <li class="md-nav__item">
760 <a href="ft2-computations.html" title="Computations" class="md-nav__link">
771 <li class="md-nav__item">
772 <a href="ft2-list_processing.html" title="List Processing" class="md-nav__link">
783 <li class="md-nav__item">
784 <a href="ft2-outline_processing.html" title="Outline Processing" class="md-nav__link">
795 <li class="md-nav__item">
796 <a href="ft2-quick_advance.html" title="Quick retrieval of advance values" class="md-nav__link">
797 Quick retrieval of advance values
807 <li class="md-nav__item">
808 <a href="ft2-bitmap_handling.html" title="Bitmap Handling" class="md-nav__link">
819 <li class="md-nav__item">
820 <a href="ft2-raster.html" title="Scanline Converter" class="md-nav__link">
831 <li class="md-nav__item">
832 <a href="ft2-glyph_stroker.html" title="Glyph Stroker" class="md-nav__link">
843 <li class="md-nav__item">
844 <a href="ft2-system_interface.html" title="System Interface" class="md-nav__link">
855 <li class="md-nav__item">
856 <a href="ft2-module_management.html" title="Module Management" class="md-nav__link">
867 <li class="md-nav__item">
868 <a href="ft2-gzip.html" title="GZIP Streams" class="md-nav__link">
879 <li class="md-nav__item">
880 <a href="ft2-lzw.html" title="LZW Streams" class="md-nav__link">
891 <li class="md-nav__item">
892 <a href="ft2-bzip2.html" title="BZIP2 Streams" class="md-nav__link">
908 <li class="md-nav__item md-nav__item--nested">
910 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-9" type="checkbox" id="nav-9">
912 <label class="md-nav__link" for="nav-9">
915 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
916 <label class="md-nav__title" for="nav-9">
919 <ul class="md-nav__list" data-md-scrollfix>
927 <li class="md-nav__item">
928 <a href="ft2-error_enumerations.html" title="Error Enumerations" class="md-nav__link">
939 <li class="md-nav__item">
940 <a href="ft2-error_code_values.html" title="Error Code Values" class="md-nav__link">
956 <li class="md-nav__item md-nav__item--nested">
958 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-10" type="checkbox" id="nav-10">
960 <label class="md-nav__link" for="nav-10">
963 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
964 <label class="md-nav__title" for="nav-10">
967 <ul class="md-nav__list" data-md-scrollfix>
975 <li class="md-nav__item">
976 <a href="ft2-ot_validation.html" title="OpenType Validation" class="md-nav__link">
987 <li class="md-nav__item">
988 <a href="ft2-incremental.html" title="Incremental Loading" class="md-nav__link">
999 <li class="md-nav__item">
1000 <a href="ft2-truetype_engine.html" title="The TrueType Engine" class="md-nav__link">
1011 <li class="md-nav__item">
1012 <a href="ft2-gx_validation.html" title="TrueTypeGX/AAT Validation" class="md-nav__link">
1013 TrueTypeGX/AAT Validation
1030 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
1031 <div class="md-sidebar__scrollwrap">
1032 <div class="md-sidebar__inner">
1034 <nav class="md-nav md-nav--secondary">
1040 <label class="md-nav__title" for="__toc">Table of contents</label>
1041 <ul class="md-nav__list" data-md-scrollfix>
1043 <li class="md-nav__item">
1044 <a href="#synopsis" title="Synopsis" class="md-nav__link">
1062 <div class="md-content">
1063 <article class="md-content__inner md-typeset">
1067 <p><a href="https://www.freetype.org">FreeType</a> » <a href="../">Docs</a> » <a href="index.html#controlling-freetype-modules">Controlling FreeType Modules</a> » The CFF driver</p>
1069 <h1 id="the-cff-driver">The CFF driver<a class="headerlink" href="#the-cff-driver" title="Permanent link">¶</a></h1>
1070 <h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">¶</a></h2>
1071 <p>While FreeType's CFF driver doesn't expose API functions by itself, it is possible to control its behaviour with <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>.</p>
1072 <p>The CFF driver's module name is ‘cff’.</p>
1073 <p>Available properties are <code><a href="ft2-properties.html#hinting-engine">hinting-engine</a></code>, <code><a href="ft2-properties.html#no-stem-darkening">no-stem-darkening</a></code>, <code><a href="ft2-properties.html#darkening-parameters">darkening-parameters</a></code>, and <code><a href="ft2-properties.html#random-seed">random-seed</a></code>, as documented in the ‘<a href="ft2-properties.html#properties">Driver properties</a>’ section.</p>
1074 <p><strong>Hinting and antialiasing principles of the new engine</strong></p>
1075 <p>The rasterizer is positioning horizontal features (e.g., ascender height & x-height, or crossbars) on the pixel grid and minimizing the amount of antialiasing applied to them, while placing vertical features (vertical stems) on the pixel grid without hinting, thus representing the stem position and weight accurately. Sometimes the vertical stems may be only partially black. In this context, ‘antialiasing’ means that stems are not positioned exactly on pixel borders, causing a fuzzy appearance.</p>
1076 <p>There are two principles behind this approach.</p>
1077 <p>1) No hinting in the horizontal direction: Unlike ‘superhinted’ TrueType, which changes glyph widths to accommodate regular inter-glyph spacing, Adobe's approach is ‘faithful to the design’ in representing both the glyph width and the inter-glyph spacing designed for the font. This makes the screen display as close as it can be to the result one would get with infinite resolution, while preserving what is considered the key characteristics of each glyph. Note that the distances between unhinted and grid-fitted positions at small sizes are comparable to kerning values and thus would be noticeable (and distracting) while reading if hinting were applied.</p>
1078 <p>One of the reasons to not hint horizontally is antialiasing for LCD screens: The pixel geometry of modern displays supplies three vertical subpixels as the eye moves horizontally across each visible pixel. On devices where we can be certain this characteristic is present a rasterizer can take advantage of the subpixels to add increments of weight. In Western writing systems this turns out to be the more critical direction anyway; the weights and spacing of vertical stems (see above) are central to Armenian, Cyrillic, Greek, and Latin type designs. Even when the rasterizer uses greyscale antialiasing instead of color (a necessary compromise when one doesn't know the screen characteristics), the unhinted vertical features preserve the design's weight and spacing much better than aliased type would.</p>
1079 <p>2) Alignment in the vertical direction: Weights and spacing along the y axis are less critical; what is much more important is the visual alignment of related features (like cap-height and x-height). The sense of alignment for these is enhanced by the sharpness of grid-fit edges, while the cruder vertical resolution (full pixels instead of ⅓ pixels) is less of a problem.</p>
1080 <p>On the technical side, horizontal alignment zones for ascender, x-height, and other important height values (traditionally called ‘blue zones’) as defined in the font are positioned independently, each being rounded to the nearest pixel edge, taking care of overshoot suppression at small sizes, stem darkening, and scaling.</p>
1081 <p>Hstems (this is, hint values defined in the font to help align horizontal features) that fall within a blue zone are said to be ‘captured’ and are aligned to that zone. Uncaptured stems are moved in one of four ways, top edge up or down, bottom edge up or down. Unless there are conflicting hstems, the smallest movement is taken to minimize distortion.</p>
1097 <footer class="md-footer">
1099 <div class="md-footer-nav">
1100 <nav class="md-footer-nav__inner md-grid">
1102 <a href="ft2-auto_hinter.html" title="The auto-hinter" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
1103 <div class="md-flex__cell md-flex__cell--shrink">
1104 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
1106 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
1107 <span class="md-flex__ellipsis">
1108 <span class="md-footer-nav__direction">
1117 <a href="ft2-t1_cid_driver.html" title="The Type 1 and CID drivers" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
1118 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
1119 <span class="md-flex__ellipsis">
1120 <span class="md-footer-nav__direction">
1123 The Type 1 and CID drivers
1126 <div class="md-flex__cell md-flex__cell--shrink">
1127 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
1134 <div class="md-footer-meta md-typeset">
1135 <div class="md-footer-meta__inner md-grid">
1136 <div class="md-footer-copyright">
1138 <div class="md-footer-copyright__highlight">
1139 Copyright 2019 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
1143 <a href="https://www.mkdocs.org">MkDocs</a>
1145 <a href="https://squidfunk.github.io/mkdocs-material/">
1146 Material for MkDocs</a>
1155 <script src="assets/javascripts/application.d9aa80ab.js"></script>
1157 <script>app.initialize({version:"1.0.4",url:{base:"."}})</script>
1159 <script src="javascripts/extra.js"></script>