1 /***************************************************************************/
5 /* FreeType API for controlling the TrueType driver */
6 /* (specification only). */
8 /* Copyright 2013 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
11 /* This file is part of the FreeType project, and may only be used, */
12 /* modified, and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
17 /***************************************************************************/
24 #include FT_FREETYPE_H
27 #error "freetype.h of FreeType 1 has been loaded!"
28 #error "Please fix the directory search order for header files"
29 #error "so that freetype.h of FreeType 2 is found first."
36 /**************************************************************************
45 * Controlling the TrueType driver module.
48 * While FreeType's TrueType driver doesn't expose API functions by
49 * itself, it is possible to control its behaviour with @FT_Property_Set
50 * and @FT_Property_Get. The following lists the available properties
51 * together with the necessary macros and structures.
53 * The TrueType driver's module name is `truetype'.
58 /**************************************************************************
64 * Currently, two versions are available which represent the bytecode
65 * interpreter with and without subpixel hinting support,
66 * respectively. The default is subpixel support if
67 * TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel
68 * support otherwise (since it isn't available then).
70 * If subpixel hinting is on, many TrueType bytecode instructions
71 * behave differently compared to B/W or grayscale rendering. The
72 * main idea is to render at a much increased horizontal resolution,
73 * then sampling down the created output to subpixel precision.
74 * However, many older fonts are not suited to this and must be
75 * specially taken care of by applying (hardcoded) font-specific
78 * Details on subpixel hinting and some of the necessary tweaks can be
79 * found in Greg Hitchcock's whitepaper at
80 * `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
82 * The following example code demonstrates how to activate subpixel
83 * hinting (omitting the error handling).
88 * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_38;
91 * FT_Init_FreeType( &library );
93 * FT_Property_Set( library, "truetype",
94 * "interpreter-version",
95 * &interpreter_version );
99 * This property can be used with @FT_Property_Get also.
104 /**************************************************************************
107 * TT_INTERPRETER_VERSION_XXX
110 * A list of constants used for the @interpreter-version property to
111 * select the hinting engine for Truetype fonts.
113 * The numeric value in the constant names represents the version
114 * number as returned by the `GETINFO' bytecode instruction.
117 * TT_INTERPRETER_VERSION_35 ::
118 * Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
119 * Windows~98; only grayscale and B/W rasterizing is supported.
121 * TT_INTERPRETER_VERSION_38 ::
122 * Version~38 corresponds to MS rasterizer v.1.9; it is roughly
123 * equivalent to the hinting provided by DirectWrite ClearType (as
124 * can be found, for example, in the Internet Explorer~9 running on
128 * This property controls the behaviour of the bytecode interpreter
129 * and thus how outlines get hinted. It does *not* control how glyph
130 * get rasterized! In particular, it does not control subpixel color
133 * If FreeType has not been compiled with configuration option
134 * FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
135 * `FT_Err_Unimplemented_Feature' error.
138 #define TT_INTERPRETER_VERSION_35 35
139 #define TT_INTERPRETER_VERSION_38 38
147 #endif /* __FTTTDRV_H__ */