zenilib: zenilib/jni/external/freetype2/src/autofit/aflatin.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aflatin.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* aflatin.h */
4 /* */
5 /* Auto-fitter hinting routines for latin script (specification). */
6 /* */
7 /* Copyright 2003-2007, 2009, 2011 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
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. */
15 /* */
16 /***************************************************************************/
17
18
19 #ifndef __AFLATIN_H__
20 #define __AFLATIN_H__
21
22 #include "afhints.h"
23
24
25 FT_BEGIN_HEADER
26
27
28 /* the latin-specific script class */
29
30 AF_DECLARE_SCRIPT_CLASS(af_latin_script_class)
31
32
33 /* constants are given with units_per_em == 2048 in mind */
34 #define AF_LATIN_CONSTANT( metrics, c ) \
35 ( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
36
37
38 /*************************************************************************/
39 /*************************************************************************/
40 /***** *****/
41 /***** L A T I N G L O B A L M E T R I C S *****/
42 /***** *****/
43 /*************************************************************************/
44 /*************************************************************************/
45
46
47 /*
48 * The following declarations could be embedded in the file `aflatin.c';
49 * they have been made semi-public to allow alternate script hinters to
50 * re-use some of them.
51 */
52
53
54 /* Latin (global) metrics management */
55
56 enum
57 {
58 AF_LATIN_BLUE_CAPITAL_TOP,
59 AF_LATIN_BLUE_CAPITAL_BOTTOM,
60 AF_LATIN_BLUE_SMALL_F_TOP,
61 AF_LATIN_BLUE_SMALL_TOP,
62 AF_LATIN_BLUE_SMALL_BOTTOM,
63 AF_LATIN_BLUE_SMALL_MINOR,
64
65 AF_LATIN_BLUE_MAX
66 };
67
68
69 #define AF_LATIN_IS_TOP_BLUE( b ) ( (b) == AF_LATIN_BLUE_CAPITAL_TOP || \
70 (b) == AF_LATIN_BLUE_SMALL_F_TOP || \
71 (b) == AF_LATIN_BLUE_SMALL_TOP )
72
73 #define AF_LATIN_MAX_WIDTHS 16
74 #define AF_LATIN_MAX_BLUES AF_LATIN_BLUE_MAX
75
76
77 enum
78 {
79 AF_LATIN_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */
80 AF_LATIN_BLUE_TOP = 1 << 1, /* result of AF_LATIN_IS_TOP_BLUE */
81 AF_LATIN_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */
82 /* optimization */
83 AF_LATIN_BLUE_FLAG_MAX
84 };
85
86
87 typedef struct AF_LatinBlueRec_
88 {
89 AF_WidthRec ref;
90 AF_WidthRec shoot;
91 FT_UInt flags;
92
93 } AF_LatinBlueRec, *AF_LatinBlue;
94
95
96 typedef struct AF_LatinAxisRec_
97 {
98 FT_Fixed scale;
99 FT_Pos delta;
100
101 FT_UInt width_count; /* number of used widths */
102 AF_WidthRec widths[AF_LATIN_MAX_WIDTHS]; /* widths array */
103 FT_Pos edge_distance_threshold; /* used for creating edges */
104 FT_Pos standard_width; /* the default stem thickness */
105 FT_Bool extra_light; /* is standard width very light? */
106
107 /* ignored for horizontal metrics */
108 FT_UInt blue_count;
109 AF_LatinBlueRec blues[AF_LATIN_BLUE_MAX];
110
111 FT_Fixed org_scale;
112 FT_Pos org_delta;
113
114 } AF_LatinAxisRec, *AF_LatinAxis;
115
116
117 typedef struct AF_LatinMetricsRec_
118 {
119 AF_ScriptMetricsRec root;
120 FT_UInt units_per_em;
121 AF_LatinAxisRec axis[AF_DIMENSION_MAX];
122
123 } AF_LatinMetricsRec, *AF_LatinMetrics;
124
125
126 FT_LOCAL( FT_Error )
127 af_latin_metrics_init( AF_LatinMetrics metrics,
128 FT_Face face );
129
130 FT_LOCAL( void )
131 af_latin_metrics_scale( AF_LatinMetrics metrics,
132 AF_Scaler scaler );
133
134 FT_LOCAL( void )
135 af_latin_metrics_init_widths( AF_LatinMetrics metrics,
136 FT_Face face,
137 FT_ULong charcode );
138
139 FT_LOCAL( void )
140 af_latin_metrics_check_digits( AF_LatinMetrics metrics,
141 FT_Face face );
142
143
144 /*************************************************************************/
145 /*************************************************************************/
146 /***** *****/
147 /***** L A T I N G L Y P H A N A L Y S I S *****/
148 /***** *****/
149 /*************************************************************************/
150 /*************************************************************************/
151
152 enum
153 {
154 AF_LATIN_HINTS_HORZ_SNAP = 1 << 0, /* enable stem width snapping */
155 AF_LATIN_HINTS_VERT_SNAP = 1 << 1, /* enable stem height snapping */
156 AF_LATIN_HINTS_STEM_ADJUST = 1 << 2, /* enable stem width/height */
157 /* adjustment */
158 AF_LATIN_HINTS_MONO = 1 << 3 /* indicate monochrome */
159 /* rendering */
160 };
161
162
163 #define AF_LATIN_HINTS_DO_HORZ_SNAP( h ) \
164 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_HORZ_SNAP )
165
166 #define AF_LATIN_HINTS_DO_VERT_SNAP( h ) \
167 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_VERT_SNAP )
168
169 #define AF_LATIN_HINTS_DO_STEM_ADJUST( h ) \
170 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_STEM_ADJUST )
171
172 #define AF_LATIN_HINTS_DO_MONO( h ) \
173 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_MONO )
174
175
176 /*
177 * This shouldn't normally be exported. However, other scripts might
178 * like to use this function as-is.
179 */
180 FT_LOCAL( FT_Error )
181 af_latin_hints_compute_segments( AF_GlyphHints hints,
182 AF_Dimension dim );
183
184 /*
185 * This shouldn't normally be exported. However, other scripts might
186 * want to use this function as-is.
187 */
188 FT_LOCAL( void )
189 af_latin_hints_link_segments( AF_GlyphHints hints,
190 AF_Dimension dim );
191
192 /*
193 * This shouldn't normally be exported. However, other scripts might
194 * want to use this function as-is.
195 */
196 FT_LOCAL( FT_Error )
197 af_latin_hints_compute_edges( AF_GlyphHints hints,
198 AF_Dimension dim );
199
200 FT_LOCAL( FT_Error )
201 af_latin_hints_detect_features( AF_GlyphHints hints,
202 AF_Dimension dim );
203
204 /* */
205
206 FT_END_HEADER
207
208 #endif /* __AFLATIN_H__ */
209
210
211 /* END */
FT_Error
int FT_Error
Definition: fttypes.h:296
AF_LatinAxisRec_
Definition: aflatin.h:96
AF_LatinBlueRec
struct AF_LatinBlueRec_ AF_LatinBlueRec
FT_ULong
unsigned long FT_ULong
Definition: fttypes.h:249
FT_Pos
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:59
AF_LatinBlueRec_::ref
AF_WidthRec ref
Definition: aflatin.h:89
FT_END_HEADER
#define FT_END_HEADER
Definition: ftheader.h:54
AF_DECLARE_SCRIPT_CLASS
#define AF_DECLARE_SCRIPT_CLASS(script_class)
Definition: aftypes.h:314
AF_LATIN_BLUE_SMALL_TOP
Definition: aflatin.h:61
af_latin_metrics_check_digits
af_latin_metrics_check_digits(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:431
metrics
GLuint GLsizei GLsizei GLfloat * metrics
Definition: glew.h:12394
AF_LatinBlueRec_
Definition: aflatin.h:87
AF_LATIN_BLUE_SMALL_MINOR
Definition: aflatin.h:63
af_latin_hints_compute_segments
af_latin_hints_compute_segments(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:726
AF_LatinMetrics
struct AF_LatinMetricsRec_ * AF_LatinMetrics
AF_LATIN_HINTS_HORZ_SNAP
Definition: aflatin.h:154
afhints.h
AF_LATIN_BLUE_TOP
Definition: aflatin.h:80
AF_LatinAxisRec
struct AF_LatinAxisRec_ AF_LatinAxisRec
AF_LatinAxisRec_::extra_light
FT_Bool extra_light
Definition: aflatin.h:105
FT_Bool
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
AF_LatinMetricsRec_::root
AF_ScriptMetricsRec root
Definition: aflatin.h:119
AF_LatinMetricsRec_::axis
AF_LatinAxisRec axis[AF_DIMENSION_MAX]
Definition: aflatin.h:121
AF_LatinAxisRec_::blue_count
FT_UInt blue_count
Definition: aflatin.h:108
AF_ScalerRec_
Definition: aftypes.h:180
AF_LatinAxisRec_::scale
FT_Fixed scale
Definition: aflatin.h:98
FT_BEGIN_HEADER
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
AF_ScriptMetricsRec_
Definition: aftypes.h:249
af_latin_metrics_scale
af_latin_metrics_scale(AF_LatinMetrics metrics, AF_Scaler scaler)
Definition: aflatin.c:703
FT_LOCAL
#define FT_LOCAL(x)
Definition: ftconfig.h:466
AF_LATIN_BLUE_CAPITAL_BOTTOM
Definition: aflatin.h:59
AF_LATIN_MAX_WIDTHS
#define AF_LATIN_MAX_WIDTHS
Definition: aflatin.h:73
AF_LatinBlueRec_::shoot
AF_WidthRec shoot
Definition: aflatin.h:90
af_latin_metrics_init
af_latin_metrics_init(AF_LatinMetrics metrics, FT_Face face)
Definition: aflatin.c:478
AF_LatinAxis
struct AF_LatinAxisRec_ * AF_LatinAxis
AF_LatinBlue
struct AF_LatinBlueRec_ * AF_LatinBlue
FT_FaceRec_
Definition: freetype.h:912
AF_LATIN_BLUE_CAPITAL_TOP
Definition: aflatin.h:58
AF_LATIN_HINTS_STEM_ADJUST
Definition: aflatin.h:156
face
GLenum face
Definition: gl2ext.h:1490
AF_LatinMetricsRec_
Definition: aflatin.h:117
af_latin_hints_link_segments
af_latin_hints_link_segments(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:946
AF_GlyphHintsRec_
Definition: afhints.h:331
AF_LATIN_BLUE_MAX
Definition: aflatin.h:65
AF_LatinAxisRec_::org_delta
FT_Pos org_delta
Definition: aflatin.h:112
AF_LatinAxisRec_::delta
FT_Pos delta
Definition: aflatin.h:99
af_latin_metrics_init_widths
af_latin_metrics_init_widths(AF_LatinMetrics metrics, FT_Face face, FT_ULong charcode)
Definition: aflatin.c:55
AF_LatinAxisRec_::widths
AF_WidthRec widths[AF_LATIN_MAX_WIDTHS]
Definition: aflatin.h:102
AF_LATIN_BLUE_ACTIVE
Definition: aflatin.h:79
AF_LATIN_BLUE_SMALL_BOTTOM
Definition: aflatin.h:62
AF_Dimension
FT_BEGIN_HEADER enum AF_Dimension_ AF_Dimension
af_latin_hints_detect_features
af_latin_hints_detect_features(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:1333
FT_Fixed
signed long FT_Fixed
Definition: fttypes.h:284
AF_LATIN_HINTS_VERT_SNAP
Definition: aflatin.h:155
FT_UInt
unsigned int FT_UInt
Definition: fttypes.h:227
AF_WidthRec
FT_BEGIN_HEADER struct AF_WidthRec_ AF_WidthRec
AF_LATIN_BLUE_ADJUSTMENT
Definition: aflatin.h:81
AF_LATIN_HINTS_MONO
Definition: aflatin.h:158
AF_LatinAxisRec_::width_count
FT_UInt width_count
Definition: aflatin.h:101
AF_DIMENSION_MAX
Definition: afhints.h:40
AF_LatinAxisRec_::org_scale
FT_Fixed org_scale
Definition: aflatin.h:111
AF_LatinBlueRec_::flags
FT_UInt flags
Definition: aflatin.h:91
AF_LatinAxisRec_::edge_distance_threshold
FT_Pos edge_distance_threshold
Definition: aflatin.h:103
AF_LatinMetricsRec_::units_per_em
FT_UInt units_per_em
Definition: aflatin.h:120
AF_LATIN_BLUE_SMALL_F_TOP
Definition: aflatin.h:60
AF_LATIN_BLUE_FLAG_MAX
Definition: aflatin.h:83
AF_LatinAxisRec_::blues
AF_LatinBlueRec blues[AF_LATIN_BLUE_MAX]
Definition: aflatin.h:109
AF_LatinMetricsRec
struct AF_LatinMetricsRec_ AF_LatinMetricsRec
af_latin_hints_compute_edges
af_latin_hints_compute_edges(AF_GlyphHints hints, AF_Dimension dim)
Definition: aflatin.c:1039
AF_LatinAxisRec_::standard_width
FT_Pos standard_width
Definition: aflatin.h:104