1 /***************************************************************************/
5 /* FreeType API for controlling the CFF driver (specification only). */
7 /* Copyright 2013 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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 */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
19 #ifndef __FTCFFDRV_H__
20 #define __FTCFFDRV_H__
23 #include FT_FREETYPE_H
26 #error "freetype.h of FreeType 1 has been loaded!"
27 #error "Please fix the directory search order for header files"
28 #error "so that freetype.h of FreeType 2 is found first."
35 /**************************************************************************
44 * Controlling the CFF driver module.
47 * While FreeType's CFF driver doesn't expose API functions by itself,
48 * it is possible to control its behaviour with @FT_Property_Set and
49 * @FT_Property_Get. The following lists the available properties
50 * together with the necessary macros and structures.
52 * The CFF driver's module name is `cff'.
57 /**************************************************************************
63 * Thanks to Adobe, which contributed a new hinting (and parsing)
64 * engine, an application can select between `freetype' and `adobe' if
65 * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
66 * macro isn't defined, `hinting-engine' does nothing.
68 * The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
69 * defined, and `adobe' otherwise.
71 * The following example code demonstrates how to select Adobe's hinting
72 * engine (omitting the error handling).
77 * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
80 * FT_Init_FreeType( &library );
82 * FT_Property_Set( library, "cff",
83 * "hinting-engine", &hinting_engine );
87 * This property can be used with @FT_Property_Get also.
92 /**************************************************************************
98 * A list of constants used for the @hinting-engine property to select
99 * the hinting engine for CFF fonts.
102 * FT_CFF_HINTING_FREETYPE ::
103 * Use the old FreeType hinting engine.
105 * FT_CFF_HINTING_ADOBE ::
106 * Use the hinting engine contributed by Adobe.
109 #define FT_CFF_HINTING_FREETYPE 0
110 #define FT_CFF_HINTING_ADOBE 1
113 /**************************************************************************
119 * By default, the Adobe CFF engine darkens stems at smaller sizes,
120 * regardless of hinting, to enhance contrast. Setting this property,
121 * stem darkening gets switched off.
123 * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
126 * FT_Library library;
128 * FT_Bool no_stem_darkening = TRUE;
131 * FT_Init_FreeType( &library );
133 * FT_Property_Set( library, "cff",
134 * "no-stem-darkening", &no_stem_darkening );
138 * This property can be used with @FT_Property_Get also.
148 #endif /* __FTCFFDRV_H__ */