* Sync up to trunk HEAD (r62502).
[reactos.git] / lib / 3rdparty / freetype / src / autofit / afglobal.h
1 /***************************************************************************/
2 /* */
3 /* afglobal.h */
4 /* */
5 /* Auto-fitter routines to compute global hinting values */
6 /* (specification). */
7 /* */
8 /* Copyright 2003-2005, 2007, 2009, 2011-2013 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* */
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. */
16 /* */
17 /***************************************************************************/
18
19
20 #ifndef __AFGLOBAL_H__
21 #define __AFGLOBAL_H__
22
23
24 #include "aftypes.h"
25 #include "afmodule.h"
26
27
28 FT_BEGIN_HEADER
29
30
31 FT_LOCAL_ARRAY( AF_WritingSystemClass )
32 af_writing_system_classes[];
33
34 FT_LOCAL_ARRAY( AF_ScriptClass )
35 af_script_classes[];
36
37 #ifdef FT_DEBUG_LEVEL_TRACE
38 FT_LOCAL_ARRAY( char* )
39 af_script_names[];
40 #endif
41
42 /*
43 * Default values and flags for both autofitter globals (found in
44 * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
45 */
46
47 /* index of fallback script in `af_script_classes' */
48 #ifdef AF_CONFIG_OPTION_CJK
49 #define AF_SCRIPT_FALLBACK AF_SCRIPT_HANI
50 #else
51 #define AF_SCRIPT_FALLBACK AF_SCRIPT_DFLT
52 #endif
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 */
56 #define AF_DIGIT 0x80
57
58 /* `increase-x-height' property */
59 #define AF_PROP_INCREASE_X_HEIGHT_MIN 6
60 #define AF_PROP_INCREASE_X_HEIGHT_MAX 0
61
62
63 /************************************************************************/
64 /************************************************************************/
65 /***** *****/
66 /***** F A C E G L O B A L S *****/
67 /***** *****/
68 /************************************************************************/
69 /************************************************************************/
70
71
72 /*
73 * Note that glyph_scripts[] maps each glyph to an index into the
74 * `af_script_classes' array.
75 *
76 */
77 typedef struct AF_FaceGlobalsRec_
78 {
79 FT_Face face;
80 FT_Long glyph_count; /* same as face->num_glyphs */
81 FT_Byte* glyph_scripts;
82
83 /* per-face auto-hinter properties */
84 FT_UInt increase_x_height;
85
86 AF_ScriptMetrics metrics[AF_SCRIPT_MAX];
87
88 AF_Module module; /* to access global properties */
89
90 } AF_FaceGlobalsRec;
91
92
93 /*
94 * model the global hints data for a given face, decomposed into
95 * script-specific items
96 */
97
98 FT_LOCAL( FT_Error )
99 af_face_globals_new( FT_Face face,
100 AF_FaceGlobals *aglobals,
101 AF_Module module );
102
103 FT_LOCAL( FT_Error )
104 af_face_globals_get_metrics( AF_FaceGlobals globals,
105 FT_UInt gindex,
106 FT_UInt options,
107 AF_ScriptMetrics *ametrics );
108
109 FT_LOCAL( void )
110 af_face_globals_free( AF_FaceGlobals globals );
111
112 FT_LOCAL_DEF( FT_Bool )
113 af_face_globals_is_digit( AF_FaceGlobals globals,
114 FT_UInt gindex );
115
116 /* */
117
118
119 FT_END_HEADER
120
121 #endif /* __AFGLOBAL_H__ */
122
123
124 /* END */