ReactOS  0.4.14-dev-1314-gacf135d
afglobal.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* afglobal.h */
4 /* */
5 /* Auto-fitter routines to compute global hinting values */
6 /* (specification). */
7 /* */
8 /* Copyright 2003-2018 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 #include "afshaper.h"
27 
28 
30 
31 
34 
35 
36 #undef SCRIPT
37 #define SCRIPT( s, S, d, h, H, ss ) \
38  AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )
39 
40 #include "afscript.h"
41 
44 
45 
46 #undef STYLE
47 #define STYLE( s, S, d, ws, sc, ss, c ) \
48  AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )
49 
50 #include "afstyles.h"
51 
54 
55 
56 #ifdef FT_DEBUG_LEVEL_TRACE
57  FT_LOCAL_ARRAY( char* )
58  af_style_names[];
59 #endif
60 
61 
62  /*
63  * Default values and flags for both autofitter globals (found in
64  * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
65  */
66 
67  /* index of fallback style in `af_style_classes' */
68 #ifdef AF_CONFIG_OPTION_CJK
69 #define AF_STYLE_FALLBACK AF_STYLE_HANI_DFLT
70 #else
71 #define AF_STYLE_FALLBACK AF_STYLE_NONE_DFLT
72 #endif
73  /* default script for OpenType; ignored if HarfBuzz isn't used */
74 #define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN
75 
76  /* a bit mask for AF_DIGIT and AF_NONBASE */
77 #define AF_STYLE_MASK 0x3FFF
78  /* an uncovered glyph */
79 #define AF_STYLE_UNASSIGNED AF_STYLE_MASK
80 
81  /* if this flag is set, we have an ASCII digit */
82 #define AF_DIGIT 0x8000U
83  /* if this flag is set, we have a non-base character */
84 #define AF_NONBASE 0x4000U
85 
86  /* `increase-x-height' property */
87 #define AF_PROP_INCREASE_X_HEIGHT_MIN 6
88 #define AF_PROP_INCREASE_X_HEIGHT_MAX 0
89 
90 
91  /************************************************************************/
92  /************************************************************************/
93  /***** *****/
94  /***** F A C E G L O B A L S *****/
95  /***** *****/
96  /************************************************************************/
97  /************************************************************************/
98 
99 
100  /*
101  * Note that glyph_styles[] maps each glyph to an index into the
102  * `af_style_classes' array.
103  *
104  */
105  typedef struct AF_FaceGlobalsRec_
106  {
108  FT_Long glyph_count; /* same as face->num_glyphs */
110 
111 #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
112  hb_font_t* hb_font;
113  hb_buffer_t* hb_buf; /* for feature comparison */
114 #endif
115 
116  /* per-face auto-hinter properties */
118 
119  AF_StyleMetrics metrics[AF_STYLE_MAX];
120 
121  /* Compute darkening amount once per size. Use this to check whether */
122  /* darken_{x,y} needs to be recomputed. */
124  /* Copy from e.g. AF_LatinMetrics.axis[AF_DIMENSION_HORZ] */
125  /* to compute the darkening amount. */
127  /* Copy from e.g. AF_LatinMetrics.axis[AF_DIMENSION_VERT] */
128  /* to compute the darkening amount. */
130  /* The actual amount to darken a glyph along the X axis. */
132  /* The actual amount to darken a glyph along the Y axis. */
134  /* Amount to scale down by to keep emboldened points */
135  /* on the Y-axis in pre-computed blue zones. */
137  AF_Module module; /* to access global properties */
138 
140 
141 
142  /*
143  * model the global hints data for a given face, decomposed into
144  * style-specific items
145  */
146 
147  FT_LOCAL( FT_Error )
149  AF_FaceGlobals *aglobals,
150  AF_Module module );
151 
152  FT_LOCAL( FT_Error )
154  FT_UInt gindex,
156  AF_StyleMetrics *ametrics );
157 
158  FT_LOCAL( void )
160 
163  FT_UInt gindex );
164 
165  /* */
166 
167 
169 
170 #endif /* AFGLOBAL_H_ */
171 
172 
173 /* END */
FT_BEGIN_HEADER struct AF_ModuleRec_ * AF_Module
int FT_Error
Definition: fttypes.h:300
signed long FT_Long
Definition: fttypes.h:242
#define FT_LOCAL_ARRAY(x)
Definition: ftconfig.h:393
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
#define FT_END_HEADER
Definition: ftheader.h:54
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
af_face_globals_free(AF_FaceGlobals globals)
Definition: afglobal.c:387
af_face_globals_get_metrics(AF_FaceGlobals globals, FT_UInt gindex, FT_UInt options, AF_StyleMetrics *ametrics)
Definition: afglobal.c:425
FT_Long glyph_count
Definition: afglobal.h:108
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
af_script_classes[]
Definition: afglobal.h:43
AF_Module module
Definition: afglobal.h:137
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
#define FT_LOCAL(x)
Definition: ftconfig.h:387
af_face_globals_new(FT_Face face, AF_FaceGlobals *aglobals, AF_Module module)
Definition: afglobal.c:336
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:388
FT_Fixed scale_down_factor
Definition: afglobal.h:136
FT_UInt increase_x_height
Definition: afglobal.h:117
FT_Pos standard_vertical_width
Definition: afglobal.h:126
struct AF_FaceGlobalsRec_ AF_FaceGlobalsRec
FT_BEGIN_HEADER af_writing_system_classes[]
Definition: afglobal.h:33
signed long FT_Fixed
Definition: fttypes.h:288
FT_UShort * glyph_styles
Definition: afglobal.h:109
unsigned int FT_UInt
Definition: fttypes.h:231
FT_UShort stem_darkening_for_ppem
Definition: afglobal.h:123
FT_Pos standard_horizontal_width
Definition: afglobal.h:129
unsigned short FT_UShort
Definition: fttypes.h:209
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
af_face_globals_is_digit(AF_FaceGlobals globals, FT_UInt gindex)
Definition: afglobal.c:493
af_style_classes[]
Definition: afglobal.h:53