1 /***************************************************************************/
5 /* Auto-fitter routines to compute global hinting values */
8 /* Copyright 2003-2005, 2007, 2009, 2011-2014 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 /***************************************************************************/
20 #ifndef __AFGLOBAL_H__
21 #define __AFGLOBAL_H__
32 FT_LOCAL_ARRAY( AF_WritingSystemClass )
33 af_writing_system_classes[];
37 #define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \
38 AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )
42 FT_LOCAL_ARRAY( AF_ScriptClass )
47 #define STYLE( s, S, d, ws, sc, ss, c ) \
48 AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )
52 FT_LOCAL_ARRAY( AF_StyleClass )
56 #ifdef FT_DEBUG_LEVEL_TRACE
57 FT_LOCAL_ARRAY( char* )
63 * Default values and flags for both autofitter globals (found in
64 * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
67 /* index of fallback style in `af_style_classes' */
68 #ifdef AF_CONFIG_OPTION_CJK
69 #define AF_STYLE_FALLBACK AF_STYLE_HANI_DFLT
71 #define AF_STYLE_FALLBACK AF_STYLE_NONE_DFLT
73 /* default script for OpenType; ignored if HarfBuzz isn't used */
74 #define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN
75 /* a bit mask indicating an uncovered glyph */
76 #define AF_STYLE_UNASSIGNED 0x7F
77 /* if this flag is set, we have an ASCII digit */
80 /* `increase-x-height' property */
81 #define AF_PROP_INCREASE_X_HEIGHT_MIN 6
82 #define AF_PROP_INCREASE_X_HEIGHT_MAX 0
85 /************************************************************************/
86 /************************************************************************/
88 /***** F A C E G L O B A L S *****/
90 /************************************************************************/
91 /************************************************************************/
95 * Note that glyph_styles[] maps each glyph to an index into the
96 * `af_style_classes' array.
99 typedef struct AF_FaceGlobalsRec_
102 FT_Long glyph_count; /* same as face->num_glyphs */
103 FT_Byte* glyph_styles;
105 #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
109 /* per-face auto-hinter properties */
110 FT_UInt increase_x_height;
112 AF_StyleMetrics metrics[AF_STYLE_MAX];
114 AF_Module module; /* to access global properties */
120 * model the global hints data for a given face, decomposed into
121 * style-specific items
125 af_face_globals_new( FT_Face face,
126 AF_FaceGlobals *aglobals,
130 af_face_globals_get_metrics( AF_FaceGlobals globals,
133 AF_StyleMetrics *ametrics );
136 af_face_globals_free( AF_FaceGlobals globals );
138 FT_LOCAL_DEF( FT_Bool )
139 af_face_globals_is_digit( AF_FaceGlobals globals,
147 #endif /* __AFGLOBAL_H__ */