1 /***************************************************************************/
5 /* Postscript (Type1/Type2) hints recorder (specification). */
7 /* Copyright 2001-2018 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 /**************************************************************************/
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 */
28 /**************************************************************************/
36 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
43 /*************************************************************************/
44 /*************************************************************************/
46 /***** GLYPH HINTS RECORDER INTERNALS *****/
48 /*************************************************************************/
49 /*************************************************************************/
51 /* handle to hint record */
52 typedef struct PS_HintRec_
* PS_Hint
;
55 typedef enum PS_Hint_Type_
64 #define PS_HINT_FLAG_GHOST 1U
65 #define PS_HINT_FLAG_BOTTOM 2U
69 typedef struct PS_HintRec_
78 #define ps_hint_is_active( x ) ( (x)->flags & PS_HINT_FLAG_ACTIVE )
79 #define ps_hint_is_ghost( x ) ( (x)->flags & PS_HINT_FLAG_GHOST )
80 #define ps_hint_is_bottom( x ) ( (x)->flags & PS_HINT_FLAG_BOTTOM )
83 /* hints table descriptor */
84 typedef struct PS_Hint_TableRec_
90 } PS_Hint_TableRec
, *PS_Hint_Table
;
93 /* hint and counter mask descriptor */
94 typedef struct PS_MaskRec_
101 } PS_MaskRec
, *PS_Mask
;
104 /* masks and counters table descriptor */
105 typedef struct PS_Mask_TableRec_
111 } PS_Mask_TableRec
, *PS_Mask_Table
;
114 /* dimension-specific hints descriptor */
115 typedef struct PS_DimensionRec_
117 PS_Hint_TableRec hints
;
118 PS_Mask_TableRec masks
;
119 PS_Mask_TableRec counters
;
121 } PS_DimensionRec
, *PS_Dimension
;
124 /* glyph hints descriptor */
125 /* dimension 0 => X coordinates + vertical hints/stems */
126 /* dimension 1 => Y coordinates + horizontal hints/stems */
127 typedef struct PS_HintsRec_
132 PS_Hint_Type hint_type
;
133 PS_DimensionRec dimension
[2];
135 } PS_HintsRec
, *PS_Hints
;
139 /* initialize hints recorder */
141 ps_hints_init( PS_Hints hints
,
144 /* finalize hints recorder */
146 ps_hints_done( PS_Hints hints
);
148 /* initialize Type1 hints recorder interface */
150 t1_hints_funcs_init( T1_Hints_FuncsRec
* funcs
);
152 /* initialize Type2 hints recorder interface */
154 t2_hints_funcs_init( T2_Hints_FuncsRec
* funcs
);
158 extern PS_Hints ps_debug_hints
;
159 extern int ps_debug_no_horz_hints
;
160 extern int ps_debug_no_vert_hints
;
169 #endif /* PSHREC_H_ */