/modules/freetype2/src/autofit/afmodule.c

http://github.com/zpao/v8monkey · C · 94 lines · 54 code · 23 blank · 17 comment · 0 complexity · 06cc68b3abc6d5e1d9533a328c5aff5c MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* afmodule.c */
  4. /* */
  5. /* Auto-fitter module implementation (body). */
  6. /* */
  7. /* Copyright 2003, 2004, 2005, 2006 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. /***************************************************************************/
  17. #include "afmodule.h"
  18. #include "afloader.h"
  19. #include "afpic.h"
  20. #ifdef AF_DEBUG
  21. int _af_debug;
  22. int _af_debug_disable_horz_hints;
  23. int _af_debug_disable_vert_hints;
  24. int _af_debug_disable_blue_hints;
  25. void* _af_debug_hints;
  26. #endif
  27. #include FT_INTERNAL_OBJECTS_H
  28. typedef struct FT_AutofitterRec_
  29. {
  30. FT_ModuleRec root;
  31. AF_LoaderRec loader[1];
  32. } FT_AutofitterRec, *FT_Autofitter;
  33. FT_CALLBACK_DEF( FT_Error )
  34. af_autofitter_init( FT_Autofitter module )
  35. {
  36. return af_loader_init( module->loader, module->root.library->memory );
  37. }
  38. FT_CALLBACK_DEF( void )
  39. af_autofitter_done( FT_Autofitter module )
  40. {
  41. af_loader_done( module->loader );
  42. }
  43. FT_CALLBACK_DEF( FT_Error )
  44. af_autofitter_load_glyph( FT_Autofitter module,
  45. FT_GlyphSlot slot,
  46. FT_Size size,
  47. FT_UInt glyph_index,
  48. FT_Int32 load_flags )
  49. {
  50. FT_UNUSED( size );
  51. return af_loader_load_glyph( module->loader, slot->face,
  52. glyph_index, load_flags );
  53. }
  54. FT_DEFINE_AUTOHINTER_SERVICE(af_autofitter_service,
  55. NULL,
  56. NULL,
  57. NULL,
  58. (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph
  59. )
  60. FT_DEFINE_MODULE(autofit_module_class,
  61. FT_MODULE_HINTER,
  62. sizeof ( FT_AutofitterRec ),
  63. "autofitter",
  64. 0x10000L, /* version 1.0 of the autofitter */
  65. 0x20000L, /* requires FreeType 2.0 or above */
  66. (const void*)&AF_AF_AUTOFITTER_SERVICE_GET,
  67. (FT_Module_Constructor)af_autofitter_init,
  68. (FT_Module_Destructor) af_autofitter_done,
  69. (FT_Module_Requester) NULL
  70. )
  71. /* END */