src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h
changeset 54876 da3834261f0c
parent 50479 70e706c85f1d
equal deleted inserted replaced
54875:bcfedddcf4ce 54876:da3834261f0c
     1 /***************************************************************************/
     1 /****************************************************************************
     2 /*                                                                         */
     2  *
     3 /*  ftdriver.h                                                             */
     3  * ftdriver.h
     4 /*                                                                         */
     4  *
     5 /*    FreeType API for controlling driver modules (specification only).    */
     5  *   FreeType API for controlling driver modules (specification only).
     6 /*                                                                         */
     6  *
     7 /*  Copyright 2017-2018 by                                                 */
     7  * Copyright (C) 2017-2019 by
     8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
     8  * David Turner, Robert Wilhelm, and Werner Lemberg.
     9 /*                                                                         */
     9  *
    10 /*  This file is part of the FreeType project, and may only be used,       */
    10  * This file is part of the FreeType project, and may only be used,
    11 /*  modified, and distributed under the terms of the FreeType project      */
    11  * modified, and distributed under the terms of the FreeType project
    12 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    12  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
    13 /*  this file you indicate that you have read the license and              */
    13  * this file you indicate that you have read the license and
    14 /*  understand and accept it fully.                                        */
    14  * understand and accept it fully.
    15 /*                                                                         */
    15  *
    16 /***************************************************************************/
    16  */
    17 
    17 
    18 
    18 
    19 #ifndef FTDRIVER_H_
    19 #ifndef FTDRIVER_H_
    20 #define FTDRIVER_H_
    20 #define FTDRIVER_H_
    21 
    21 
    48    *   While FreeType's auto-hinter doesn't expose API functions by itself,
    48    *   While FreeType's auto-hinter doesn't expose API functions by itself,
    49    *   it is possible to control its behaviour with @FT_Property_Set and
    49    *   it is possible to control its behaviour with @FT_Property_Set and
    50    *   @FT_Property_Get.  The following lists the available properties
    50    *   @FT_Property_Get.  The following lists the available properties
    51    *   together with the necessary macros and structures.
    51    *   together with the necessary macros and structures.
    52    *
    52    *
    53    *   Note that the auto-hinter's module name is `autofitter' for
    53    *   Note that the auto-hinter's module name is 'autofitter' for historical
    54    *   historical reasons.
    54    *   reasons.
    55    *
    55    *
    56    *   Available properties are @increase-x-height, @no-stem-darkening
    56    *   Available properties are @increase-x-height, @no-stem-darkening
    57    *   (experimental), @darkening-parameters (experimental), @warping
    57    *   (experimental), @darkening-parameters (experimental), @warping
    58    *   (experimental), @glyph-to-script-map (experimental), @fallback-script
    58    *   (experimental), @glyph-to-script-map (experimental), @fallback-script
    59    *   (experimental), and @default-script (experimental), as documented in
    59    *   (experimental), and @default-script (experimental), as documented in
    72    *
    72    *
    73    * @abstract:
    73    * @abstract:
    74    *   Controlling the CFF driver module.
    74    *   Controlling the CFF driver module.
    75    *
    75    *
    76    * @description:
    76    * @description:
    77    *   While FreeType's CFF driver doesn't expose API functions by itself,
    77    *   While FreeType's CFF driver doesn't expose API functions by itself, it
    78    *   it is possible to control its behaviour with @FT_Property_Set and
    78    *   is possible to control its behaviour with @FT_Property_Set and
    79    *   @FT_Property_Get.
    79    *   @FT_Property_Get.
    80    *
    80    *
    81    *   The CFF driver's module name is `cff'.
    81    *   The CFF driver's module name is 'cff'.
    82    *
    82    *
    83    *   Available properties are @hinting-engine, @no-stem-darkening,
    83    *   Available properties are @hinting-engine, @no-stem-darkening,
    84    *   @darkening-parameters, and @random-seed, as documented in the
    84    *   @darkening-parameters, and @random-seed, as documented in the
    85    *   @properties section.
    85    *   @properties section.
    86    *
    86    *
    87    *
    87    *
    88    *   *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*
    88    *   **Hinting and antialiasing principles of the new engine**
    89    *
    89    *
    90    *   The rasterizer is positioning horizontal features (e.g., ascender
    90    *   The rasterizer is positioning horizontal features (e.g., ascender
    91    *   height & x-height, or crossbars) on the pixel grid and minimizing the
    91    *   height & x-height, or crossbars) on the pixel grid and minimizing the
    92    *   amount of antialiasing applied to them, while placing vertical
    92    *   amount of antialiasing applied to them, while placing vertical
    93    *   features (vertical stems) on the pixel grid without hinting, thus
    93    *   features (vertical stems) on the pixel grid without hinting, thus
    94    *   representing the stem position and weight accurately.  Sometimes the
    94    *   representing the stem position and weight accurately.  Sometimes the
    95    *   vertical stems may be only partially black.  In this context,
    95    *   vertical stems may be only partially black.  In this context,
    96    *   `antialiasing' means that stems are not positioned exactly on pixel
    96    *   'antialiasing' means that stems are not positioned exactly on pixel
    97    *   borders, causing a fuzzy appearance.
    97    *   borders, causing a fuzzy appearance.
    98    *
    98    *
    99    *   There are two principles behind this approach.
    99    *   There are two principles behind this approach.
   100    *
   100    *
   101    *   1) No hinting in the horizontal direction: Unlike `superhinted'
   101    *   1) No hinting in the horizontal direction: Unlike 'superhinted'
   102    *   TrueType, which changes glyph widths to accommodate regular
   102    *   TrueType, which changes glyph widths to accommodate regular
   103    *   inter-glyph spacing, Adobe's approach is `faithful to the design' in
   103    *   inter-glyph spacing, Adobe's approach is 'faithful to the design' in
   104    *   representing both the glyph width and the inter-glyph spacing
   104    *   representing both the glyph width and the inter-glyph spacing designed
   105    *   designed for the font.  This makes the screen display as close as it
   105    *   for the font.  This makes the screen display as close as it can be to
   106    *   can be to the result one would get with infinite resolution, while
   106    *   the result one would get with infinite resolution, while preserving
   107    *   preserving what is considered the key characteristics of each glyph.
   107    *   what is considered the key characteristics of each glyph.  Note that
   108    *   Note that the distances between unhinted and grid-fitted positions at
   108    *   the distances between unhinted and grid-fitted positions at small
   109    *   small sizes are comparable to kerning values and thus would be
   109    *   sizes are comparable to kerning values and thus would be noticeable
   110    *   noticeable (and distracting) while reading if hinting were applied.
   110    *   (and distracting) while reading if hinting were applied.
   111    *
   111    *
   112    *   One of the reasons to not hint horizontally is antialiasing for LCD
   112    *   One of the reasons to not hint horizontally is antialiasing for LCD
   113    *   screens: The pixel geometry of modern displays supplies three
   113    *   screens: The pixel geometry of modern displays supplies three vertical
   114    *   vertical subpixels as the eye moves horizontally across each visible
   114    *   subpixels as the eye moves horizontally across each visible pixel.  On
   115    *   pixel.  On devices where we can be certain this characteristic is
   115    *   devices where we can be certain this characteristic is present a
   116    *   present a rasterizer can take advantage of the subpixels to add
   116    *   rasterizer can take advantage of the subpixels to add increments of
   117    *   increments of weight.  In Western writing systems this turns out to
   117    *   weight.  In Western writing systems this turns out to be the more
   118    *   be the more critical direction anyway; the weights and spacing of
   118    *   critical direction anyway; the weights and spacing of vertical stems
   119    *   vertical stems (see above) are central to Armenian, Cyrillic, Greek,
   119    *   (see above) are central to Armenian, Cyrillic, Greek, and Latin type
   120    *   and Latin type designs.  Even when the rasterizer uses greyscale
   120    *   designs.  Even when the rasterizer uses greyscale antialiasing instead
   121    *   antialiasing instead of color (a necessary compromise when one
   121    *   of color (a necessary compromise when one doesn't know the screen
   122    *   doesn't know the screen characteristics), the unhinted vertical
   122    *   characteristics), the unhinted vertical features preserve the design's
   123    *   features preserve the design's weight and spacing much better than
   123    *   weight and spacing much better than aliased type would.
   124    *   aliased type would.
       
   125    *
   124    *
   126    *   2) Alignment in the vertical direction: Weights and spacing along the
   125    *   2) Alignment in the vertical direction: Weights and spacing along the
   127    *   y~axis are less critical; what is much more important is the visual
   126    *   y~axis are less critical; what is much more important is the visual
   128    *   alignment of related features (like cap-height and x-height).  The
   127    *   alignment of related features (like cap-height and x-height).  The
   129    *   sense of alignment for these is enhanced by the sharpness of grid-fit
   128    *   sense of alignment for these is enhanced by the sharpness of grid-fit
   130    *   edges, while the cruder vertical resolution (full pixels instead of
   129    *   edges, while the cruder vertical resolution (full pixels instead of
   131    *   1/3 pixels) is less of a problem.
   130    *   1/3 pixels) is less of a problem.
   132    *
   131    *
   133    *   On the technical side, horizontal alignment zones for ascender,
   132    *   On the technical side, horizontal alignment zones for ascender,
   134    *   x-height, and other important height values (traditionally called
   133    *   x-height, and other important height values (traditionally called
   135    *   `blue zones') as defined in the font are positioned independently,
   134    *   'blue zones') as defined in the font are positioned independently,
   136    *   each being rounded to the nearest pixel edge, taking care of
   135    *   each being rounded to the nearest pixel edge, taking care of overshoot
   137    *   overshoot suppression at small sizes, stem darkening, and scaling.
   136    *   suppression at small sizes, stem darkening, and scaling.
   138    *
   137    *
   139    *   Hstems (this is, hint values defined in the font to help align
   138    *   Hstems (this is, hint values defined in the font to help align
   140    *   horizontal features) that fall within a blue zone are said to be
   139    *   horizontal features) that fall within a blue zone are said to be
   141    *   `captured' and are aligned to that zone.  Uncaptured stems are moved
   140    *   'captured' and are aligned to that zone.  Uncaptured stems are moved
   142    *   in one of four ways, top edge up or down, bottom edge up or down.
   141    *   in one of four ways, top edge up or down, bottom edge up or down.
   143    *   Unless there are conflicting hstems, the smallest movement is taken
   142    *   Unless there are conflicting hstems, the smallest movement is taken to
   144    *   to minimize distortion.
   143    *   minimize distortion.
   145    *
   144    *
   146    */
   145    */
   147 
   146 
   148 
   147 
   149   /**************************************************************************
   148   /**************************************************************************
   156    *
   155    *
   157    * @abstract:
   156    * @abstract:
   158    *   Controlling the PCF driver module.
   157    *   Controlling the PCF driver module.
   159    *
   158    *
   160    * @description:
   159    * @description:
   161    *   While FreeType's PCF driver doesn't expose API functions by itself,
   160    *   While FreeType's PCF driver doesn't expose API functions by itself, it
   162    *   it is possible to control its behaviour with @FT_Property_Set and
   161    *   is possible to control its behaviour with @FT_Property_Set and
   163    *   @FT_Property_Get.  Right now, there is a single property
   162    *   @FT_Property_Get.  Right now, there is a single property
   164    *   @no-long-family-names available if FreeType is compiled with
   163    *   @no-long-family-names available if FreeType is compiled with
   165    *   PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
   164    *   PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
   166    *
   165    *
   167    *   The PCF driver's module name is `pcf'.
   166    *   The PCF driver's module name is 'pcf'.
   168    *
   167    *
   169    */
   168    */
   170 
   169 
   171 
   170 
   172   /**************************************************************************
   171   /**************************************************************************
   185    *   Type~1 CID drivers with @FT_Property_Set and @FT_Property_Get.
   184    *   Type~1 CID drivers with @FT_Property_Set and @FT_Property_Get.
   186    *
   185    *
   187    *   Behind the scenes, both drivers use the Adobe CFF engine for hinting;
   186    *   Behind the scenes, both drivers use the Adobe CFF engine for hinting;
   188    *   however, the used properties must be specified separately.
   187    *   however, the used properties must be specified separately.
   189    *
   188    *
   190    *   The Type~1 driver's module name is `type1'; the CID driver's module
   189    *   The Type~1 driver's module name is 'type1'; the CID driver's module
   191    *   name is `t1cid'.
   190    *   name is 't1cid'.
   192    *
   191    *
   193    *   Available properties are @hinting-engine, @no-stem-darkening,
   192    *   Available properties are @hinting-engine, @no-stem-darkening,
   194    *   @darkening-parameters, and @random-seed, as documented in the
   193    *   @darkening-parameters, and @random-seed, as documented in the
   195    *   @properties section.
   194    *   @properties section.
   196    *
   195    *
   197    *   Please see the @cff_driver section for more details on the new
   196    *   Please see the @cff_driver section for more details on the new hinting
   198    *   hinting engine.
   197    *   engine.
   199    *
   198    *
   200    */
   199    */
   201 
   200 
   202 
   201 
   203   /**************************************************************************
   202   /**************************************************************************
   215    *   While FreeType's TrueType driver doesn't expose API functions by
   214    *   While FreeType's TrueType driver doesn't expose API functions by
   216    *   itself, it is possible to control its behaviour with @FT_Property_Set
   215    *   itself, it is possible to control its behaviour with @FT_Property_Set
   217    *   and @FT_Property_Get.  The following lists the available properties
   216    *   and @FT_Property_Get.  The following lists the available properties
   218    *   together with the necessary macros and structures.
   217    *   together with the necessary macros and structures.
   219    *
   218    *
   220    *   The TrueType driver's module name is `truetype'.
   219    *   The TrueType driver's module name is 'truetype'.
   221    *
   220    *
   222    *   A single property @interpreter-version is available, as documented in
   221    *   A single property @interpreter-version is available, as documented in
   223    *   the @properties section.
   222    *   the @properties section.
   224    *
   223    *
   225    *   We start with a list of definitions, kindly provided by Greg
   224    *   We start with a list of definitions, kindly provided by Greg
   226    *   Hitchcock.
   225    *   Hitchcock.
   227    *
   226    *
   228    *   _Bi-Level_ _Rendering_
   227    *   _Bi-Level Rendering_
   229    *
   228    *
   230    *   Monochromatic rendering, exclusively used in the early days of
   229    *   Monochromatic rendering, exclusively used in the early days of
   231    *   TrueType by both Apple and Microsoft.  Microsoft's GDI interface
   230    *   TrueType by both Apple and Microsoft.  Microsoft's GDI interface
   232    *   supported hinting of the right-side bearing point, such that the
   231    *   supported hinting of the right-side bearing point, such that the
   233    *   advance width could be non-linear.  Most often this was done to
   232    *   advance width could be non-linear.  Most often this was done to
   234    *   achieve some level of glyph symmetry.  To enable reasonable
   233    *   achieve some level of glyph symmetry.  To enable reasonable
   235    *   performance (e.g., not having to run hinting on all glyphs just to
   234    *   performance (e.g., not having to run hinting on all glyphs just to get
   236    *   get the widths) there was a bit in the head table indicating if the
   235    *   the widths) there was a bit in the head table indicating if the side
   237    *   side bearing was hinted, and additional tables, `hdmx' and `LTSH', to
   236    *   bearing was hinted, and additional tables, 'hdmx' and 'LTSH', to cache
   238    *   cache hinting widths across multiple sizes and device aspect ratios.
   237    *   hinting widths across multiple sizes and device aspect ratios.
   239    *
   238    *
   240    *   _Font_ _Smoothing_
   239    *   _Font Smoothing_
   241    *
   240    *
   242    *   Microsoft's GDI implementation of anti-aliasing.  Not traditional
   241    *   Microsoft's GDI implementation of anti-aliasing.  Not traditional
   243    *   anti-aliasing as the outlines were hinted before the sampling.  The
   242    *   anti-aliasing as the outlines were hinted before the sampling.  The
   244    *   widths matched the bi-level rendering.
   243    *   widths matched the bi-level rendering.
   245    *
   244    *
   246    *   _ClearType_ _Rendering_
   245    *   _ClearType Rendering_
   247    *
   246    *
   248    *   Technique that uses physical subpixels to improve rendering on LCD
   247    *   Technique that uses physical subpixels to improve rendering on LCD
   249    *   (and other) displays.  Because of the higher resolution, many methods
   248    *   (and other) displays.  Because of the higher resolution, many methods
   250    *   of improving symmetry in glyphs through hinting the right-side
   249    *   of improving symmetry in glyphs through hinting the right-side bearing
   251    *   bearing were no longer necessary.  This lead to what GDI calls
   250    *   were no longer necessary.  This lead to what GDI calls 'natural
   252    *   `natural widths' ClearType, see
   251    *   widths' ClearType, see
   253    *   http://www.beatstamm.com/typography/RTRCh4.htm#Sec21.  Since hinting
   252    *   http://rastertragedy.com/RTRCh4.htm#Sec21.  Since hinting
   254    *   has extra resolution, most non-linearity went away, but it is still
   253    *   has extra resolution, most non-linearity went away, but it is still
   255    *   possible for hints to change the advance widths in this mode.
   254    *   possible for hints to change the advance widths in this mode.
   256    *
   255    *
   257    *   _ClearType_ _Compatible_ _Widths_
   256    *   _ClearType Compatible Widths_
   258    *
   257    *
   259    *   One of the earliest challenges with ClearType was allowing the
   258    *   One of the earliest challenges with ClearType was allowing the
   260    *   implementation in GDI to be selected without requiring all UI and
   259    *   implementation in GDI to be selected without requiring all UI and
   261    *   documents to reflow.  To address this, a compatible method of
   260    *   documents to reflow.  To address this, a compatible method of
   262    *   rendering ClearType was added where the font hints are executed once
   261    *   rendering ClearType was added where the font hints are executed once
   263    *   to determine the width in bi-level rendering, and then re-run in
   262    *   to determine the width in bi-level rendering, and then re-run in
   264    *   ClearType, with the difference in widths being absorbed in the font
   263    *   ClearType, with the difference in widths being absorbed in the font
   265    *   hints for ClearType (mostly in the white space of hints); see
   264    *   hints for ClearType (mostly in the white space of hints); see
   266    *   http://www.beatstamm.com/typography/RTRCh4.htm#Sec20.  Somewhat by
   265    *   http://rastertragedy.com/RTRCh4.htm#Sec20.  Somewhat by
   267    *   definition, compatible width ClearType allows for non-linear widths,
   266    *   definition, compatible width ClearType allows for non-linear widths,
   268    *   but only when the bi-level version has non-linear widths.
   267    *   but only when the bi-level version has non-linear widths.
   269    *
   268    *
   270    *   _ClearType_ _Subpixel_ _Positioning_
   269    *   _ClearType Subpixel Positioning_
   271    *
   270    *
   272    *   One of the nice benefits of ClearType is the ability to more crisply
   271    *   One of the nice benefits of ClearType is the ability to more crisply
   273    *   display fractional widths; unfortunately, the GDI model of integer
   272    *   display fractional widths; unfortunately, the GDI model of integer
   274    *   bitmaps did not support this.  However, the WPF and Direct Write
   273    *   bitmaps did not support this.  However, the WPF and Direct Write
   275    *   frameworks do support fractional widths.  DWrite calls this `natural
   274    *   frameworks do support fractional widths.  DWrite calls this 'natural
   276    *   mode', not to be confused with GDI's `natural widths'.  Subpixel
   275    *   mode', not to be confused with GDI's 'natural widths'.  Subpixel
   277    *   positioning, in the current implementation of Direct Write,
   276    *   positioning, in the current implementation of Direct Write,
   278    *   unfortunately does not support hinted advance widths, see
   277    *   unfortunately does not support hinted advance widths, see
   279    *   http://www.beatstamm.com/typography/RTRCh4.htm#Sec22.  Note that the
   278    *   http://rastertragedy.com/RTRCh4.htm#Sec22.  Note that the
   280    *   TrueType interpreter fully allows the advance width to be adjusted in
   279    *   TrueType interpreter fully allows the advance width to be adjusted in
   281    *   this mode, just the DWrite client will ignore those changes.
   280    *   this mode, just the DWrite client will ignore those changes.
   282    *
   281    *
   283    *   _ClearType_ _Backward_ _Compatibility_
   282    *   _ClearType Backward Compatibility_
   284    *
   283    *
   285    *   This is a set of exceptions made in the TrueType interpreter to
   284    *   This is a set of exceptions made in the TrueType interpreter to
   286    *   minimize hinting techniques that were problematic with the extra
   285    *   minimize hinting techniques that were problematic with the extra
   287    *   resolution of ClearType; see
   286    *   resolution of ClearType; see
   288    *   http://www.beatstamm.com/typography/RTRCh4.htm#Sec1 and
   287    *   http://rastertragedy.com/RTRCh4.htm#Sec1 and
   289    *   https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
   288    *   https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
   290    *   This technique is not to be confused with ClearType compatible
   289    *   This technique is not to be confused with ClearType compatible widths.
   291    *   widths.  ClearType backward compatibility has no direct impact on
   290    *   ClearType backward compatibility has no direct impact on changing
   292    *   changing advance widths, but there might be an indirect impact on
   291    *   advance widths, but there might be an indirect impact on disabling
   293    *   disabling some deltas.  This could be worked around in backward
   292    *   some deltas.  This could be worked around in backward compatibility
   294    *   compatibility mode.
   293    *   mode.
   295    *
   294    *
   296    *   _Native_ _ClearType_ _Mode_
   295    *   _Native ClearType Mode_
   297    *
   296    *
   298    *   (Not to be confused with `natural widths'.)  This mode removes all
   297    *   (Not to be confused with 'natural widths'.)  This mode removes all the
   299    *   the exceptions in the TrueType interpreter when running with
   298    *   exceptions in the TrueType interpreter when running with ClearType.
   300    *   ClearType.  Any issues on widths would still apply, though.
   299    *   Any issues on widths would still apply, though.
   301    *
   300    *
   302    */
   301    */
   303 
   302 
   304 
   303 
   305   /**************************************************************************
   304   /**************************************************************************
   326    *
   325    *
   327    * @enum:
   326    * @enum:
   328    *   FT_HINTING_XXX
   327    *   FT_HINTING_XXX
   329    *
   328    *
   330    * @description:
   329    * @description:
   331    *   A list of constants used for the @hinting-engine property to
   330    *   A list of constants used for the @hinting-engine property to select
   332    *   select the hinting engine for CFF, Type~1, and CID fonts.
   331    *   the hinting engine for CFF, Type~1, and CID fonts.
   333    *
   332    *
   334    * @values:
   333    * @values:
   335    *   FT_HINTING_FREETYPE ::
   334    *   FT_HINTING_FREETYPE ::
   336    *     Use the old FreeType hinting engine.
   335    *     Use the old FreeType hinting engine.
   337    *
   336    *
   354    *
   353    *
   355    * @property:
   354    * @property:
   356    *   hinting-engine
   355    *   hinting-engine
   357    *
   356    *
   358    * @description:
   357    * @description:
   359    *   Thanks to Adobe, which contributed a new hinting (and parsing)
   358    *   Thanks to Adobe, which contributed a new hinting (and parsing) engine,
   360    *   engine, an application can select between `freetype' and `adobe' if
   359    *   an application can select between 'freetype' and 'adobe' if compiled
   361    *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration
   360    *   with `CFF_CONFIG_OPTION_OLD_ENGINE`.  If this configuration macro
   362    *   macro isn't defined, `hinting-engine' does nothing.
   361    *   isn't defined, 'hinting-engine' does nothing.
   363    *
   362    *
   364    *   The same holds for the Type~1 and CID modules if compiled with
   363    *   The same holds for the Type~1 and CID modules if compiled with
   365    *   T1_CONFIG_OPTION_OLD_ENGINE.
   364    *   `T1_CONFIG_OPTION_OLD_ENGINE`.
   366    *
   365    *
   367    *   For the `cff' module, the default engine is `freetype' if
   366    *   For the 'cff' module, the default engine is 'freetype' if
   368    *   CFF_CONFIG_OPTION_OLD_ENGINE is defined, and `adobe' otherwise.
   367    *   `CFF_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe' otherwise.
   369    *
   368    *
   370    *   For both the `type1' and `t1cid' modules, the default engine is
   369    *   For both the 'type1' and 't1cid' modules, the default engine is
   371    *   `freetype' if T1_CONFIG_OPTION_OLD_ENGINE is defined, and `adobe'
   370    *   'freetype' if `T1_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe'
   372    *   otherwise.
   371    *   otherwise.
   373    *
   372    *
       
   373    * @note:
       
   374    *   This property can be used with @FT_Property_Get also.
       
   375    *
       
   376    *   This property can be set via the `FREETYPE_PROPERTIES` environment
       
   377    *   variable (using values 'adobe' or 'freetype').
       
   378    *
       
   379    * @example:
   374    *   The following example code demonstrates how to select Adobe's hinting
   380    *   The following example code demonstrates how to select Adobe's hinting
   375    *   engine for the `cff' module (omitting the error handling).
   381    *   engine for the 'cff' module (omitting the error handling).
   376    *
   382    *
   377    *   {
   383    *   ```
   378    *     FT_Library  library;
   384    *     FT_Library  library;
   379    *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;
   385    *     FT_UInt     hinting_engine = FT_HINTING_ADOBE;
   380    *
   386    *
   381    *
   387    *
   382    *     FT_Init_FreeType( &library );
   388    *     FT_Init_FreeType( &library );
   383    *
   389    *
   384    *     FT_Property_Set( library, "cff",
   390    *     FT_Property_Set( library, "cff",
   385    *                               "hinting-engine", &hinting_engine );
   391    *                               "hinting-engine", &hinting_engine );
   386    *   }
   392    *   ```
   387    *
   393    *
   388    * @note:
   394    * @since:
   389    *   This property can be used with @FT_Property_Get also.
   395    *   2.4.12 (for 'cff' module)
   390    *
   396    *
   391    *   This property can be set via the `FREETYPE_PROPERTIES' environment
   397    *   2.9 (for 'type1' and 't1cid' modules)
   392    *   variable (using values `adobe' or `freetype').
       
   393    *
       
   394    * @since:
       
   395    *   2.4.12 (for `cff' module)
       
   396    *
       
   397    *   2.9 (for `type1' and `t1cid' modules)
       
   398    *
   398    *
   399    */
   399    */
   400 
   400 
   401 
   401 
   402   /**************************************************************************
   402   /**************************************************************************
   403    *
   403    *
   404    * @property:
   404    * @property:
   405    *   no-stem-darkening
   405    *   no-stem-darkening
   406    *
   406    *
   407    * @description:
   407    * @description:
   408    *   All glyphs that pass through the auto-hinter will be emboldened
   408    *   All glyphs that pass through the auto-hinter will be emboldened unless
   409    *   unless this property is set to TRUE.  The same is true for the CFF,
   409    *   this property is set to TRUE.  The same is true for the CFF, Type~1,
   410    *   Type~1, and CID font modules if the `Adobe' engine is selected (which
   410    *   and CID font modules if the 'Adobe' engine is selected (which is the
   411    *   is the default).
   411    *   default).
   412    *
   412    *
   413    *   Stem darkening emboldens glyphs at smaller sizes to make them more
   413    *   Stem darkening emboldens glyphs at smaller sizes to make them more
   414    *   readable on common low-DPI screens when using linear alpha blending
   414    *   readable on common low-DPI screens when using linear alpha blending
   415    *   and gamma correction, see @FT_Render_Glyph.  When not using linear
   415    *   and gamma correction, see @FT_Render_Glyph.  When not using linear
   416    *   alpha blending and gamma correction, glyphs will appear heavy and
   416    *   alpha blending and gamma correction, glyphs will appear heavy and
   417    *   fuzzy!
   417    *   fuzzy!
   418    *
   418    *
   419    *   Gamma correction essentially lightens fonts since shades of grey are
   419    *   Gamma correction essentially lightens fonts since shades of grey are
   420    *   shifted to higher pixel values (=~higher brightness) to match the
   420    *   shifted to higher pixel values (=~higher brightness) to match the
   421    *   original intention to the reality of our screens.  The side-effect is
   421    *   original intention to the reality of our screens.  The side-effect is
   422    *   that glyphs `thin out'.  Mac OS~X and Adobe's proprietary font
   422    *   that glyphs 'thin out'.  Mac OS~X and Adobe's proprietary font
   423    *   rendering library implement a counter-measure: stem darkening at
   423    *   rendering library implement a counter-measure: stem darkening at
   424    *   smaller sizes where shades of gray dominate.  By emboldening a glyph
   424    *   smaller sizes where shades of gray dominate.  By emboldening a glyph
   425    *   slightly in relation to its pixel size, individual pixels get higher
   425    *   slightly in relation to its pixel size, individual pixels get higher
   426    *   coverage of filled-in outlines and are therefore `blacker'.  This
   426    *   coverage of filled-in outlines and are therefore 'blacker'.  This
   427    *   counteracts the `thinning out' of glyphs, making text remain readable
   427    *   counteracts the 'thinning out' of glyphs, making text remain readable
   428    *   at smaller sizes.
   428    *   at smaller sizes.
   429    *
   429    *
   430    *   By default, the Adobe engines for CFF, Type~1, and CID fonts darken
   430    *   By default, the Adobe engines for CFF, Type~1, and CID fonts darken
   431    *   stems at smaller sizes, regardless of hinting, to enhance contrast.
   431    *   stems at smaller sizes, regardless of hinting, to enhance contrast.
   432    *   Setting this property, stem darkening gets switched off.
   432    *   Setting this property, stem darkening gets switched off.
   433    *
   433    *
   434    *   For the auto-hinter, stem-darkening is experimental currently and
   434    *   For the auto-hinter, stem-darkening is experimental currently and thus
   435    *   thus switched off by default (this is, `no-stem-darkening' is set to
   435    *   switched off by default (this is, `no-stem-darkening` is set to TRUE
   436    *   TRUE by default).  Total consistency with the CFF driver is not
   436    *   by default).  Total consistency with the CFF driver is not achieved
   437    *   achieved right now because the emboldening method differs and glyphs
   437    *   right now because the emboldening method differs and glyphs must be
   438    *   must be scaled down on the Y-axis to keep outline points inside their
   438    *   scaled down on the Y-axis to keep outline points inside their
   439    *   precomputed blue zones.  The smaller the size (especially 9ppem and
   439    *   precomputed blue zones.  The smaller the size (especially 9ppem and
   440    *   down), the higher the loss of emboldening versus the CFF driver.
   440    *   down), the higher the loss of emboldening versus the CFF driver.
   441    *
   441    *
   442    *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is
   442    *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
   443    *   set.
   443    *
   444    *
   444    * @note:
   445    *   {
   445    *   This property can be used with @FT_Property_Get also.
       
   446    *
       
   447    *   This property can be set via the `FREETYPE_PROPERTIES` environment
       
   448    *   variable (using values 1 and 0 for 'on' and 'off', respectively).  It
       
   449    *   can also be set per face using @FT_Face_Properties with
       
   450    *   @FT_PARAM_TAG_STEM_DARKENING.
       
   451    *
       
   452    * @example:
       
   453    *   ```
   446    *     FT_Library  library;
   454    *     FT_Library  library;
   447    *     FT_Bool     no_stem_darkening = TRUE;
   455    *     FT_Bool     no_stem_darkening = TRUE;
   448    *
   456    *
   449    *
   457    *
   450    *     FT_Init_FreeType( &library );
   458    *     FT_Init_FreeType( &library );
   451    *
   459    *
   452    *     FT_Property_Set( library, "cff",
   460    *     FT_Property_Set( library, "cff",
   453    *                               "no-stem-darkening", &no_stem_darkening );
   461    *                               "no-stem-darkening", &no_stem_darkening );
   454    *   }
   462    *   ```
   455    *
   463    *
   456    * @note:
   464    * @since:
   457    *   This property can be used with @FT_Property_Get also.
   465    *   2.4.12 (for 'cff' module)
   458    *
   466    *
   459    *   This property can be set via the `FREETYPE_PROPERTIES' environment
   467    *   2.6.2 (for 'autofitter' module)
   460    *   variable (using values 1 and 0 for `on' and `off', respectively).
   468    *
   461    *   It can also be set per face using @FT_Face_Properties with
   469    *   2.9 (for 'type1' and 't1cid' modules)
   462    *   @FT_PARAM_TAG_STEM_DARKENING.
       
   463    *
       
   464    * @since:
       
   465    *   2.4.12 (for `cff' module)
       
   466    *
       
   467    *   2.6.2 (for `autofitter' module)
       
   468    *
       
   469    *   2.9 (for `type1' and `t1cid' modules)
       
   470    *
   470    *
   471    */
   471    */
   472 
   472 
   473 
   473 
   474   /**************************************************************************
   474   /**************************************************************************
   476    * @property:
   476    * @property:
   477    *   darkening-parameters
   477    *   darkening-parameters
   478    *
   478    *
   479    * @description:
   479    * @description:
   480    *   By default, the Adobe hinting engine, as used by the CFF, Type~1, and
   480    *   By default, the Adobe hinting engine, as used by the CFF, Type~1, and
   481    *   CID font drivers, darkens stems as follows (if the
   481    *   CID font drivers, darkens stems as follows (if the `no-stem-darkening`
   482    *   `no-stem-darkening' property isn't set):
   482    *   property isn't set):
   483    *
   483    *
   484    *   {
   484    *   ```
   485    *     stem width <= 0.5px:   darkening amount = 0.4px
   485    *     stem width <= 0.5px:   darkening amount = 0.4px
   486    *     stem width  = 1px:     darkening amount = 0.275px
   486    *     stem width  = 1px:     darkening amount = 0.275px
   487    *     stem width  = 1.667px: darkening amount = 0.275px
   487    *     stem width  = 1.667px: darkening amount = 0.275px
   488    *     stem width >= 2.333px: darkening amount = 0px
   488    *     stem width >= 2.333px: darkening amount = 0px
   489    *   }
   489    *   ```
   490    *
   490    *
   491    *   and piecewise linear in-between.  At configuration time, these four
   491    *   and piecewise linear in-between.  At configuration time, these four
   492    *   control points can be set with the macro
   492    *   control points can be set with the macro
   493    *   `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'; the CFF, Type~1, and CID
   493    *   `CFF_CONFIG_OPTION_DARKENING_PARAMETERS`; the CFF, Type~1, and CID
   494    *   drivers share these values.  At runtime, the control points can be
   494    *   drivers share these values.  At runtime, the control points can be
   495    *   changed using the `darkening-parameters' property, as the following
   495    *   changed using the `darkening-parameters` property (see the example
   496    *   example demonstrates for the Type~1 driver.
   496    *   below that demonstrates this for the Type~1 driver).
   497    *
   497    *
   498    *   {
   498    *   The x~values give the stem width, and the y~values the darkening
       
   499    *   amount.  The unit is 1000th of pixels.  All coordinate values must be
       
   500    *   positive; the x~values must be monotonically increasing; the y~values
       
   501    *   must be monotonically decreasing and smaller than or equal to 500
       
   502    *   (corresponding to half a pixel); the slope of each linear piece must
       
   503    *   be shallower than -1 (e.g., -.4).
       
   504    *
       
   505    *   The auto-hinter provides this property, too, as an experimental
       
   506    *   feature.  See @no-stem-darkening for more.
       
   507    *
       
   508    * @note:
       
   509    *   This property can be used with @FT_Property_Get also.
       
   510    *
       
   511    *   This property can be set via the `FREETYPE_PROPERTIES` environment
       
   512    *   variable, using eight comma-separated integers without spaces.  Here
       
   513    *   the above example, using `\` to break the line for readability.
       
   514    *
       
   515    *   ```
       
   516    *     FREETYPE_PROPERTIES=\
       
   517    *     type1:darkening-parameters=500,300,1000,200,1500,100,2000,0
       
   518    *   ```
       
   519    *
       
   520    * @example:
       
   521    *   ```
   499    *     FT_Library  library;
   522    *     FT_Library  library;
   500    *     FT_Int      darken_params[8] = {  500, 300,   // x1, y1
   523    *     FT_Int      darken_params[8] = {  500, 300,   // x1, y1
   501    *                                      1000, 200,   // x2, y2
   524    *                                      1000, 200,   // x2, y2
   502    *                                      1500, 100,   // x3, y3
   525    *                                      1500, 100,   // x3, y3
   503    *                                      2000,   0 }; // x4, y4
   526    *                                      2000,   0 }; // x4, y4
   505    *
   528    *
   506    *     FT_Init_FreeType( &library );
   529    *     FT_Init_FreeType( &library );
   507    *
   530    *
   508    *     FT_Property_Set( library, "type1",
   531    *     FT_Property_Set( library, "type1",
   509    *                               "darkening-parameters", darken_params );
   532    *                               "darkening-parameters", darken_params );
   510    *   }
   533    *   ```
   511    *
   534    *
   512    *   The x~values give the stem width, and the y~values the darkening
   535    * @since:
   513    *   amount.  The unit is 1000th of pixels.  All coordinate values must be
   536    *   2.5.1 (for 'cff' module)
   514    *   positive; the x~values must be monotonically increasing; the
   537    *
   515    *   y~values must be monotonically decreasing and smaller than or
   538    *   2.6.2 (for 'autofitter' module)
   516    *   equal to 500 (corresponding to half a pixel); the slope of each
   539    *
   517    *   linear piece must be shallower than -1 (e.g., -.4).
   540    *   2.9 (for 'type1' and 't1cid' modules)
   518    *
   541    *
   519    *   The auto-hinter provides this property, too, as an experimental
   542    */
   520    *   feature.  See @no-stem-darkening for more.
   543 
       
   544 
       
   545   /**************************************************************************
       
   546    *
       
   547    * @property:
       
   548    *   random-seed
       
   549    *
       
   550    * @description:
       
   551    *   By default, the seed value for the CFF 'random' operator and the
       
   552    *   similar '0 28 callothersubr pop' command for the Type~1 and CID
       
   553    *   drivers is set to a random value.  However, mainly for debugging
       
   554    *   purposes, it is often necessary to use a known value as a seed so that
       
   555    *   the pseudo-random number sequences generated by 'random' are
       
   556    *   repeatable.
       
   557    *
       
   558    *   The `random-seed` property does that.  Its argument is a signed 32bit
       
   559    *   integer; if the value is zero or negative, the seed given by the
       
   560    *   `intitialRandomSeed` private DICT operator in a CFF file gets used (or
       
   561    *   a default value if there is no such operator).  If the value is
       
   562    *   positive, use it instead of `initialRandomSeed`, which is consequently
       
   563    *   ignored.
       
   564    *
       
   565    * @note:
       
   566    *   This property can be set via the `FREETYPE_PROPERTIES` environment
       
   567    *   variable.  It can also be set per face using @FT_Face_Properties with
       
   568    *   @FT_PARAM_TAG_RANDOM_SEED.
       
   569    *
       
   570    * @since:
       
   571    *   2.8 (for 'cff' module)
       
   572    *
       
   573    *   2.9 (for 'type1' and 't1cid' modules)
       
   574    *
       
   575    */
       
   576 
       
   577 
       
   578   /**************************************************************************
       
   579    *
       
   580    * @property:
       
   581    *   no-long-family-names
       
   582    *
       
   583    * @description:
       
   584    *   If `PCF_CONFIG_OPTION_LONG_FAMILY_NAMES` is active while compiling
       
   585    *   FreeType, the PCF driver constructs long family names.
       
   586    *
       
   587    *   There are many PCF fonts just called 'Fixed' which look completely
       
   588    *   different, and which have nothing to do with each other.  When
       
   589    *   selecting 'Fixed' in KDE or Gnome one gets results that appear rather
       
   590    *   random, the style changes often if one changes the size and one cannot
       
   591    *   select some fonts at all.  The improve this situation, the PCF module
       
   592    *   prepends the foundry name (plus a space) to the family name.  It also
       
   593    *   checks whether there are 'wide' characters; all put together, family
       
   594    *   names like 'Sony Fixed' or 'Misc Fixed Wide' are constructed.
       
   595    *
       
   596    *   If `no-long-family-names` is set, this feature gets switched off.
   521    *
   597    *
   522    * @note:
   598    * @note:
   523    *   This property can be used with @FT_Property_Get also.
   599    *   This property can be used with @FT_Property_Get also.
   524    *
   600    *
   525    *   This property can be set via the `FREETYPE_PROPERTIES' environment
   601    *   This property can be set via the `FREETYPE_PROPERTIES` environment
   526    *   variable, using eight comma-separated integers without spaces.  Here
   602    *   variable (using values 1 and 0 for 'on' and 'off', respectively).
   527    *   the above example, using `\' to break the line for readability.
   603    *
   528    *
   604    * @example:
   529    *   {
   605    *   ```
   530    *     FREETYPE_PROPERTIES=\
       
   531    *     type1:darkening-parameters=500,300,1000,200,1500,100,2000,0
       
   532    *   }
       
   533    *
       
   534    * @since:
       
   535    *   2.5.1 (for `cff' module)
       
   536    *
       
   537    *   2.6.2 (for `autofitter' module)
       
   538    *
       
   539    *   2.9 (for `type1' and `t1cid' modules)
       
   540    *
       
   541    */
       
   542 
       
   543 
       
   544   /**************************************************************************
       
   545    *
       
   546    * @property:
       
   547    *   random-seed
       
   548    *
       
   549    * @description:
       
   550    *   By default, the seed value for the CFF `random' operator and the
       
   551    *   similar `0 28 callothersubr pop' command for the Type~1 and CID
       
   552    *   drivers is set to a random value.  However, mainly for debugging
       
   553    *   purposes, it is often necessary to use a known value as a seed so
       
   554    *   that the pseudo-random number sequences generated by `random' are
       
   555    *   repeatable.
       
   556    *
       
   557    *   The `random-seed' property does that.  Its argument is a signed 32bit
       
   558    *   integer; if the value is zero or negative, the seed given by the
       
   559    *   `intitialRandomSeed' private DICT operator in a CFF file gets used
       
   560    *   (or a default value if there is no such operator).  If the value is
       
   561    *   positive, use it instead of `initialRandomSeed', which is
       
   562    *   consequently ignored.
       
   563    *
       
   564    * @note:
       
   565    *   This property can be set via the `FREETYPE_PROPERTIES' environment
       
   566    *   variable.  It can also be set per face using @FT_Face_Properties with
       
   567    *   @FT_PARAM_TAG_RANDOM_SEED.
       
   568    *
       
   569    * @since:
       
   570    *   2.8 (for `cff' module)
       
   571    *
       
   572    *   2.9 (for `type1' and `t1cid' modules)
       
   573    *
       
   574    */
       
   575 
       
   576 
       
   577   /**************************************************************************
       
   578    *
       
   579    * @property:
       
   580    *   no-long-family-names
       
   581    *
       
   582    * @description:
       
   583    *   If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling
       
   584    *   FreeType, the PCF driver constructs long family names.
       
   585    *
       
   586    *   There are many PCF fonts just called `Fixed' which look completely
       
   587    *   different, and which have nothing to do with each other.  When
       
   588    *   selecting `Fixed' in KDE or Gnome one gets results that appear rather
       
   589    *   random, the style changes often if one changes the size and one
       
   590    *   cannot select some fonts at all.  The improve this situation, the PCF
       
   591    *   module prepends the foundry name (plus a space) to the family name.
       
   592    *   It also checks whether there are `wide' characters; all put together,
       
   593    *   family names like `Sony Fixed' or `Misc Fixed Wide' are constructed.
       
   594    *
       
   595    *   If `no-long-family-names' is set, this feature gets switched off.
       
   596    *
       
   597    *   {
       
   598    *     FT_Library  library;
   606    *     FT_Library  library;
   599    *     FT_Bool     no_long_family_names = TRUE;
   607    *     FT_Bool     no_long_family_names = TRUE;
   600    *
   608    *
   601    *
   609    *
   602    *     FT_Init_FreeType( &library );
   610    *     FT_Init_FreeType( &library );
   603    *
   611    *
   604    *     FT_Property_Set( library, "pcf",
   612    *     FT_Property_Set( library, "pcf",
   605    *                               "no-long-family-names",
   613    *                               "no-long-family-names",
   606    *                               &no_long_family_names );
   614    *                               &no_long_family_names );
   607    *   }
   615    *   ```
   608    *
       
   609    * @note:
       
   610    *   This property can be used with @FT_Property_Get also.
       
   611    *
       
   612    *   This property can be set via the `FREETYPE_PROPERTIES' environment
       
   613    *   variable (using values 1 and 0 for `on' and `off', respectively).
       
   614    *
   616    *
   615    * @since:
   617    * @since:
   616    *   2.8
   618    *   2.8
   617    */
   619    */
   618 
   620 
   624    *
   626    *
   625    * @description:
   627    * @description:
   626    *   A list of constants used for the @interpreter-version property to
   628    *   A list of constants used for the @interpreter-version property to
   627    *   select the hinting engine for Truetype fonts.
   629    *   select the hinting engine for Truetype fonts.
   628    *
   630    *
   629    *   The numeric value in the constant names represents the version
   631    *   The numeric value in the constant names represents the version number
   630    *   number as returned by the `GETINFO' bytecode instruction.
   632    *   as returned by the 'GETINFO' bytecode instruction.
   631    *
   633    *
   632    * @values:
   634    * @values:
   633    *   TT_INTERPRETER_VERSION_35 ::
   635    *   TT_INTERPRETER_VERSION_35 ::
   634    *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
   636    *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
   635    *     Windows~98; only grayscale and B/W rasterizing is supported.
   637    *     Windows~98; only grayscale and B/W rasterizing is supported.
   636    *
   638    *
   637    *   TT_INTERPRETER_VERSION_38 ::
   639    *   TT_INTERPRETER_VERSION_38 ::
   638    *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly
   640    *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly
   639    *     equivalent to the hinting provided by DirectWrite ClearType (as can
   641    *     equivalent to the hinting provided by DirectWrite ClearType (as can
   640    *     be found, for example, in the Internet Explorer~9 running on
   642    *     be found, for example, in the Internet Explorer~9 running on
   641    *     Windows~7).  It is used in FreeType to select the `Infinality'
   643    *     Windows~7).  It is used in FreeType to select the 'Infinality'
   642    *     subpixel hinting code.  The code may be removed in a future
   644    *     subpixel hinting code.  The code may be removed in a future version.
   643    *     version.
       
   644    *
   645    *
   645    *   TT_INTERPRETER_VERSION_40 ::
   646    *   TT_INTERPRETER_VERSION_40 ::
   646    *     Version~40 corresponds to MS rasterizer v.2.1; it is roughly
   647    *     Version~40 corresponds to MS rasterizer v.2.1; it is roughly
   647    *     equivalent to the hinting provided by DirectWrite ClearType (as can
   648    *     equivalent to the hinting provided by DirectWrite ClearType (as can
   648    *     be found, for example, in Microsoft's Edge Browser on Windows~10).
   649    *     be found, for example, in Microsoft's Edge Browser on Windows~10).
   649    *     It is used in FreeType to select the `minimal' subpixel hinting
   650    *     It is used in FreeType to select the 'minimal' subpixel hinting
   650    *     code, a stripped-down and higher performance version of the
   651    *     code, a stripped-down and higher performance version of the
   651    *     `Infinality' code.
   652    *     'Infinality' code.
   652    *
   653    *
   653    * @note:
   654    * @note:
   654    *   This property controls the behaviour of the bytecode interpreter
   655    *   This property controls the behaviour of the bytecode interpreter and
   655    *   and thus how outlines get hinted.  It does *not* control how glyph
   656    *   thus how outlines get hinted.  It does **not** control how glyph get
   656    *   get rasterized!  In particular, it does not control subpixel color
   657    *   rasterized!  In particular, it does not control subpixel color
   657    *   filtering.
   658    *   filtering.
   658    *
   659    *
   659    *   If FreeType has not been compiled with the configuration option
   660    *   If FreeType has not been compiled with the configuration option
   660    *   TT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes
   661    *   `TT_CONFIG_OPTION_SUBPIXEL_HINTING`, selecting version~38 or~40 causes
   661    *   an `FT_Err_Unimplemented_Feature' error.
   662    *   an `FT_Err_Unimplemented_Feature` error.
   662    *
   663    *
   663    *   Depending on the graphics framework, Microsoft uses different
   664    *   Depending on the graphics framework, Microsoft uses different bytecode
   664    *   bytecode and rendering engines.  As a consequence, the version
   665    *   and rendering engines.  As a consequence, the version numbers returned
   665    *   numbers returned by a call to the `GETINFO' bytecode instruction are
   666    *   by a call to the 'GETINFO' bytecode instruction are more convoluted
   666    *   more convoluted than desired.
   667    *   than desired.
   667    *
   668    *
   668    *   Here are two tables that try to shed some light on the possible
   669    *   Here are two tables that try to shed some light on the possible values
   669    *   values for the MS rasterizer engine, together with the additional
   670    *   for the MS rasterizer engine, together with the additional features
   670    *   features introduced by it.
   671    *   introduced by it.
   671    *
   672    *
   672    *   {
   673    *   ```
   673    *     GETINFO framework               version feature
   674    *     GETINFO framework               version feature
   674    *     -------------------------------------------------------------------
   675    *     -------------------------------------------------------------------
   675    *         3   GDI (Win 3.1),            v1.0  16-bit, first version
   676    *         3   GDI (Win 3.1),            v1.0  16-bit, first version
   676    *             TrueImage
   677    *             TrueImage
   677    *        33   GDI (Win NT 3.1),         v1.5  32-bit
   678    *        33   GDI (Win NT 3.1),         v1.5  32-bit
   690    *                                               in GETINFO opcode,
   691    *                                               in GETINFO opcode,
   691    *                                             bug fixes
   692    *                                             bug fixes
   692    *        40   GDI+ (after Win 7),       v2.1  Y-direction ClearType flag
   693    *        40   GDI+ (after Win 7),       v2.1  Y-direction ClearType flag
   693    *             DWrite (Win 8)                    in GETINFO opcode,
   694    *             DWrite (Win 8)                    in GETINFO opcode,
   694    *                                             Gray ClearType
   695    *                                             Gray ClearType
   695    *   }
   696    *   ```
   696    *
   697    *
   697    *   The `version' field gives a rough orientation only, since some
   698    *   The 'version' field gives a rough orientation only, since some
   698    *   applications provided certain features much earlier (as an example,
   699    *   applications provided certain features much earlier (as an example,
   699    *   Microsoft Reader used subpixel and Y-direction ClearType already in
   700    *   Microsoft Reader used subpixel and Y-direction ClearType already in
   700    *   Windows 2000).  Similarly, updates to a given framework might include
   701    *   Windows 2000).  Similarly, updates to a given framework might include
   701    *   improved hinting support.
   702    *   improved hinting support.
   702    *
   703    *
   703    *   {
   704    *   ```
   704    *      version   sampling          rendering        comment
   705    *      version   sampling          rendering        comment
   705    *               x        y       x           y
   706    *               x        y       x           y
   706    *     --------------------------------------------------------------
   707    *     --------------------------------------------------------------
   707    *       v1.0   normal  normal  B/W           B/W    bi-level
   708    *       v1.0   normal  normal  B/W           B/W    bi-level
   708    *       v1.6   high    high    gray          gray   grayscale
   709    *       v1.6   high    high    gray          gray   grayscale
   709    *       v1.8   high    normal  color-filter  B/W    (GDI) ClearType
   710    *       v1.8   high    normal  color-filter  B/W    (GDI) ClearType
   710    *       v1.9   high    high    color-filter  gray   Color ClearType
   711    *       v1.9   high    high    color-filter  gray   Color ClearType
   711    *       v2.1   high    normal  gray          B/W    Gray ClearType
   712    *       v2.1   high    normal  gray          B/W    Gray ClearType
   712    *       v2.1   high    high    gray          gray   Gray ClearType
   713    *       v2.1   high    high    gray          gray   Gray ClearType
   713    *   }
   714    *   ```
   714    *
   715    *
   715    *   Color and Gray ClearType are the two available variants of
   716    *   Color and Gray ClearType are the two available variants of
   716    *   `Y-direction ClearType', meaning grayscale rasterization along the
   717    *   'Y-direction ClearType', meaning grayscale rasterization along the
   717    *   Y-direction; the name used in the TrueType specification for this
   718    *   Y-direction; the name used in the TrueType specification for this
   718    *   feature is `symmetric smoothing'.  `Classic ClearType' is the
   719    *   feature is 'symmetric smoothing'.  'Classic ClearType' is the original
   719    *   original algorithm used before introducing a modified version in
   720    *   algorithm used before introducing a modified version in Win~XP.
   720    *   Win~XP.  Another name for v1.6's grayscale rendering is `font
   721    *   Another name for v1.6's grayscale rendering is 'font smoothing', and
   721    *   smoothing', and `Color ClearType' is sometimes also called `DWrite
   722    *   'Color ClearType' is sometimes also called 'DWrite ClearType'.  To
   722    *   ClearType'.  To differentiate between today's Color ClearType and the
   723    *   differentiate between today's Color ClearType and the earlier
   723    *   earlier ClearType variant with B/W rendering along the vertical axis,
   724    *   ClearType variant with B/W rendering along the vertical axis, the
   724    *   the latter is sometimes called `GDI ClearType'.
   725    *   latter is sometimes called 'GDI ClearType'.
   725    *
   726    *
   726    *   `Normal' and `high' sampling describe the (virtual) resolution to
   727    *   'Normal' and 'high' sampling describe the (virtual) resolution to
   727    *   access the rasterized outline after the hinting process.  `Normal'
   728    *   access the rasterized outline after the hinting process.  'Normal'
   728    *   means 1 sample per grid line (i.e., B/W).  In the current Microsoft
   729    *   means 1 sample per grid line (i.e., B/W).  In the current Microsoft
   729    *   implementation, `high' means an extra virtual resolution of 16x16 (or
   730    *   implementation, 'high' means an extra virtual resolution of 16x16 (or
   730    *   16x1) grid lines per pixel for bytecode instructions like `MIRP'.
   731    *   16x1) grid lines per pixel for bytecode instructions like 'MIRP'.
   731    *   After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid
   732    *   After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid
   732    *   lines for color filtering if Color ClearType is activated.
   733    *   lines for color filtering if Color ClearType is activated.
   733    *
   734    *
   734    *   Note that `Gray ClearType' is essentially the same as v1.6's
   735    *   Note that 'Gray ClearType' is essentially the same as v1.6's grayscale
   735    *   grayscale rendering.  However, the GETINFO instruction handles it
   736    *   rendering.  However, the GETINFO instruction handles it differently:
   736    *   differently: v1.6 returns bit~12 (hinting for grayscale), while v2.1
   737    *   v1.6 returns bit~12 (hinting for grayscale), while v2.1 returns
   737    *   returns bits~13 (hinting for ClearType), 18 (symmetrical smoothing),
   738    *   bits~13 (hinting for ClearType), 18 (symmetrical smoothing), and~19
   738    *   and~19 (Gray ClearType).  Also, this mode respects bits 2 and~3 for
   739    *   (Gray ClearType).  Also, this mode respects bits 2 and~3 for the
   739    *   the version~1 gasp table exclusively (like Color ClearType), while
   740    *   version~1 gasp table exclusively (like Color ClearType), while v1.6
   740    *   v1.6 only respects the values of version~0 (bits 0 and~1).
   741    *   only respects the values of version~0 (bits 0 and~1).
   741    *
   742    *
   742    *   Keep in mind that the features of the above interpreter versions
   743    *   Keep in mind that the features of the above interpreter versions might
   743    *   might not map exactly to FreeType features or behavior because it is
   744    *   not map exactly to FreeType features or behavior because it is a
   744    *   a fundamentally different library with different internals.
   745    *   fundamentally different library with different internals.
   745    *
   746    *
   746    */
   747    */
   747 #define TT_INTERPRETER_VERSION_35  35
   748 #define TT_INTERPRETER_VERSION_35  35
   748 #define TT_INTERPRETER_VERSION_38  38
   749 #define TT_INTERPRETER_VERSION_38  38
   749 #define TT_INTERPRETER_VERSION_40  40
   750 #define TT_INTERPRETER_VERSION_40  40
   753    *
   754    *
   754    * @property:
   755    * @property:
   755    *   interpreter-version
   756    *   interpreter-version
   756    *
   757    *
   757    * @description:
   758    * @description:
   758    *   Currently, three versions are available, two representing the
   759    *   Currently, three versions are available, two representing the bytecode
   759    *   bytecode interpreter with subpixel hinting support (old `Infinality'
   760    *   interpreter with subpixel hinting support (old 'Infinality' code and
   760    *   code and new stripped-down and higher performance `minimal' code) and
   761    *   new stripped-down and higher performance 'minimal' code) and one
   761    *   one without, respectively.  The default is subpixel support if
   762    *   without, respectively.  The default is subpixel support if
   762    *   TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support
   763    *   `TT_CONFIG_OPTION_SUBPIXEL_HINTING` is defined, and no subpixel
   763    *   otherwise (since it isn't available then).
   764    *   support otherwise (since it isn't available then).
   764    *
   765    *
   765    *   If subpixel hinting is on, many TrueType bytecode instructions behave
   766    *   If subpixel hinting is on, many TrueType bytecode instructions behave
   766    *   differently compared to B/W or grayscale rendering (except if `native
   767    *   differently compared to B/W or grayscale rendering (except if 'native
   767    *   ClearType' is selected by the font).  Microsoft's main idea is to
   768    *   ClearType' is selected by the font).  Microsoft's main idea is to
   768    *   render at a much increased horizontal resolution, then sampling down
   769    *   render at a much increased horizontal resolution, then sampling down
   769    *   the created output to subpixel precision.  However, many older fonts
   770    *   the created output to subpixel precision.  However, many older fonts
   770    *   are not suited to this and must be specially taken care of by
   771    *   are not suited to this and must be specially taken care of by applying
   771    *   applying (hardcoded) tweaks in Microsoft's interpreter.
   772    *   (hardcoded) tweaks in Microsoft's interpreter.
   772    *
   773    *
   773    *   Details on subpixel hinting and some of the necessary tweaks can be
   774    *   Details on subpixel hinting and some of the necessary tweaks can be
   774    *   found in Greg Hitchcock's whitepaper at
   775    *   found in Greg Hitchcock's whitepaper at
   775    *   `https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
   776    *   'https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
   776    *   Note that FreeType currently doesn't really `subpixel hint' (6x1, 6x2,
   777    *   Note that FreeType currently doesn't really 'subpixel hint' (6x1, 6x2,
   777    *   or 6x5 supersampling) like discussed in the paper.  Depending on the
   778    *   or 6x5 supersampling) like discussed in the paper.  Depending on the
   778    *   chosen interpreter, it simply ignores instructions on vertical stems
   779    *   chosen interpreter, it simply ignores instructions on vertical stems
   779    *   to arrive at very similar results.
   780    *   to arrive at very similar results.
   780    *
   781    *
       
   782    * @note:
       
   783    *   This property can be used with @FT_Property_Get also.
       
   784    *
       
   785    *   This property can be set via the `FREETYPE_PROPERTIES` environment
       
   786    *   variable (using values '35', '38', or '40').
       
   787    *
       
   788    * @example:
   781    *   The following example code demonstrates how to deactivate subpixel
   789    *   The following example code demonstrates how to deactivate subpixel
   782    *   hinting (omitting the error handling).
   790    *   hinting (omitting the error handling).
   783    *
   791    *
   784    *   {
   792    *   ```
   785    *     FT_Library  library;
   793    *     FT_Library  library;
   786    *     FT_Face     face;
   794    *     FT_Face     face;
   787    *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_35;
   795    *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_35;
   788    *
   796    *
   789    *
   797    *
   790    *     FT_Init_FreeType( &library );
   798    *     FT_Init_FreeType( &library );
   791    *
   799    *
   792    *     FT_Property_Set( library, "truetype",
   800    *     FT_Property_Set( library, "truetype",
   793    *                               "interpreter-version",
   801    *                               "interpreter-version",
   794    *                               &interpreter_version );
   802    *                               &interpreter_version );
   795    *   }
   803    *   ```
   796    *
       
   797    * @note:
       
   798    *   This property can be used with @FT_Property_Get also.
       
   799    *
       
   800    *   This property can be set via the `FREETYPE_PROPERTIES' environment
       
   801    *   variable (using values `35', `38', or `40').
       
   802    *
   804    *
   803    * @since:
   805    * @since:
   804    *   2.5
   806    *   2.5
   805    */
   807    */
   806 
   808 
   809    *
   811    *
   810    * @property:
   812    * @property:
   811    *   glyph-to-script-map
   813    *   glyph-to-script-map
   812    *
   814    *
   813    * @description:
   815    * @description:
   814    *   *Experimental* *only*
   816    *   **Experimental only**
   815    *
   817    *
   816    *   The auto-hinter provides various script modules to hint glyphs.
   818    *   The auto-hinter provides various script modules to hint glyphs.
   817    *   Examples of supported scripts are Latin or CJK.  Before a glyph is
   819    *   Examples of supported scripts are Latin or CJK.  Before a glyph is
   818    *   auto-hinted, the Unicode character map of the font gets examined, and
   820    *   auto-hinted, the Unicode character map of the font gets examined, and
   819    *   the script is then determined based on Unicode character ranges, see
   821    *   the script is then determined based on Unicode character ranges, see
   820    *   below.
   822    *   below.
   821    *
   823    *
   822    *   OpenType fonts, however, often provide much more glyphs than
   824    *   OpenType fonts, however, often provide much more glyphs than character
   823    *   character codes (small caps, superscripts, ligatures, swashes, etc.),
   825    *   codes (small caps, superscripts, ligatures, swashes, etc.), to be
   824    *   to be controlled by so-called `features'.  Handling OpenType features
   826    *   controlled by so-called 'features'.  Handling OpenType features can be
   825    *   can be quite complicated and thus needs a separate library on top of
   827    *   quite complicated and thus needs a separate library on top of
   826    *   FreeType.
   828    *   FreeType.
   827    *
   829    *
   828    *   The mapping between glyph indices and scripts (in the auto-hinter
   830    *   The mapping between glyph indices and scripts (in the auto-hinter
   829    *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
   831    *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an array
   830    *   array with `num_glyphs' elements, as found in the font's @FT_Face
   832    *   with `num_glyphs` elements, as found in the font's @FT_Face structure.
   831    *   structure.  The `glyph-to-script-map' property returns a pointer to
   833    *   The `glyph-to-script-map` property returns a pointer to this array,
   832    *   this array, which can be modified as needed.  Note that the
   834    *   which can be modified as needed.  Note that the modification should
   833    *   modification should happen before the first glyph gets processed by
   835    *   happen before the first glyph gets processed by the auto-hinter so
   834    *   the auto-hinter so that the global analysis of the font shapes
   836    *   that the global analysis of the font shapes actually uses the modified
   835    *   actually uses the modified mapping.
   837    *   mapping.
   836    *
   838    *
   837    *   The following example code demonstrates how to access it (omitting
   839    * @example:
   838    *   the error handling).
   840    *   The following example code demonstrates how to access it (omitting the
   839    *
   841    *   error handling).
   840    *   {
   842    *
       
   843    *   ```
   841    *     FT_Library                library;
   844    *     FT_Library                library;
   842    *     FT_Face                   face;
   845    *     FT_Face                   face;
   843    *     FT_Prop_GlyphToScriptMap  prop;
   846    *     FT_Prop_GlyphToScriptMap  prop;
   844    *
   847    *
   845    *
   848    *
   852    *                               "glyph-to-script-map", &prop );
   855    *                               "glyph-to-script-map", &prop );
   853    *
   856    *
   854    *     // adjust `prop.map' as needed right here
   857    *     // adjust `prop.map' as needed right here
   855    *
   858    *
   856    *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
   859    *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
   857    *   }
   860    *   ```
   858    *
   861    *
   859    * @since:
   862    * @since:
   860    *   2.4.11
   863    *   2.4.11
   861    *
   864    *
   862    */
   865    */
   866    *
   869    *
   867    * @enum:
   870    * @enum:
   868    *   FT_AUTOHINTER_SCRIPT_XXX
   871    *   FT_AUTOHINTER_SCRIPT_XXX
   869    *
   872    *
   870    * @description:
   873    * @description:
   871    *   *Experimental* *only*
   874    *   **Experimental only**
   872    *
   875    *
   873    *   A list of constants used for the @glyph-to-script-map property to
   876    *   A list of constants used for the @glyph-to-script-map property to
   874    *   specify the script submodule the auto-hinter should use for hinting a
   877    *   specify the script submodule the auto-hinter should use for hinting a
   875    *   particular glyph.
   878    *   particular glyph.
   876    *
   879    *
   877    * @values:
   880    * @values:
   878    *   FT_AUTOHINTER_SCRIPT_NONE ::
   881    *   FT_AUTOHINTER_SCRIPT_NONE ::
   879    *     Don't auto-hint this glyph.
   882    *     Don't auto-hint this glyph.
   880    *
   883    *
   881    *   FT_AUTOHINTER_SCRIPT_LATIN ::
   884    *   FT_AUTOHINTER_SCRIPT_LATIN ::
   882    *     Apply the latin auto-hinter.  For the auto-hinter, `latin' is a
   885    *     Apply the latin auto-hinter.  For the auto-hinter, 'latin' is a very
   883    *     very broad term, including Cyrillic and Greek also since characters
   886    *     broad term, including Cyrillic and Greek also since characters from
   884    *     from those scripts share the same design constraints.
   887    *     those scripts share the same design constraints.
   885    *
   888    *
   886    *     By default, characters from the following Unicode ranges are
   889    *     By default, characters from the following Unicode ranges are
   887    *     assigned to this submodule.
   890    *     assigned to this submodule.
   888    *
   891    *
   889    *     {
   892    *     ```
   890    *       U+0020 - U+007F  // Basic Latin (no control characters)
   893    *       U+0020 - U+007F  // Basic Latin (no control characters)
   891    *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)
   894    *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)
   892    *       U+0100 - U+017F  // Latin Extended-A
   895    *       U+0100 - U+017F  // Latin Extended-A
   893    *       U+0180 - U+024F  // Latin Extended-B
   896    *       U+0180 - U+024F  // Latin Extended-B
   894    *       U+0250 - U+02AF  // IPA Extensions
   897    *       U+0250 - U+02AF  // IPA Extensions
   913    *       U+A640 - U+A69F  // Cyrillic Extended-B
   916    *       U+A640 - U+A69F  // Cyrillic Extended-B
   914    *       U+A720 - U+A7FF  // Latin Extended-D
   917    *       U+A720 - U+A7FF  // Latin Extended-D
   915    *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)
   918    *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)
   916    *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
   919    *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
   917    *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
   920    *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
   918    *     }
   921    *     ```
   919    *
   922    *
   920    *   FT_AUTOHINTER_SCRIPT_CJK ::
   923    *   FT_AUTOHINTER_SCRIPT_CJK ::
   921    *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
   924    *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
   922    *     Vietnamese, and some other scripts.
   925    *     Vietnamese, and some other scripts.
   923    *
   926    *
   924    *     By default, characters from the following Unicode ranges are
   927    *     By default, characters from the following Unicode ranges are
   925    *     assigned to this submodule.
   928    *     assigned to this submodule.
   926    *
   929    *
   927    *     {
   930    *     ```
   928    *       U+1100 - U+11FF  // Hangul Jamo
   931    *       U+1100 - U+11FF  // Hangul Jamo
   929    *       U+2E80 - U+2EFF  // CJK Radicals Supplement
   932    *       U+2E80 - U+2EFF  // CJK Radicals Supplement
   930    *       U+2F00 - U+2FDF  // Kangxi Radicals
   933    *       U+2F00 - U+2FDF  // Kangxi Radicals
   931    *       U+2FF0 - U+2FFF  // Ideographic Description Characters
   934    *       U+2FF0 - U+2FFF  // Ideographic Description Characters
   932    *       U+3000 - U+303F  // CJK Symbols and Punctuation
   935    *       U+3000 - U+303F  // CJK Symbols and Punctuation
   955    *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
   958    *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
   956    *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
   959    *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
   957    *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
   960    *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
   958    *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
   961    *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
   959    *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
   962    *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
   960    *     }
   963    *     ```
   961    *
   964    *
   962    *   FT_AUTOHINTER_SCRIPT_INDIC ::
   965    *   FT_AUTOHINTER_SCRIPT_INDIC ::
   963    *     Apply the indic auto-hinter, covering all major scripts from the
   966    *     Apply the indic auto-hinter, covering all major scripts from the
   964    *     Indian sub-continent and some other related scripts like Thai, Lao,
   967    *     Indian sub-continent and some other related scripts like Thai, Lao,
   965    *     or Tibetan.
   968    *     or Tibetan.
   966    *
   969    *
   967    *     By default, characters from the following Unicode ranges are
   970    *     By default, characters from the following Unicode ranges are
   968    *     assigned to this submodule.
   971    *     assigned to this submodule.
   969    *
   972    *
   970    *     {
   973    *     ```
   971    *       U+0900 - U+0DFF  // Indic Range
   974    *       U+0900 - U+0DFF  // Indic Range
   972    *       U+0F00 - U+0FFF  // Tibetan
   975    *       U+0F00 - U+0FFF  // Tibetan
   973    *       U+1900 - U+194F  // Limbu
   976    *       U+1900 - U+194F  // Limbu
   974    *       U+1B80 - U+1BBF  // Sundanese
   977    *       U+1B80 - U+1BBF  // Sundanese
   975    *       U+A800 - U+A82F  // Syloti Nagri
   978    *       U+A800 - U+A82F  // Syloti Nagri
   976    *       U+ABC0 - U+ABFF  // Meetei Mayek
   979    *       U+ABC0 - U+ABFF  // Meetei Mayek
   977    *      U+11800 - U+118DF // Sharada
   980    *      U+11800 - U+118DF // Sharada
   978    *     }
   981    *     ```
   979    *
   982    *
   980    *     Note that currently Indic support is rudimentary only, missing blue
   983    *     Note that currently Indic support is rudimentary only, missing blue
   981    *     zone support.
   984    *     zone support.
   982    *
   985    *
   983    * @since:
   986    * @since:
   994    *
   997    *
   995    * @struct:
   998    * @struct:
   996    *   FT_Prop_GlyphToScriptMap
   999    *   FT_Prop_GlyphToScriptMap
   997    *
  1000    *
   998    * @description:
  1001    * @description:
   999    *   *Experimental* *only*
  1002    *   **Experimental only**
  1000    *
  1003    *
  1001    *   The data exchange structure for the @glyph-to-script-map property.
  1004    *   The data exchange structure for the @glyph-to-script-map property.
  1002    *
  1005    *
  1003    * @since:
  1006    * @since:
  1004    *   2.4.11
  1007    *   2.4.11
  1016    *
  1019    *
  1017    * @property:
  1020    * @property:
  1018    *   fallback-script
  1021    *   fallback-script
  1019    *
  1022    *
  1020    * @description:
  1023    * @description:
  1021    *   *Experimental* *only*
  1024    *   **Experimental only**
  1022    *
  1025    *
  1023    *   If no auto-hinter script module can be assigned to a glyph, a
  1026    *   If no auto-hinter script module can be assigned to a glyph, a fallback
  1024    *   fallback script gets assigned to it (see also the
  1027    *   script gets assigned to it (see also the @glyph-to-script-map
  1025    *   @glyph-to-script-map property).  By default, this is
  1028    *   property).  By default, this is @FT_AUTOHINTER_SCRIPT_CJK.  Using the
  1026    *   @FT_AUTOHINTER_SCRIPT_CJK.  Using the `fallback-script' property,
  1029    *   `fallback-script` property, this fallback value can be changed.
  1027    *   this fallback value can be changed.
       
  1028    *
       
  1029    *   {
       
  1030    *     FT_Library  library;
       
  1031    *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
       
  1032    *
       
  1033    *
       
  1034    *     FT_Init_FreeType( &library );
       
  1035    *
       
  1036    *     FT_Property_Set( library, "autofitter",
       
  1037    *                               "fallback-script", &fallback_script );
       
  1038    *   }
       
  1039    *
  1030    *
  1040    * @note:
  1031    * @note:
  1041    *   This property can be used with @FT_Property_Get also.
  1032    *   This property can be used with @FT_Property_Get also.
  1042    *
  1033    *
  1043    *   It's important to use the right timing for changing this value: The
  1034    *   It's important to use the right timing for changing this value: The
  1044    *   creation of the glyph-to-script map that eventually uses the
  1035    *   creation of the glyph-to-script map that eventually uses the fallback
  1045    *   fallback script value gets triggered either by setting or reading a
  1036    *   script value gets triggered either by setting or reading a
  1046    *   face-specific property like @glyph-to-script-map, or by auto-hinting
  1037    *   face-specific property like @glyph-to-script-map, or by auto-hinting
  1047    *   any glyph from that face.  In particular, if you have already created
  1038    *   any glyph from that face.  In particular, if you have already created
  1048    *   an @FT_Face structure but not loaded any glyph (using the
  1039    *   an @FT_Face structure but not loaded any glyph (using the
  1049    *   auto-hinter), a change of the fallback script will affect this face.
  1040    *   auto-hinter), a change of the fallback script will affect this face.
  1050    *
  1041    *
       
  1042    * @example:
       
  1043    *   ```
       
  1044    *     FT_Library  library;
       
  1045    *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
       
  1046    *
       
  1047    *
       
  1048    *     FT_Init_FreeType( &library );
       
  1049    *
       
  1050    *     FT_Property_Set( library, "autofitter",
       
  1051    *                               "fallback-script", &fallback_script );
       
  1052    *   ```
       
  1053    *
  1051    * @since:
  1054    * @since:
  1052    *   2.4.11
  1055    *   2.4.11
  1053    *
  1056    *
  1054    */
  1057    */
  1055 
  1058 
  1058    *
  1061    *
  1059    * @property:
  1062    * @property:
  1060    *   default-script
  1063    *   default-script
  1061    *
  1064    *
  1062    * @description:
  1065    * @description:
  1063    *   *Experimental* *only*
  1066    *   **Experimental only**
  1064    *
  1067    *
  1065    *   If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
  1068    *   If FreeType gets compiled with `FT_CONFIG_OPTION_USE_HARFBUZZ` to make
  1066    *   the HarfBuzz library access OpenType features for getting better
  1069    *   the HarfBuzz library access OpenType features for getting better glyph
  1067    *   glyph coverages, this property sets the (auto-fitter) script to be
  1070    *   coverages, this property sets the (auto-fitter) script to be used for
  1068    *   used for the default (OpenType) script data of a font's GSUB table.
  1071    *   the default (OpenType) script data of a font's GSUB table.  Features
  1069    *   Features for the default script are intended for all scripts not
  1072    *   for the default script are intended for all scripts not explicitly
  1070    *   explicitly handled in GSUB; an example is a `dlig' feature,
  1073    *   handled in GSUB; an example is a 'dlig' feature, containing the
  1071    *   containing the combination of the characters `T', `E', and `L' to
  1074    *   combination of the characters 'T', 'E', and 'L' to form a 'TEL'
  1072    *   form a `TEL' ligature.
  1075    *   ligature.
  1073    *
  1076    *
  1074    *   By default, this is @FT_AUTOHINTER_SCRIPT_LATIN.  Using the
  1077    *   By default, this is @FT_AUTOHINTER_SCRIPT_LATIN.  Using the
  1075    *   `default-script' property, this default value can be changed.
  1078    *   `default-script` property, this default value can be changed.
  1076    *
       
  1077    *   {
       
  1078    *     FT_Library  library;
       
  1079    *     FT_UInt     default_script = FT_AUTOHINTER_SCRIPT_NONE;
       
  1080    *
       
  1081    *
       
  1082    *     FT_Init_FreeType( &library );
       
  1083    *
       
  1084    *     FT_Property_Set( library, "autofitter",
       
  1085    *                               "default-script", &default_script );
       
  1086    *   }
       
  1087    *
  1079    *
  1088    * @note:
  1080    * @note:
  1089    *   This property can be used with @FT_Property_Get also.
  1081    *   This property can be used with @FT_Property_Get also.
  1090    *
  1082    *
  1091    *   It's important to use the right timing for changing this value: The
  1083    *   It's important to use the right timing for changing this value: The
  1092    *   creation of the glyph-to-script map that eventually uses the
  1084    *   creation of the glyph-to-script map that eventually uses the default
  1093    *   default script value gets triggered either by setting or reading a
  1085    *   script value gets triggered either by setting or reading a
  1094    *   face-specific property like @glyph-to-script-map, or by auto-hinting
  1086    *   face-specific property like @glyph-to-script-map, or by auto-hinting
  1095    *   any glyph from that face.  In particular, if you have already created
  1087    *   any glyph from that face.  In particular, if you have already created
  1096    *   an @FT_Face structure but not loaded any glyph (using the
  1088    *   an @FT_Face structure but not loaded any glyph (using the
  1097    *   auto-hinter), a change of the default script will affect this face.
  1089    *   auto-hinter), a change of the default script will affect this face.
  1098    *
  1090    *
       
  1091    * @example:
       
  1092    *   ```
       
  1093    *     FT_Library  library;
       
  1094    *     FT_UInt     default_script = FT_AUTOHINTER_SCRIPT_NONE;
       
  1095    *
       
  1096    *
       
  1097    *     FT_Init_FreeType( &library );
       
  1098    *
       
  1099    *     FT_Property_Set( library, "autofitter",
       
  1100    *                               "default-script", &default_script );
       
  1101    *   ```
       
  1102    *
  1099    * @since:
  1103    * @since:
  1100    *   2.5.3
  1104    *   2.5.3
  1101    *
  1105    *
  1102    */
  1106    */
  1103 
  1107 
  1106    *
  1110    *
  1107    * @property:
  1111    * @property:
  1108    *   increase-x-height
  1112    *   increase-x-height
  1109    *
  1113    *
  1110    * @description:
  1114    * @description:
  1111    *   For ppem values in the range 6~<= ppem <= `increase-x-height', round
  1115    *   For ppem values in the range 6~<= ppem <= `increase-x-height`, round
  1112    *   up the font's x~height much more often than normally.  If the value
  1116    *   up the font's x~height much more often than normally.  If the value is
  1113    *   is set to~0, which is the default, this feature is switched off.  Use
  1117    *   set to~0, which is the default, this feature is switched off.  Use
  1114    *   this property to improve the legibility of small font sizes if
  1118    *   this property to improve the legibility of small font sizes if
  1115    *   necessary.
  1119    *   necessary.
  1116    *
  1120    *
  1117    *   {
  1121    * @note:
       
  1122    *   This property can be used with @FT_Property_Get also.
       
  1123    *
       
  1124    *   Set this value right after calling @FT_Set_Char_Size, but before
       
  1125    *   loading any glyph (using the auto-hinter).
       
  1126    *
       
  1127    * @example:
       
  1128    *   ```
  1118    *     FT_Library               library;
  1129    *     FT_Library               library;
  1119    *     FT_Face                  face;
  1130    *     FT_Face                  face;
  1120    *     FT_Prop_IncreaseXHeight  prop;
  1131    *     FT_Prop_IncreaseXHeight  prop;
  1121    *
  1132    *
  1122    *
  1133    *
  1127    *     prop.face  = face;
  1138    *     prop.face  = face;
  1128    *     prop.limit = 14;
  1139    *     prop.limit = 14;
  1129    *
  1140    *
  1130    *     FT_Property_Set( library, "autofitter",
  1141    *     FT_Property_Set( library, "autofitter",
  1131    *                               "increase-x-height", &prop );
  1142    *                               "increase-x-height", &prop );
  1132    *   }
  1143    *   ```
  1133    *
       
  1134    * @note:
       
  1135    *   This property can be used with @FT_Property_Get also.
       
  1136    *
       
  1137    *   Set this value right after calling @FT_Set_Char_Size, but before
       
  1138    *   loading any glyph (using the auto-hinter).
       
  1139    *
  1144    *
  1140    * @since:
  1145    * @since:
  1141    *   2.4.11
  1146    *   2.4.11
  1142    *
  1147    *
  1143    */
  1148    */
  1164    *
  1169    *
  1165    * @property:
  1170    * @property:
  1166    *   warping
  1171    *   warping
  1167    *
  1172    *
  1168    * @description:
  1173    * @description:
  1169    *   *Experimental* *only*
  1174    *   **Experimental only**
  1170    *
  1175    *
  1171    *   If FreeType gets compiled with option AF_CONFIG_OPTION_USE_WARPER to
  1176    *   If FreeType gets compiled with option `AF_CONFIG_OPTION_USE_WARPER` to
  1172    *   activate the warp hinting code in the auto-hinter, this property
  1177    *   activate the warp hinting code in the auto-hinter, this property
  1173    *   switches warping on and off.
  1178    *   switches warping on and off.
  1174    *
  1179    *
  1175    *   Warping only works in `normal' auto-hinting mode replacing it.
  1180    *   Warping only works in 'normal' auto-hinting mode replacing it.  The
  1176    *   The idea of the code is to slightly scale and shift a glyph along
  1181    *   idea of the code is to slightly scale and shift a glyph along the
  1177    *   the non-hinted dimension (which is usually the horizontal axis) so
  1182    *   non-hinted dimension (which is usually the horizontal axis) so that as
  1178    *   that as much of its segments are aligned (more or less) to the grid.
  1183    *   much of its segments are aligned (more or less) to the grid.  To find
  1179    *   To find out a glyph's optimal scaling and shifting value, various
  1184    *   out a glyph's optimal scaling and shifting value, various parameter
  1180    *   parameter combinations are tried and scored.
  1185    *   combinations are tried and scored.
  1181    *
  1186    *
  1182    *   By default, warping is off.  The example below shows how to switch on
  1187    *   By default, warping is off.
  1183    *   warping (omitting the error handling).
  1188    *
  1184    *
  1189    * @note:
  1185    *   {
  1190    *   This property can be used with @FT_Property_Get also.
       
  1191    *
       
  1192    *   This property can be set via the `FREETYPE_PROPERTIES` environment
       
  1193    *   variable (using values 1 and 0 for 'on' and 'off', respectively).
       
  1194    *
       
  1195    *   The warping code can also change advance widths.  Have a look at the
       
  1196    *   `lsb_delta` and `rsb_delta` fields in the @FT_GlyphSlotRec structure
       
  1197    *   for details on improving inter-glyph distances while rendering.
       
  1198    *
       
  1199    *   Since warping is a global property of the auto-hinter it is best to
       
  1200    *   change its value before rendering any face.  Otherwise, you should
       
  1201    *   reload all faces that get auto-hinted in 'normal' hinting mode.
       
  1202    *
       
  1203    * @example:
       
  1204    *   This example shows how to switch on warping (omitting the error
       
  1205    *   handling).
       
  1206    *
       
  1207    *   ```
  1186    *     FT_Library  library;
  1208    *     FT_Library  library;
  1187    *     FT_Bool     warping = 1;
  1209    *     FT_Bool     warping = 1;
  1188    *
  1210    *
  1189    *
  1211    *
  1190    *     FT_Init_FreeType( &library );
  1212    *     FT_Init_FreeType( &library );
  1191    *
  1213    *
  1192    *     FT_Property_Set( library, "autofitter",
  1214    *     FT_Property_Set( library, "autofitter", "warping", &warping );
  1193    *                               "warping", &warping );
  1215    *   ```
  1194    *   }
       
  1195    *
       
  1196    * @note:
       
  1197    *   This property can be used with @FT_Property_Get also.
       
  1198    *
       
  1199    *   This property can be set via the `FREETYPE_PROPERTIES' environment
       
  1200    *   variable (using values 1 and 0 for `on' and `off', respectively).
       
  1201    *
       
  1202    *   The warping code can also change advance widths.  Have a look at the
       
  1203    *   `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure
       
  1204    *   for details on improving inter-glyph distances while rendering.
       
  1205    *
       
  1206    *   Since warping is a global property of the auto-hinter it is best to
       
  1207    *   change its value before rendering any face.  Otherwise, you should
       
  1208    *   reload all faces that get auto-hinted in `normal' hinting mode.
       
  1209    *
  1216    *
  1210    * @since:
  1217    * @since:
  1211    *   2.6
  1218    *   2.6
  1212    *
  1219    *
  1213    */
  1220    */