sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
pshrec.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * pshrec.h
4 *
5 * Postscript (Type1/Type2) hints recorder (specification).
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
19 /***************************************************************************
20 *
21 * The functions defined here are called from the Type 1, CID and CFF
22 * font drivers to record the hints of a given character/glyph.
23 *
24 * The hints are recorded in a unified format, and are later processed
25 * by the `optimizer' and `fitter' to adjust the outlines to the pixel
26 * grid.
27 *
28 */
29
30
35#ifndef PSHREC_H_
36#define PSHREC_H_
37
38
40#include "pshglob.h"
41
42
43FT_BEGIN_HEADER
44
45
46 /*************************************************************************/
47 /*************************************************************************/
48 /***** *****/
49 /***** GLYPH HINTS RECORDER INTERNALS *****/
50 /***** *****/
51 /*************************************************************************/
52 /*************************************************************************/
53
54 /* handle to hint record */
55 typedef struct PS_HintRec_* PS_Hint;
56
57 /* hint types */
58 typedef enum PS_Hint_Type_
59 {
60 PS_HINT_TYPE_1 = 1,
61 PS_HINT_TYPE_2 = 2
62
63 } PS_Hint_Type;
64
65
66 /* hint flags */
67#define PS_HINT_FLAG_GHOST 1U
68#define PS_HINT_FLAG_BOTTOM 2U
69
70
71 /* hint descriptor */
72 typedef struct PS_HintRec_
73 {
74 FT_Int pos;
75 FT_Int len;
76 FT_UInt flags;
77
78 } PS_HintRec;
79
80
81#define ps_hint_is_active( x ) ( (x)->flags & PS_HINT_FLAG_ACTIVE )
82#define ps_hint_is_ghost( x ) ( (x)->flags & PS_HINT_FLAG_GHOST )
83#define ps_hint_is_bottom( x ) ( (x)->flags & PS_HINT_FLAG_BOTTOM )
84
85
86 /* hints table descriptor */
87 typedef struct PS_Hint_TableRec_
88 {
89 FT_UInt num_hints;
90 FT_UInt max_hints;
91 PS_Hint hints;
92
93 } PS_Hint_TableRec, *PS_Hint_Table;
94
95
96 /* hint and counter mask descriptor */
97 typedef struct PS_MaskRec_
98 {
99 FT_UInt num_bits;
100 FT_UInt max_bits;
101 FT_Byte* bytes;
102 FT_UInt end_point;
103
104 } PS_MaskRec, *PS_Mask;
105
106
107 /* masks and counters table descriptor */
108 typedef struct PS_Mask_TableRec_
109 {
110 FT_UInt num_masks;
111 FT_UInt max_masks;
112 PS_Mask masks;
113
114 } PS_Mask_TableRec, *PS_Mask_Table;
115
116
117 /* dimension-specific hints descriptor */
118 typedef struct PS_DimensionRec_
119 {
120 PS_Hint_TableRec hints;
121 PS_Mask_TableRec masks;
122 PS_Mask_TableRec counters;
123
124 } PS_DimensionRec, *PS_Dimension;
125
126
127 /* glyph hints descriptor */
128 /* dimension 0 => X coordinates + vertical hints/stems */
129 /* dimension 1 => Y coordinates + horizontal hints/stems */
130 typedef struct PS_HintsRec_
131 {
132 FT_Memory memory;
133 FT_Error error;
134 FT_UInt32 magic;
135 PS_Hint_Type hint_type;
136 PS_DimensionRec dimension[2];
137
138 } PS_HintsRec, *PS_Hints;
139
140 /* */
141
142 /* initialize hints recorder */
143 FT_LOCAL( void )
144 ps_hints_init( PS_Hints hints,
145 FT_Memory memory );
146
147 /* finalize hints recorder */
148 FT_LOCAL( void )
149 ps_hints_done( PS_Hints hints );
150
151 /* initialize Type1 hints recorder interface */
152 FT_LOCAL( void )
153 t1_hints_funcs_init( T1_Hints_FuncsRec* funcs );
154
155 /* initialize Type2 hints recorder interface */
156 FT_LOCAL( void )
157 t2_hints_funcs_init( T2_Hints_FuncsRec* funcs );
158
159
160#ifdef DEBUG_HINTER
161 extern PS_Hints ps_debug_hints;
162 extern int ps_debug_no_horz_hints;
163 extern int ps_debug_no_vert_hints;
164#endif
165
166 /* */
167
168
169FT_END_HEADER
170
171
172#endif /* PSHREC_H_ */
173
174
175/* END */