svcid.h 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /***************************************************************************/
  2. /* */
  3. /* svcid.h */
  4. /* */
  5. /* The FreeType CID font services (specification). */
  6. /* */
  7. /* Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal. */
  8. /* */
  9. /* This file is part of the FreeType project, and may only be used, */
  10. /* modified, and distributed under the terms of the FreeType project */
  11. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  12. /* this file you indicate that you have read the license and */
  13. /* understand and accept it fully. */
  14. /* */
  15. /***************************************************************************/
  16. #ifndef __SVCID_H__
  17. #define __SVCID_H__
  18. #include FT_INTERNAL_SERVICE_H
  19. FT_BEGIN_HEADER
  20. #define FT_SERVICE_ID_CID "CID"
  21. typedef FT_Error
  22. (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face,
  23. const char* *registry,
  24. const char* *ordering,
  25. FT_Int *supplement );
  26. typedef FT_Error
  27. (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face,
  28. FT_Bool *is_cid );
  29. typedef FT_Error
  30. (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face,
  31. FT_UInt glyph_index,
  32. FT_UInt *cid );
  33. FT_DEFINE_SERVICE( CID )
  34. {
  35. FT_CID_GetRegistryOrderingSupplementFunc get_ros;
  36. FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid;
  37. FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index;
  38. };
  39. #ifndef FT_CONFIG_OPTION_PIC
  40. #define FT_DEFINE_SERVICE_CIDREC( class_, \
  41. get_ros_, \
  42. get_is_cid_, \
  43. get_cid_from_glyph_index_ ) \
  44. static const FT_Service_CIDRec class_ = \
  45. { \
  46. get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
  47. };
  48. #else /* FT_CONFIG_OPTION_PIC */
  49. #define FT_DEFINE_SERVICE_CIDREC( class_, \
  50. get_ros_, \
  51. get_is_cid_, \
  52. get_cid_from_glyph_index_ ) \
  53. void \
  54. FT_Init_Class_ ## class_( FT_Library library, \
  55. FT_Service_CIDRec* clazz ) \
  56. { \
  57. FT_UNUSED( library ); \
  58. \
  59. clazz->get_ros = get_ros_; \
  60. clazz->get_is_cid = get_is_cid_; \
  61. clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
  62. }
  63. #endif /* FT_CONFIG_OPTION_PIC */
  64. /* */
  65. FT_END_HEADER
  66. #endif /* __SVCID_H__ */
  67. /* END */