misc fixes to get rrdtool working without included libraries.
[rrdtool.git] / libraries / freetype-2.0.5 / ahmodule.c
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ahmodule.c                                                             */
4 /*                                                                         */
5 /*    Auto-hinting module implementation (declaration).                    */
6 /*                                                                         */
7 /*  Copyright 2000-2001 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 <ft2build.h>
23 #include FT_MODULE_H
24 #include "ahhint.h"
25
26
27   typedef struct  FT_AutoHinterRec_
28   {
29     FT_ModuleRec  root;
30     AH_Hinter*    hinter;
31
32   } FT_AutoHinterRec;
33
34
35   FT_CALLBACK_DEF( FT_Error )
36   ft_autohinter_init( FT_AutoHinter  module )
37   {
38     return ah_hinter_new( module->root.library, &module->hinter );
39   }
40
41
42   FT_CALLBACK_DEF( void )
43   ft_autohinter_done( FT_AutoHinter  module )
44   {
45     ah_hinter_done( module->hinter );
46   }
47
48
49   FT_CALLBACK_DEF( FT_Error )
50   ft_autohinter_load( FT_AutoHinter  module,
51                       FT_GlyphSlot   slot,
52                       FT_Size        size,
53                       FT_UInt        glyph_index,
54                       FT_ULong       load_flags )
55   {
56     return ah_hinter_load_glyph( module->hinter,
57                                  slot, size, glyph_index, load_flags );
58   }
59
60
61   FT_CALLBACK_DEF( void )
62   ft_autohinter_reset( FT_AutoHinter  module,
63                        FT_Face        face )
64   {
65     UNUSED( module );
66
67     if ( face->autohint.data )
68       ah_hinter_done_face_globals( (AH_Face_Globals*)(face->autohint.data) );
69   }
70
71
72   FT_CALLBACK_DEF( void )
73   ft_autohinter_get_globals( FT_AutoHinter  module,
74                              FT_Face        face,
75                              void**         global_hints,
76                              long*          global_len )
77   {
78     ah_hinter_get_global_hints( module->hinter, face,
79                                 global_hints, global_len );
80   }
81
82
83   FT_CALLBACK_DEF( void )
84   ft_autohinter_done_globals( FT_AutoHinter  module,
85                               void*          global_hints )
86   {
87     ah_hinter_done_global_hints( module->hinter, global_hints );
88   }
89
90
91   FT_CALLBACK_TABLE_DEF
92   const FT_AutoHinter_Interface  autohinter_interface =
93   {
94     ft_autohinter_reset,
95     ft_autohinter_load,
96     ft_autohinter_get_globals,
97     ft_autohinter_done_globals
98   };
99
100
101   FT_CALLBACK_TABLE_DEF
102   const FT_Module_Class  autohint_module_class =
103   {
104     ft_module_hinter,
105     sizeof ( FT_AutoHinterRec ),
106
107     "autohinter",
108     0x10000L,   /* version 1.0 of the autohinter  */
109     0x20000L,   /* requires FreeType 2.0 or above */
110
111     (const void*)&autohinter_interface,
112
113     (FT_Module_Constructor)ft_autohinter_init,
114     (FT_Module_Destructor) ft_autohinter_done,
115     (FT_Module_Requester)  0
116   };
117
118
119 /* END */