:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / subsys / win32k / freetype / src / autohint / ahmodule.c
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ahmodule.c                                                             */
4 /*                                                                         */
5 /*    Auto-hinting module implementation (declaration).                    */
6 /*                                                                         */
7 /*  Copyright 2000 Catharon Productions Inc.                               */
8 /*  Author: David Turner                                                   */
9 /*                                                                         */
10 /*  This file is part of the Catharon Typography Project and shall only    */
11 /*  be used, modified, and distributed under the terms of the Catharon     */
12 /*  Open Source License that should come with this file under the name     */
13 /*  `CatharonLicense.txt'.  By continuing to use, modify, or distribute    */
14 /*  this file you indicate that you have read the license and              */
15 /*  understand and accept it fully.                                        */
16 /*                                                                         */
17 /*  Note that this license is compatible with the FreeType license.        */
18 /*                                                                         */
19 /***************************************************************************/
20
21
22 #include <freetype/ftmodule.h>
23
24
25 #ifdef FT_FLAT_COMPILE
26
27 #include "ahhint.h"
28
29 #else
30
31 #include <freetype/src/autohint/ahhint.h>
32
33 #endif
34
35
36   typedef struct  FT_AutoHinterRec_
37   {
38     FT_ModuleRec  root;
39     AH_Hinter*    hinter;
40
41   } FT_AutoHinterRec;
42
43
44   static
45   FT_Error  ft_autohinter_init( FT_AutoHinter  module )
46   {
47     return ah_hinter_new( module->root.library, &module->hinter );
48   }
49
50
51   static
52   void  ft_autohinter_done( FT_AutoHinter  module )
53   {
54     ah_hinter_done( module->hinter );
55   }
56
57
58   static
59   FT_Error  ft_autohinter_load( FT_AutoHinter  module,
60                                 FT_GlyphSlot   slot,
61                                 FT_Size        size,
62                                 FT_UInt        glyph_index,
63                                 FT_ULong       load_flags )
64   {
65     return ah_hinter_load_glyph( module->hinter,
66                                  slot, size, glyph_index, load_flags );
67   }
68
69
70   static
71   void   ft_autohinter_reset( FT_AutoHinter  module,
72                               FT_Face        face )
73   {
74     UNUSED( module );
75
76     if ( face->autohint.data )
77       ah_hinter_done_face_globals( (AH_Face_Globals*)(face->autohint.data) );
78   }
79
80
81   static
82   void  ft_autohinter_get_globals( FT_AutoHinter  module,
83                                    FT_Face        face,
84                                    void**         global_hints,
85                                    long*          global_len )
86   {
87     ah_hinter_get_global_hints( module->hinter, face,
88                                 global_hints, global_len );
89   }
90
91
92   static
93   void  ft_autohinter_done_globals( FT_AutoHinter  module,
94                                     void*          global_hints )
95   {
96     ah_hinter_done_global_hints( module->hinter, global_hints );
97   }
98
99
100   static
101   const FT_AutoHinter_Interface  autohinter_interface =
102   {
103     ft_autohinter_reset,
104     ft_autohinter_load,
105     ft_autohinter_get_globals,
106     ft_autohinter_done_globals
107   };
108
109
110   const FT_Module_Class  autohint_module_class =
111   {
112     ft_module_hinter,
113     sizeof ( FT_AutoHinterRec ),
114
115     "autohinter",
116     0x10000L,   /* version 1.0 of the autohinter  */
117     0x20000L,   /* requires FreeType 2.0 or above */
118
119     (const void*)&autohinter_interface,
120
121     (FT_Module_Constructor)ft_autohinter_init,
122     (FT_Module_Destructor) ft_autohinter_done,
123     (FT_Module_Requester)  0
124   };
125
126
127 /* END */