/src/freetype/src/sfnt/ttcmap.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 125 lines · 76 code · 31 blank · 18 comment · 0 complexity · 26c3c89af05c6ed8ad38243b15b29337 MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* ttcmap.h */
  4. /* */
  5. /* TrueType character mapping table (cmap) support (specification). */
  6. /* */
  7. /* Copyright 2002, 2003, 2004, 2005 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 __TTCMAP_H__
  18. #define __TTCMAP_H__
  19. #include <ft2build.h>
  20. #include FT_INTERNAL_TRUETYPE_TYPES_H
  21. #include FT_INTERNAL_VALIDATE_H
  22. #include FT_SERVICE_TT_CMAP_H
  23. FT_BEGIN_HEADER
  24. #define TT_CMAP_FLAG_UNSORTED 1
  25. #define TT_CMAP_FLAG_OVERLAPPING 2
  26. typedef struct TT_CMapRec_
  27. {
  28. FT_CMapRec cmap;
  29. FT_Byte* data; /* pointer to in-memory cmap table */
  30. FT_Int flags; /* for format 4 only */
  31. } TT_CMapRec, *TT_CMap;
  32. typedef const struct TT_CMap_ClassRec_* TT_CMap_Class;
  33. typedef FT_Error
  34. (*TT_CMap_ValidateFunc)( FT_Byte* data,
  35. FT_Validator valid );
  36. typedef struct TT_CMap_ClassRec_
  37. {
  38. FT_CMap_ClassRec clazz;
  39. FT_UInt format;
  40. TT_CMap_ValidateFunc validate;
  41. TT_CMap_Info_GetFunc get_cmap_info;
  42. } TT_CMap_ClassRec;
  43. #ifndef FT_CONFIG_OPTION_PIC
  44. #define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_, \
  45. char_next_, char_var_index_, char_var_default_, variant_list_, \
  46. charvariant_list_,variantchar_list_, \
  47. format_, validate_, get_cmap_info_) \
  48. FT_CALLBACK_TABLE_DEF \
  49. const TT_CMap_ClassRec class_ = \
  50. { \
  51. {size_, init_, done_, char_index_, \
  52. char_next_, char_var_index_, char_var_default_, variant_list_, \
  53. charvariant_list_, variantchar_list_}, \
  54. format_, validate_, get_cmap_info_ \
  55. };
  56. #else /* FT_CONFIG_OPTION_PIC */
  57. #define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_, \
  58. char_next_, char_var_index_, char_var_default_, variant_list_, \
  59. charvariant_list_,variantchar_list_, \
  60. format_, validate_, get_cmap_info_) \
  61. void \
  62. FT_Init_Class_##class_( TT_CMap_ClassRec* clazz ) \
  63. { \
  64. clazz->clazz.size = size_; \
  65. clazz->clazz.init = init_; \
  66. clazz->clazz.done = done_; \
  67. clazz->clazz.char_index = char_index_; \
  68. clazz->clazz.char_next = char_next_; \
  69. clazz->clazz.char_var_index = char_var_index_; \
  70. clazz->clazz.char_var_default = char_var_default_; \
  71. clazz->clazz.variant_list = variant_list_; \
  72. clazz->clazz.charvariant_list = charvariant_list_; \
  73. clazz->clazz.variantchar_list = variantchar_list_; \
  74. clazz->format = format_; \
  75. clazz->validate = validate_; \
  76. clazz->get_cmap_info = get_cmap_info_; \
  77. }
  78. #endif /* FT_CONFIG_OPTION_PIC */
  79. typedef struct TT_ValidatorRec_
  80. {
  81. FT_ValidatorRec validator;
  82. FT_UInt num_glyphs;
  83. } TT_ValidatorRec, *TT_Validator;
  84. #define TT_VALIDATOR( x ) ((TT_Validator)( x ))
  85. #define TT_VALID_GLYPH_COUNT( x ) TT_VALIDATOR( x )->num_glyphs
  86. FT_LOCAL( FT_Error )
  87. tt_face_build_cmaps( TT_Face face );
  88. /* used in tt-cmaps service */
  89. FT_LOCAL( FT_Error )
  90. tt_get_cmap_info( FT_CharMap charmap,
  91. TT_CMapInfo *cmap_info );
  92. FT_END_HEADER
  93. #endif /* __TTCMAP_H__ */
  94. /* END */