Suggestion from "mgh".
[open-ps2-loader.git] / thirdparty / freetype-2.3.12 / src / pshinter / pshglob.h
blobc511626157abc290c5fbb5bdc620dce6c4efefe6
1 /***************************************************************************/
2 /* */
3 /* pshglob.h */
4 /* */
5 /* PostScript hinter global hinting management. */
6 /* */
7 /* Copyright 2001, 2002, 2003 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 __PSHGLOB_H__
20 #define __PSHGLOB_H__
23 #include FT_FREETYPE_H
24 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
27 FT_BEGIN_HEADER
30 /*************************************************************************/
31 /*************************************************************************/
32 /***** *****/
33 /***** GLOBAL HINTS INTERNALS *****/
34 /***** *****/
35 /*************************************************************************/
36 /*************************************************************************/
39 /*************************************************************************/
40 /* */
41 /* @constant: */
42 /* PS_GLOBALS_MAX_BLUE_ZONES */
43 /* */
44 /* @description: */
45 /* The maximum number of blue zones in a font global hints structure. */
46 /* See @PS_Globals_BluesRec. */
47 /* */
48 #define PS_GLOBALS_MAX_BLUE_ZONES 16
51 /*************************************************************************/
52 /* */
53 /* @constant: */
54 /* PS_GLOBALS_MAX_STD_WIDTHS */
55 /* */
56 /* @description: */
57 /* The maximum number of standard and snap widths in either the */
58 /* horizontal or vertical direction. See @PS_Globals_WidthsRec. */
59 /* */
60 #define PS_GLOBALS_MAX_STD_WIDTHS 16
63 /* standard and snap width */
64 typedef struct PSH_WidthRec_
66 FT_Int org;
67 FT_Pos cur;
68 FT_Pos fit;
70 } PSH_WidthRec, *PSH_Width;
73 /* standard and snap widths table */
74 typedef struct PSH_WidthsRec_
76 FT_UInt count;
77 PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS];
79 } PSH_WidthsRec, *PSH_Widths;
82 typedef struct PSH_DimensionRec_
84 PSH_WidthsRec stdw;
85 FT_Fixed scale_mult;
86 FT_Fixed scale_delta;
88 } PSH_DimensionRec, *PSH_Dimension;
91 /* blue zone descriptor */
92 typedef struct PSH_Blue_ZoneRec_
94 FT_Int org_ref;
95 FT_Int org_delta;
96 FT_Int org_top;
97 FT_Int org_bottom;
99 FT_Pos cur_ref;
100 FT_Pos cur_delta;
101 FT_Pos cur_bottom;
102 FT_Pos cur_top;
104 } PSH_Blue_ZoneRec, *PSH_Blue_Zone;
107 typedef struct PSH_Blue_TableRec_
109 FT_UInt count;
110 PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES];
112 } PSH_Blue_TableRec, *PSH_Blue_Table;
115 /* blue zones table */
116 typedef struct PSH_BluesRec_
118 PSH_Blue_TableRec normal_top;
119 PSH_Blue_TableRec normal_bottom;
120 PSH_Blue_TableRec family_top;
121 PSH_Blue_TableRec family_bottom;
123 FT_Fixed blue_scale;
124 FT_Int blue_shift;
125 FT_Int blue_threshold;
126 FT_Int blue_fuzz;
127 FT_Bool no_overshoots;
129 } PSH_BluesRec, *PSH_Blues;
132 /* font globals. */
133 /* dimension 0 => X coordinates + vertical hints/stems */
134 /* dimension 1 => Y coordinates + horizontal hints/stems */
135 typedef struct PSH_GlobalsRec_
137 FT_Memory memory;
138 PSH_DimensionRec dimension[2];
139 PSH_BluesRec blues;
141 } PSH_GlobalsRec;
144 #define PSH_BLUE_ALIGN_NONE 0
145 #define PSH_BLUE_ALIGN_TOP 1
146 #define PSH_BLUE_ALIGN_BOT 2
149 typedef struct PSH_AlignmentRec_
151 int align;
152 FT_Pos align_top;
153 FT_Pos align_bot;
155 } PSH_AlignmentRec, *PSH_Alignment;
158 FT_LOCAL( void )
159 psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs );
162 #if 0
163 /* snap a stem width to fitter coordinates. `org_width' is in font */
164 /* units. The result is in device pixels (26.6 format). */
165 FT_LOCAL( FT_Pos )
166 psh_dimension_snap_width( PSH_Dimension dimension,
167 FT_Int org_width );
168 #endif
170 FT_LOCAL( FT_Error )
171 psh_globals_set_scale( PSH_Globals globals,
172 FT_Fixed x_scale,
173 FT_Fixed y_scale,
174 FT_Fixed x_delta,
175 FT_Fixed y_delta );
177 /* snap a stem to one or two blue zones */
178 FT_LOCAL( void )
179 psh_blues_snap_stem( PSH_Blues blues,
180 FT_Int stem_top,
181 FT_Int stem_bot,
182 PSH_Alignment alignment );
183 /* */
185 #ifdef DEBUG_HINTER
186 extern PSH_Globals ps_debug_globals;
187 #endif
190 FT_END_HEADER
193 #endif /* __PSHGLOB_H__ */
196 /* END */