Bringing apdf from vendor into main branch.
[AROS-Contrib.git] / apdf / freetype2 / pshinter / pshalgo1.h
blobed1031fd6cb002223afcdb65b716d67f531f0a63
1 /***************************************************************************/
2 /* */
3 /* pshalgo1.h */
4 /* */
5 /* PostScript hinting algorithm 1 (specification). */
6 /* */
7 /* Copyright 2001 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 __PSHALGO1_H__
20 #define __PSHALGO1_H__
22 #include "pshrec.h"
24 FT_BEGIN_HEADER
26 typedef struct PSH1_HintRec_* PSH1_Hint;
28 typedef enum
30 PSH1_HINT_FLAG_GHOST = PS_HINT_FLAG_GHOST,
31 PSH1_HINT_FLAG_BOTTOM = PS_HINT_FLAG_BOTTOM,
32 PSH1_HINT_FLAG_ACTIVE = 4
34 } PSH1_Hint_Flags;
36 #define psh1_hint_is_active( x ) \
37 ( ( (x)->flags & PSH1_HINT_FLAG_ACTIVE ) != 0 )
38 #define psh1_hint_is_ghost( x ) \
39 ( ( (x)->flags & PSH1_HINT_FLAG_GHOST ) != 0 )
41 #define psh1_hint_activate( x ) (x)->flags |= PSH1_HINT_FLAG_ACTIVE
42 #define psh1_hint_deactivate( x ) (x)->flags &= ~PSH1_HINT_FLAG_ACTIVE
44 typedef struct PSH1_HintRec_
46 FT_Int org_pos;
47 FT_Int org_len;
48 FT_Pos cur_pos;
49 FT_Pos cur_len;
51 FT_UInt flags;
53 PSH1_Hint parent;
54 FT_Int order;
56 } PSH1_HintRec;
59 /* this is an interpolation zone used for strong points; */
60 /* weak points are interpolated according to their strong */
61 /* neighbours */
62 typedef struct PSH1_ZoneRec_
64 FT_Fixed scale;
65 FT_Fixed delta;
66 FT_Pos min;
67 FT_Pos max;
69 } PSH1_ZoneRec, *PSH1_Zone;
72 typedef struct PSH1_Hint_TableRec_
74 FT_UInt max_hints;
75 FT_UInt num_hints;
76 PSH1_Hint hints;
77 PSH1_Hint* sort;
78 PSH1_Hint* sort_global;
79 FT_UInt num_zones;
80 PSH1_Zone zones;
81 PSH1_Zone zone;
82 PS_Mask_Table hint_masks;
83 PS_Mask_Table counter_masks;
85 } PSH1_Hint_TableRec, *PSH1_Hint_Table;
88 extern FT_Error
89 ps1_hints_apply( PS_Hints ps_hints,
90 FT_Outline* outline,
91 PSH_Globals globals );
94 #ifdef DEBUG_HINTER
95 extern PSH1_Hint_Table ps1_debug_hint_table;
97 typedef void
98 (*PSH1_HintFunc)( PSH1_Hint hint,
99 FT_Bool vertical );
101 extern PSH1_HintFunc ps1_debug_hint_func;
102 #endif
104 FT_END_HEADER
106 #endif /* __PSHALGO1_H__ */
109 /* END */