| OLD | NEW |
| 1 /***************************************************************************/ | 1 /***************************************************************************/ |
| 2 /* */ | 2 /* */ |
| 3 /* autohint.h */ | 3 /* autohint.h */ |
| 4 /* */ | 4 /* */ |
| 5 /* High-level `autohint' module-specific interface (specification). */ | 5 /* High-level `autohint' module-specific interface (specification). */ |
| 6 /* */ | 6 /* */ |
| 7 /* Copyright 1996-2001, 2002, 2007 by */ | 7 /* Copyright 1996-2002, 2007, 2009, 2012 by */ |
| 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 9 /* */ | 9 /* */ |
| 10 /* This file is part of the FreeType project, and may only be used, */ | 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 */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
| 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
| 14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
| 15 /* */ | 15 /* */ |
| 16 /***************************************************************************/ | 16 /***************************************************************************/ |
| 17 | 17 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 typedef struct FT_AutoHinterRec_ *FT_AutoHinter; | 80 typedef struct FT_AutoHinterRec_ *FT_AutoHinter; |
| 81 | 81 |
| 82 | 82 |
| 83 /*************************************************************************/ | 83 /*************************************************************************/ |
| 84 /* */ | 84 /* */ |
| 85 /* <FuncType> */ | 85 /* <FuncType> */ |
| 86 /* FT_AutoHinter_GlobalGetFunc */ | 86 /* FT_AutoHinter_GlobalGetFunc */ |
| 87 /* */ | 87 /* */ |
| 88 /* <Description> */ | 88 /* <Description> */ |
| 89 /* Retrieves the global hints computed for a given face object the */ | 89 /* Retrieve the global hints computed for a given face object. The */ |
| 90 /* resulting data is dissociated from the face and will survive a */ | 90 /* resulting data is dissociated from the face and will survive a */ |
| 91 /* call to FT_Done_Face(). It must be discarded through the API */ | 91 /* call to FT_Done_Face(). It must be discarded through the API */ |
| 92 /* FT_AutoHinter_GlobalDoneFunc(). */ | 92 /* FT_AutoHinter_GlobalDoneFunc(). */ |
| 93 /* */ | 93 /* */ |
| 94 /* <Input> */ | 94 /* <Input> */ |
| 95 /* hinter :: A handle to the source auto-hinter. */ | 95 /* hinter :: A handle to the source auto-hinter. */ |
| 96 /* */ | 96 /* */ |
| 97 /* face :: A handle to the source face object. */ | 97 /* face :: A handle to the source face object. */ |
| 98 /* */ | 98 /* */ |
| 99 /* <Output> */ | 99 /* <Output> */ |
| 100 /* global_hints :: A typeless pointer to the global hints. */ | 100 /* global_hints :: A typeless pointer to the global hints. */ |
| 101 /* */ | 101 /* */ |
| 102 /* global_len :: The size in bytes of the global hints. */ | 102 /* global_len :: The size in bytes of the global hints. */ |
| 103 /* */ | 103 /* */ |
| 104 typedef void | 104 typedef void |
| 105 (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter, | 105 (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter, |
| 106 FT_Face face, | 106 FT_Face face, |
| 107 void** global_hints, | 107 void** global_hints, |
| 108 long* global_len ); | 108 long* global_len ); |
| 109 | 109 |
| 110 | 110 |
| 111 /*************************************************************************/ | 111 /*************************************************************************/ |
| 112 /* */ | 112 /* */ |
| 113 /* <FuncType> */ | 113 /* <FuncType> */ |
| 114 /* FT_AutoHinter_GlobalDoneFunc */ | 114 /* FT_AutoHinter_GlobalDoneFunc */ |
| 115 /* */ | 115 /* */ |
| 116 /* <Description> */ | 116 /* <Description> */ |
| 117 /* Discards the global hints retrieved through */ | 117 /* Discard the global hints retrieved through */ |
| 118 /* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */ | 118 /* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */ |
| 119 /* are freed from memory. */ | 119 /* are freed from memory. */ |
| 120 /* */ | 120 /* */ |
| 121 /* <Input> */ | 121 /* <Input> */ |
| 122 /* hinter :: A handle to the auto-hinter module. */ | 122 /* hinter :: A handle to the auto-hinter module. */ |
| 123 /* */ | 123 /* */ |
| 124 /* global :: A pointer to retrieved global hints to discard. */ | 124 /* global :: A pointer to retrieved global hints to discard. */ |
| 125 /* */ | 125 /* */ |
| 126 typedef void | 126 typedef void |
| 127 (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter, | 127 (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 /* face :: A handle to the face. */ | 161 /* face :: A handle to the face. */ |
| 162 /* */ | 162 /* */ |
| 163 /* glyph_index :: The glyph index. */ | 163 /* glyph_index :: The glyph index. */ |
| 164 /* */ | 164 /* */ |
| 165 /* load_flags :: The load flags. */ | 165 /* load_flags :: The load flags. */ |
| 166 /* */ | 166 /* */ |
| 167 /* <Note> */ | 167 /* <Note> */ |
| 168 /* This function is capable of loading composite glyphs by hinting */ | 168 /* This function is capable of loading composite glyphs by hinting */ |
| 169 /* each sub-glyph independently (which improves quality). */ | 169 /* each sub-glyph independently (which improves quality). */ |
| 170 /* */ | 170 /* */ |
| 171 /* It will call the font driver with FT_Load_Glyph(), with */ | 171 /* It will call the font driver with @FT_Load_Glyph, with */ |
| 172 /* FT_LOAD_NO_SCALE set. */ | 172 /* @FT_LOAD_NO_SCALE set. */ |
| 173 /* */ | 173 /* */ |
| 174 typedef FT_Error | 174 typedef FT_Error |
| 175 (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter, | 175 (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter, |
| 176 FT_GlyphSlot slot, | 176 FT_GlyphSlot slot, |
| 177 FT_Size size, | 177 FT_Size size, |
| 178 FT_UInt glyph_index, | 178 FT_UInt glyph_index, |
| 179 FT_Int32 load_flags ); | 179 FT_Int32 load_flags ); |
| 180 | 180 |
| 181 | 181 |
| 182 /*************************************************************************/ | 182 /*************************************************************************/ |
| 183 /* */ | 183 /* */ |
| 184 /* <Struct> */ | 184 /* <Struct> */ |
| 185 /* FT_AutoHinter_ServiceRec */ | 185 /* FT_AutoHinter_InterfaceRec */ |
| 186 /* */ | 186 /* */ |
| 187 /* <Description> */ | 187 /* <Description> */ |
| 188 /* The auto-hinter module's interface. */ | 188 /* The auto-hinter module's interface. */ |
| 189 /* */ | 189 /* */ |
| 190 typedef struct FT_AutoHinter_ServiceRec_ | 190 typedef struct FT_AutoHinter_InterfaceRec_ |
| 191 { | 191 { |
| 192 FT_AutoHinter_GlobalResetFunc reset_face; | 192 FT_AutoHinter_GlobalResetFunc reset_face; |
| 193 FT_AutoHinter_GlobalGetFunc get_global_hints; | 193 FT_AutoHinter_GlobalGetFunc get_global_hints; |
| 194 FT_AutoHinter_GlobalDoneFunc done_global_hints; | 194 FT_AutoHinter_GlobalDoneFunc done_global_hints; |
| 195 FT_AutoHinter_GlyphLoadFunc load_glyph; | 195 FT_AutoHinter_GlyphLoadFunc load_glyph; |
| 196 | 196 |
| 197 } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service; | 197 } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface; |
| 198 |
| 198 | 199 |
| 199 #ifndef FT_CONFIG_OPTION_PIC | 200 #ifndef FT_CONFIG_OPTION_PIC |
| 200 | 201 |
| 201 #define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ | 202 #define FT_DEFINE_AUTOHINTER_INTERFACE( \ |
| 202 done_global_hints_, load_glyph_) \ | 203 class_, \ |
| 203 FT_CALLBACK_TABLE_DEF \ | 204 reset_face_, \ |
| 204 const FT_AutoHinter_ServiceRec class_ = \ | 205 get_global_hints_, \ |
| 205 { \ | 206 done_global_hints_, \ |
| 206 reset_face_, get_global_hints_, done_global_hints_, load_glyph_ \ | 207 load_glyph_ ) \ |
| 208 FT_CALLBACK_TABLE_DEF \ |
| 209 const FT_AutoHinter_InterfaceRec class_ = \ |
| 210 { \ |
| 211 reset_face_, \ |
| 212 get_global_hints_, \ |
| 213 done_global_hints_, \ |
| 214 load_glyph_ \ |
| 207 }; | 215 }; |
| 208 | 216 |
| 209 #else /* FT_CONFIG_OPTION_PIC */ | 217 #else /* FT_CONFIG_OPTION_PIC */ |
| 210 | 218 |
| 211 #define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ | 219 #define FT_DEFINE_AUTOHINTER_INTERFACE( \ |
| 212 done_global_hints_, load_glyph_) \ | 220 class_, \ |
| 213 void \ | 221 reset_face_, \ |
| 214 FT_Init_Class_##class_( FT_Library library, \ | 222 get_global_hints_, \ |
| 215 FT_AutoHinter_ServiceRec* clazz) \ | 223 done_global_hints_, \ |
| 216 { \ | 224 load_glyph_ ) \ |
| 217 FT_UNUSED(library); \ | 225 void \ |
| 218 clazz->reset_face = reset_face_; \ | 226 FT_Init_Class_ ## class_( FT_Library library, \ |
| 219 clazz->get_global_hints = get_global_hints_; \ | 227 FT_AutoHinter_InterfaceRec* clazz ) \ |
| 220 clazz->done_global_hints = done_global_hints_; \ | 228 { \ |
| 221 clazz->load_glyph = load_glyph_; \ | 229 FT_UNUSED( library ); \ |
| 230 \ |
| 231 clazz->reset_face = reset_face_; \ |
| 232 clazz->get_global_hints = get_global_hints_; \ |
| 233 clazz->done_global_hints = done_global_hints_; \ |
| 234 clazz->load_glyph = load_glyph_; \ |
| 222 } | 235 } |
| 223 | 236 |
| 224 #endif /* FT_CONFIG_OPTION_PIC */ | 237 #endif /* FT_CONFIG_OPTION_PIC */ |
| 225 | 238 |
| 226 FT_END_HEADER | 239 FT_END_HEADER |
| 227 | 240 |
| 228 #endif /* __AUTOHINT_H__ */ | 241 #endif /* __AUTOHINT_H__ */ |
| 229 | 242 |
| 230 | 243 |
| 231 /* END */ | 244 /* END */ |
| OLD | NEW |