1 /***************************************************************************/
5 /* PostScript hinting algorithm 2 (specification). */
7 /* Copyright 2001 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16 /***************************************************************************/
19 #ifndef __PSHALGO2_H__
20 #define __PSHALGO2_H__
25 #include FT_TRIGONOMETRY_H
31 typedef struct PSH2_HintRec_* PSH2_Hint;
35 PSH2_HINT_GHOST = PS_HINT_FLAG_GHOST,
36 PSH2_HINT_BOTTOM = PS_HINT_FLAG_BOTTOM,
43 #define psh2_hint_is_active( x ) ( ( (x)->flags & PSH2_HINT_ACTIVE ) != 0 )
44 #define psh2_hint_is_ghost( x ) ( ( (x)->flags & PSH2_HINT_GHOST ) != 0 )
45 #define psh2_hint_is_fitted( x ) ( ( (x)->flags & PSH2_HINT_FITTED ) != 0 )
47 #define psh2_hint_activate( x ) (x)->flags |= PSH2_HINT_ACTIVE
48 #define psh2_hint_deactivate( x ) (x)->flags &= ~PSH2_HINT_ACTIVE
49 #define psh2_hint_set_fitted( x ) (x)->flags |= PSH2_HINT_FITTED
52 typedef struct PSH2_HintRec_
65 /* this is an interpolation zone used for strong points; */
66 /* weak points are interpolated according to their strong */
68 typedef struct PSH2_ZoneRec_
75 } PSH2_ZoneRec, *PSH2_Zone;
78 typedef struct PSH2_Hint_TableRec_
84 PSH2_Hint* sort_global;
88 PS_Mask_Table hint_masks;
89 PS_Mask_Table counter_masks;
91 } PSH2_Hint_TableRec, *PSH2_Hint_Table;
94 typedef struct PSH2_PointRec_* PSH2_Point;
95 typedef struct PSH2_ContourRec_* PSH2_Contour;
108 PSH2_POINT_OFF = 1, /* point is off the curve */
109 PSH2_POINT_STRONG = 2, /* point is strong */
110 PSH2_POINT_SMOOTH = 4, /* point is smooth */
111 PSH2_POINT_FITTED = 8 /* point is already fitted */
115 typedef struct PSH2_PointRec_
119 PSH2_Contour contour;
140 #define psh2_point_is_strong( p ) ( (p)->flags & PSH2_POINT_STRONG )
141 #define psh2_point_is_fitted( p ) ( (p)->flags & PSH2_POINT_FITTED )
142 #define psh2_point_is_smooth( p ) ( (p)->flags & PSH2_POINT_SMOOTH )
144 #define psh2_point_set_strong( p ) (p)->flags |= PSH2_POINT_STRONG
145 #define psh2_point_set_fitted( p ) (p)->flags |= PSH2_POINT_FITTED
146 #define psh2_point_set_smooth( p ) (p)->flags |= PSH2_POINT_SMOOTH
149 typedef struct PSH2_ContourRec_
157 typedef struct PSH2_GlyphRec_
160 FT_UInt num_contours;
163 PSH2_Contour contours;
168 PSH2_Hint_TableRec hint_tables[2];
174 } PSH2_GlyphRec, *PSH2_Glyph;
178 extern PSH2_Hint_Table ps2_debug_hint_table;
181 (*PSH2_HintFunc)( PSH2_Hint hint,
184 extern PSH2_HintFunc ps2_debug_hint_func;
186 extern PSH2_Glyph ps2_debug_glyph;
191 ps2_hints_apply( PS_Hints ps_hints,
194 FT_Render_Mode hint_mode );
200 #endif /* __PSHALGO2_H__ */