Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / modules / freetype2 / src / autofit / aflatin.h
blob3251d3783f3ebbb805027e3562e2e558df7342b2
1 /***************************************************************************/
2 /* */
3 /* aflatin.h */
4 /* */
5 /* Auto-fitter hinting routines for latin script (specification). */
6 /* */
7 /* Copyright 2003, 2004, 2005, 2006, 2007 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 /***************************************************************************/
19 #ifndef __AFLATIN_H__
20 #define __AFLATIN_H__
22 #include "afhints.h"
25 FT_BEGIN_HEADER
28 /* the latin-specific script class */
30 FT_CALLBACK_TABLE const AF_ScriptClassRec
31 af_latin_script_class;
34 /* constants are given with units_per_em == 2048 in mind */
35 #define AF_LATIN_CONSTANT( metrics, c ) \
36 ( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
39 /*************************************************************************/
40 /*************************************************************************/
41 /***** *****/
42 /***** L A T I N G L O B A L M E T R I C S *****/
43 /***** *****/
44 /*************************************************************************/
45 /*************************************************************************/
49 * The following declarations could be embedded in the file `aflatin.c';
50 * they have been made semi-public to allow alternate script hinters to
51 * re-use some of them.
55 /* Latin (global) metrics management */
57 enum
59 AF_LATIN_BLUE_CAPITAL_TOP,
60 AF_LATIN_BLUE_CAPITAL_BOTTOM,
61 AF_LATIN_BLUE_SMALL_F_TOP,
62 AF_LATIN_BLUE_SMALL_TOP,
63 AF_LATIN_BLUE_SMALL_BOTTOM,
64 AF_LATIN_BLUE_SMALL_MINOR,
66 AF_LATIN_BLUE_MAX
70 #define AF_LATIN_IS_TOP_BLUE( b ) ( (b) == AF_LATIN_BLUE_CAPITAL_TOP || \
71 (b) == AF_LATIN_BLUE_SMALL_F_TOP || \
72 (b) == AF_LATIN_BLUE_SMALL_TOP )
74 #define AF_LATIN_MAX_WIDTHS 16
75 #define AF_LATIN_MAX_BLUES AF_LATIN_BLUE_MAX
78 enum
80 AF_LATIN_BLUE_ACTIVE = 1 << 0,
81 AF_LATIN_BLUE_TOP = 1 << 1,
82 AF_LATIN_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */
83 /* optimization */
84 AF_LATIN_BLUE_FLAG_MAX
88 typedef struct AF_LatinBlueRec_
90 AF_WidthRec ref;
91 AF_WidthRec shoot;
92 FT_UInt flags;
94 } AF_LatinBlueRec, *AF_LatinBlue;
97 typedef struct AF_LatinAxisRec_
99 FT_Fixed scale;
100 FT_Pos delta;
102 FT_UInt width_count;
103 AF_WidthRec widths[AF_LATIN_MAX_WIDTHS];
104 FT_Pos edge_distance_threshold;
105 FT_Pos standard_width;
106 FT_Bool extra_light;
108 /* ignored for horizontal metrics */
109 FT_Bool control_overshoot;
110 FT_UInt blue_count;
111 AF_LatinBlueRec blues[AF_LATIN_BLUE_MAX];
113 FT_Fixed org_scale;
114 FT_Pos org_delta;
116 } AF_LatinAxisRec, *AF_LatinAxis;
119 typedef struct AF_LatinMetricsRec_
121 AF_ScriptMetricsRec root;
122 FT_UInt units_per_em;
123 AF_LatinAxisRec axis[AF_DIMENSION_MAX];
125 } AF_LatinMetricsRec, *AF_LatinMetrics;
128 FT_LOCAL( FT_Error )
129 af_latin_metrics_init( AF_LatinMetrics metrics,
130 FT_Face face );
132 FT_LOCAL( void )
133 af_latin_metrics_scale( AF_LatinMetrics metrics,
134 AF_Scaler scaler );
136 FT_LOCAL( void )
137 af_latin_metrics_init_widths( AF_LatinMetrics metrics,
138 FT_Face face,
139 FT_ULong charcode );
142 /*************************************************************************/
143 /*************************************************************************/
144 /***** *****/
145 /***** L A T I N G L Y P H A N A L Y S I S *****/
146 /***** *****/
147 /*************************************************************************/
148 /*************************************************************************/
150 enum
152 AF_LATIN_HINTS_HORZ_SNAP = 1 << 0, /* enable stem width snapping */
153 AF_LATIN_HINTS_VERT_SNAP = 1 << 1, /* enable stem height snapping */
154 AF_LATIN_HINTS_STEM_ADJUST = 1 << 2, /* enable stem width/height */
155 /* adjustment */
156 AF_LATIN_HINTS_MONO = 1 << 3 /* indicate monochrome */
157 /* rendering */
161 #define AF_LATIN_HINTS_DO_HORZ_SNAP( h ) \
162 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_HORZ_SNAP )
164 #define AF_LATIN_HINTS_DO_VERT_SNAP( h ) \
165 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_VERT_SNAP )
167 #define AF_LATIN_HINTS_DO_STEM_ADJUST( h ) \
168 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_STEM_ADJUST )
170 #define AF_LATIN_HINTS_DO_MONO( h ) \
171 AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_MONO )
175 * This shouldn't normally be exported. However, other scripts might
176 * like to use this function as-is.
178 FT_LOCAL( FT_Error )
179 af_latin_hints_compute_segments( AF_GlyphHints hints,
180 AF_Dimension dim );
183 * This shouldn't normally be exported. However, other scripts might
184 * want to use this function as-is.
186 FT_LOCAL( void )
187 af_latin_hints_link_segments( AF_GlyphHints hints,
188 AF_Dimension dim );
191 * This shouldn't normally be exported. However, other scripts might
192 * want to use this function as-is.
194 FT_LOCAL( FT_Error )
195 af_latin_hints_compute_edges( AF_GlyphHints hints,
196 AF_Dimension dim );
198 FT_LOCAL( FT_Error )
199 af_latin_hints_detect_features( AF_GlyphHints hints,
200 AF_Dimension dim );
202 /* */
204 FT_END_HEADER
206 #endif /* __AFLATIN_H__ */
209 /* END */