1 /****************************************************************************
5 * Postscript (Type1/Type2) hints recorder (specification).
7 * Copyright (C) 2001-2023 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.
19 /***************************************************************************
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.
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
35 #include <freetype/internal/pshints.h>
42 /*************************************************************************/
43 /*************************************************************************/
45 /***** GLYPH HINTS RECORDER INTERNALS *****/
47 /*************************************************************************/
48 /*************************************************************************/
50 /* handle to hint record */
51 typedef struct PS_HintRec_* PS_Hint;
54 typedef enum PS_Hint_Type_
63 #define PS_HINT_FLAG_GHOST 1U
64 #define PS_HINT_FLAG_BOTTOM 2U
68 typedef struct PS_HintRec_
77 #define ps_hint_is_active( x ) ( (x)->flags & PS_HINT_FLAG_ACTIVE )
78 #define ps_hint_is_ghost( x ) ( (x)->flags & PS_HINT_FLAG_GHOST )
79 #define ps_hint_is_bottom( x ) ( (x)->flags & PS_HINT_FLAG_BOTTOM )
82 /* hints table descriptor */
83 typedef struct PS_Hint_TableRec_
89 } PS_Hint_TableRec, *PS_Hint_Table;
92 /* hint and counter mask descriptor */
93 typedef struct PS_MaskRec_
100 } PS_MaskRec, *PS_Mask;
103 /* masks and counters table descriptor */
104 typedef struct PS_Mask_TableRec_
110 } PS_Mask_TableRec, *PS_Mask_Table;
113 /* dimension-specific hints descriptor */
114 typedef struct PS_DimensionRec_
116 PS_Hint_TableRec hints;
117 PS_Mask_TableRec masks;
118 PS_Mask_TableRec counters;
120 } PS_DimensionRec, *PS_Dimension;
123 /* glyph hints descriptor */
124 /* dimension 0 => X coordinates + vertical hints/stems */
125 /* dimension 1 => Y coordinates + horizontal hints/stems */
126 typedef struct PS_HintsRec_
131 PS_Hint_Type hint_type;
132 PS_DimensionRec dimension[2];
134 } PS_HintsRec, *PS_Hints;
138 /* initialize hints recorder */
140 ps_hints_init( PS_Hints hints,
143 /* finalize hints recorder */
145 ps_hints_done( PS_Hints hints );
147 /* initialize Type1 hints recorder interface */
149 t1_hints_funcs_init( T1_Hints_FuncsRec* funcs );
151 /* initialize Type2 hints recorder interface */
153 t2_hints_funcs_init( T2_Hints_FuncsRec* funcs );
157 extern PS_Hints ps_debug_hints;
158 extern int ps_debug_no_horz_hints;
159 extern int ps_debug_no_vert_hints;
168 #endif /* PSHREC_H_ */