svgldict.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /***************************************************************************/
  2. /* */
  3. /* svgldict.h */
  4. /* */
  5. /* The FreeType glyph dictionary services (specification). */
  6. /* */
  7. /* Copyright 2003, 2009, 2012 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. #ifndef __SVGLDICT_H__
  18. #define __SVGLDICT_H__
  19. #include FT_INTERNAL_SERVICE_H
  20. FT_BEGIN_HEADER
  21. /*
  22. * A service used to retrieve glyph names, as well as to find the
  23. * index of a given glyph name in a font.
  24. *
  25. */
  26. #define FT_SERVICE_ID_GLYPH_DICT "glyph-dict"
  27. typedef FT_Error
  28. (*FT_GlyphDict_GetNameFunc)( FT_Face face,
  29. FT_UInt glyph_index,
  30. FT_Pointer buffer,
  31. FT_UInt buffer_max );
  32. typedef FT_UInt
  33. (*FT_GlyphDict_NameIndexFunc)( FT_Face face,
  34. FT_String* glyph_name );
  35. FT_DEFINE_SERVICE( GlyphDict )
  36. {
  37. FT_GlyphDict_GetNameFunc get_name;
  38. FT_GlyphDict_NameIndexFunc name_index; /* optional */
  39. };
  40. #ifndef FT_CONFIG_OPTION_PIC
  41. #define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
  42. get_name_, \
  43. name_index_) \
  44. static const FT_Service_GlyphDictRec class_ = \
  45. { \
  46. get_name_, name_index_ \
  47. };
  48. #else /* FT_CONFIG_OPTION_PIC */
  49. #define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
  50. get_name_, \
  51. name_index_) \
  52. void \
  53. FT_Init_Class_ ## class_( FT_Library library, \
  54. FT_Service_GlyphDictRec* clazz ) \
  55. { \
  56. FT_UNUSED( library ); \
  57. \
  58. clazz->get_name = get_name_; \
  59. clazz->name_index = name_index_; \
  60. }
  61. #endif /* FT_CONFIG_OPTION_PIC */
  62. /* */
  63. FT_END_HEADER
  64. #endif /* __SVGLDICT_H__ */