sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
pshglob.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * pshglob.h
4 *
5 * PostScript hinter global hinting management.
6 *
7 * Copyright (C) 2001-2025 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
23#ifndef PSHGLOB_H_
24#define PSHGLOB_H_
25
26
27#include <freetype/freetype.h>
29
30
31FT_BEGIN_HEADER
32
33
34 /*************************************************************************/
35 /*************************************************************************/
36 /***** *****/
37 /***** GLOBAL HINTS INTERNALS *****/
38 /***** *****/
39 /*************************************************************************/
40 /*************************************************************************/
41
42
43 /**************************************************************************
44 *
45 * @constant:
46 * PS_GLOBALS_MAX_BLUE_ZONES
47 *
48 * @description:
49 * The maximum number of blue zones in a font global hints structure.
50 * See @PS_Globals_BluesRec.
51 */
52#define PS_GLOBALS_MAX_BLUE_ZONES 16
53
54
55 /**************************************************************************
56 *
57 * @constant:
58 * PS_GLOBALS_MAX_STD_WIDTHS
59 *
60 * @description:
61 * The maximum number of standard and snap widths in either the
62 * horizontal or vertical direction. See @PS_Globals_WidthsRec.
63 */
64#define PS_GLOBALS_MAX_STD_WIDTHS 16
65
66
67 /* standard and snap width */
68 typedef struct PSH_WidthRec_
69 {
70 FT_Int org;
71 FT_Pos cur;
72 FT_Pos fit;
73
74 } PSH_WidthRec, *PSH_Width;
75
76
77 /* standard and snap widths table */
78 typedef struct PSH_WidthsRec_
79 {
80 FT_UInt count;
81 PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS];
82
83 } PSH_WidthsRec, *PSH_Widths;
84
85
86 typedef struct PSH_DimensionRec_
87 {
88 PSH_WidthsRec stdw;
89 FT_Fixed scale_mult;
90 FT_Fixed scale_delta;
91
92 } PSH_DimensionRec, *PSH_Dimension;
93
94
95 /* blue zone descriptor */
96 typedef struct PSH_Blue_ZoneRec_
97 {
98 FT_Int org_ref;
99 FT_Int org_delta;
100 FT_Int org_top;
101 FT_Int org_bottom;
102
103 FT_Pos cur_ref;
104 FT_Pos cur_delta;
105 FT_Pos cur_bottom;
106 FT_Pos cur_top;
107
108 } PSH_Blue_ZoneRec, *PSH_Blue_Zone;
109
110
111 typedef struct PSH_Blue_TableRec_
112 {
113 FT_UInt count;
114 PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES];
115
116 } PSH_Blue_TableRec, *PSH_Blue_Table;
117
118
119 /* blue zones table */
120 typedef struct PSH_BluesRec_
121 {
122 PSH_Blue_TableRec normal_top;
123 PSH_Blue_TableRec normal_bottom;
124 PSH_Blue_TableRec family_top;
125 PSH_Blue_TableRec family_bottom;
126
127 FT_Fixed blue_scale;
128 FT_Int blue_shift;
129 FT_Int blue_threshold;
130 FT_Int blue_fuzz;
131 FT_Bool no_overshoots;
132
133 } PSH_BluesRec, *PSH_Blues;
134
135
136 /* font globals. */
137 /* dimension 0 => X coordinates + vertical hints/stems */
138 /* dimension 1 => Y coordinates + horizontal hints/stems */
139 typedef struct PSH_GlobalsRec_
140 {
141 FT_Memory memory;
142 PSH_DimensionRec dimension[2];
143 PSH_BluesRec blues;
144
145 } PSH_GlobalsRec;
146
147
148#define PSH_BLUE_ALIGN_NONE 0
149#define PSH_BLUE_ALIGN_TOP 1
150#define PSH_BLUE_ALIGN_BOT 2
151
152
153 typedef struct PSH_AlignmentRec_
154 {
155 int align;
156 FT_Pos align_top;
157 FT_Pos align_bot;
158
159 } PSH_AlignmentRec, *PSH_Alignment;
160
161
162 FT_LOCAL( void )
163 psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs );
164
165
166#if 0
167 /* snap a stem width to fitter coordinates. `org_width' is in font */
168 /* units. The result is in device pixels (26.6 format). */
169 FT_LOCAL( FT_Pos )
170 psh_dimension_snap_width( PSH_Dimension dimension,
171 FT_Int org_width );
172#endif
173
174 FT_LOCAL( void )
175 psh_globals_set_scale( PSH_Globals globals,
176 FT_Fixed x_scale,
177 FT_Fixed y_scale,
178 FT_Fixed x_delta,
179 FT_Fixed y_delta );
180
181 /* snap a stem to one or two blue zones */
182 FT_LOCAL( void )
183 psh_blues_snap_stem( PSH_Blues blues,
184 FT_Int stem_top,
185 FT_Int stem_bot,
186 PSH_Alignment alignment );
187 /* */
188
189#ifdef DEBUG_HINTER
190 extern PSH_Globals ps_debug_globals;
191#endif
192
193
194FT_END_HEADER
195
196
197#endif /* PSHGLOB_H_ */
198
199
200/* END */