1 /***************************************************************************/
5 /* Auto-fitter routines to compute global hinting values */
8 /* Copyright 2003-2005, 2007, 2009, 2011-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 /***************************************************************************/
20 #ifndef __AFGLOBAL_H__
21 #define __AFGLOBAL_H__
31 FT_LOCAL_ARRAY( AF_WritingSystemClass
)
32 af_writing_system_classes
[];
34 FT_LOCAL_ARRAY( AF_ScriptClass
)
37 #ifdef FT_DEBUG_LEVEL_TRACE
38 FT_LOCAL_ARRAY( char* )
43 * Default values and flags for both autofitter globals (found in
44 * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
47 /* index of fallback script in `af_script_classes' */
48 #ifdef AF_CONFIG_OPTION_CJK
49 #define AF_SCRIPT_FALLBACK AF_SCRIPT_HANI
51 #define AF_SCRIPT_FALLBACK AF_SCRIPT_DFLT
53 /* a bit mask indicating an uncovered glyph */
54 #define AF_SCRIPT_NONE 0x7F
55 /* if this flag is set, we have an ASCII digit */
58 /* `increase-x-height' property */
59 #define AF_PROP_INCREASE_X_HEIGHT_MIN 6
60 #define AF_PROP_INCREASE_X_HEIGHT_MAX 0
63 /************************************************************************/
64 /************************************************************************/
66 /***** F A C E G L O B A L S *****/
68 /************************************************************************/
69 /************************************************************************/
73 * Note that glyph_scripts[] maps each glyph to an index into the
74 * `af_script_classes' array.
77 typedef struct AF_FaceGlobalsRec_
80 FT_Long glyph_count
; /* same as face->num_glyphs */
81 FT_Byte
* glyph_scripts
;
83 /* per-face auto-hinter properties */
84 FT_UInt increase_x_height
;
86 AF_ScriptMetrics metrics
[AF_SCRIPT_MAX
];
88 AF_Module module
; /* to access global properties */
94 * model the global hints data for a given face, decomposed into
95 * script-specific items
99 af_face_globals_new( FT_Face face
,
100 AF_FaceGlobals
*aglobals
,
104 af_face_globals_get_metrics( AF_FaceGlobals globals
,
107 AF_ScriptMetrics
*ametrics
);
110 af_face_globals_free( AF_FaceGlobals globals
);
112 FT_LOCAL_DEF( FT_Bool
)
113 af_face_globals_is_digit( AF_FaceGlobals globals
,
121 #endif /* __AFGLOBAL_H__ */