/src/compiler/android-ndk/jni/freetype/src/cff/cfftypes.h

http://ftk.googlecode.com/ · C++ Header · 274 lines · 156 code · 61 blank · 57 comment · 0 complexity · 07c2b92ec26781a97336b723c66fc79d MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* cfftypes.h */
  4. /* */
  5. /* Basic OpenType/CFF type definitions and interface (specification */
  6. /* only). */
  7. /* */
  8. /* Copyright 1996-2001, 2002, 2003, 2006, 2007, 2008 by */
  9. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  10. /* */
  11. /* This file is part of the FreeType project, and may only be used, */
  12. /* modified, and distributed under the terms of the FreeType project */
  13. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  14. /* this file you indicate that you have read the license and */
  15. /* understand and accept it fully. */
  16. /* */
  17. /***************************************************************************/
  18. #ifndef __CFFTYPES_H__
  19. #define __CFFTYPES_H__
  20. #include <ft2build.h>
  21. #include FT_FREETYPE_H
  22. #include FT_TYPE1_TABLES_H
  23. FT_BEGIN_HEADER
  24. /*************************************************************************/
  25. /* */
  26. /* <Struct> */
  27. /* CFF_IndexRec */
  28. /* */
  29. /* <Description> */
  30. /* A structure used to model a CFF Index table. */
  31. /* */
  32. /* <Fields> */
  33. /* stream :: The source input stream. */
  34. /* */
  35. /* start :: The position of the first index byte in the */
  36. /* input stream. */
  37. /* */
  38. /* count :: The number of elements in the index. */
  39. /* */
  40. /* off_size :: The size in bytes of object offsets in index. */
  41. /* */
  42. /* data_offset :: The position of first data byte in the index's */
  43. /* bytes. */
  44. /* */
  45. /* data_size :: The size of the data table in this index. */
  46. /* */
  47. /* offsets :: A table of element offsets in the index. Must be */
  48. /* loaded explicitly. */
  49. /* */
  50. /* bytes :: If the index is loaded in memory, its bytes. */
  51. /* */
  52. typedef struct CFF_IndexRec_
  53. {
  54. FT_Stream stream;
  55. FT_ULong start;
  56. FT_UInt count;
  57. FT_Byte off_size;
  58. FT_ULong data_offset;
  59. FT_ULong data_size;
  60. FT_ULong* offsets;
  61. FT_Byte* bytes;
  62. } CFF_IndexRec, *CFF_Index;
  63. typedef struct CFF_EncodingRec_
  64. {
  65. FT_UInt format;
  66. FT_ULong offset;
  67. FT_UInt count;
  68. FT_UShort sids [256]; /* avoid dynamic allocations */
  69. FT_UShort codes[256];
  70. } CFF_EncodingRec, *CFF_Encoding;
  71. typedef struct CFF_CharsetRec_
  72. {
  73. FT_UInt format;
  74. FT_ULong offset;
  75. FT_UShort* sids;
  76. FT_UShort* cids; /* the inverse mapping of `sids'; only needed */
  77. /* for CID-keyed fonts */
  78. FT_UInt max_cid;
  79. FT_UInt num_glyphs;
  80. } CFF_CharsetRec, *CFF_Charset;
  81. typedef struct CFF_FontRecDictRec_
  82. {
  83. FT_UInt version;
  84. FT_UInt notice;
  85. FT_UInt copyright;
  86. FT_UInt full_name;
  87. FT_UInt family_name;
  88. FT_UInt weight;
  89. FT_Bool is_fixed_pitch;
  90. FT_Fixed italic_angle;
  91. FT_Fixed underline_position;
  92. FT_Fixed underline_thickness;
  93. FT_Int paint_type;
  94. FT_Int charstring_type;
  95. FT_Matrix font_matrix;
  96. FT_ULong units_per_em; /* temporarily used as scaling value also */
  97. FT_Vector font_offset;
  98. FT_ULong unique_id;
  99. FT_BBox font_bbox;
  100. FT_Pos stroke_width;
  101. FT_ULong charset_offset;
  102. FT_ULong encoding_offset;
  103. FT_ULong charstrings_offset;
  104. FT_ULong private_offset;
  105. FT_ULong private_size;
  106. FT_Long synthetic_base;
  107. FT_UInt embedded_postscript;
  108. /* these should only be used for the top-level font dictionary */
  109. FT_UInt cid_registry;
  110. FT_UInt cid_ordering;
  111. FT_Long cid_supplement;
  112. FT_Long cid_font_version;
  113. FT_Long cid_font_revision;
  114. FT_Long cid_font_type;
  115. FT_ULong cid_count;
  116. FT_ULong cid_uid_base;
  117. FT_ULong cid_fd_array_offset;
  118. FT_ULong cid_fd_select_offset;
  119. FT_UInt cid_font_name;
  120. } CFF_FontRecDictRec, *CFF_FontRecDict;
  121. typedef struct CFF_PrivateRec_
  122. {
  123. FT_Byte num_blue_values;
  124. FT_Byte num_other_blues;
  125. FT_Byte num_family_blues;
  126. FT_Byte num_family_other_blues;
  127. FT_Pos blue_values[14];
  128. FT_Pos other_blues[10];
  129. FT_Pos family_blues[14];
  130. FT_Pos family_other_blues[10];
  131. FT_Fixed blue_scale;
  132. FT_Pos blue_shift;
  133. FT_Pos blue_fuzz;
  134. FT_Pos standard_width;
  135. FT_Pos standard_height;
  136. FT_Byte num_snap_widths;
  137. FT_Byte num_snap_heights;
  138. FT_Pos snap_widths[13];
  139. FT_Pos snap_heights[13];
  140. FT_Bool force_bold;
  141. FT_Fixed force_bold_threshold;
  142. FT_Int lenIV;
  143. FT_Int language_group;
  144. FT_Fixed expansion_factor;
  145. FT_Long initial_random_seed;
  146. FT_ULong local_subrs_offset;
  147. FT_Pos default_width;
  148. FT_Pos nominal_width;
  149. } CFF_PrivateRec, *CFF_Private;
  150. typedef struct CFF_FDSelectRec_
  151. {
  152. FT_Byte format;
  153. FT_UInt range_count;
  154. /* that's the table, taken from the file `as is' */
  155. FT_Byte* data;
  156. FT_UInt data_size;
  157. /* small cache for format 3 only */
  158. FT_UInt cache_first;
  159. FT_UInt cache_count;
  160. FT_Byte cache_fd;
  161. } CFF_FDSelectRec, *CFF_FDSelect;
  162. /* A SubFont packs a font dict and a private dict together. They are */
  163. /* needed to support CID-keyed CFF fonts. */
  164. typedef struct CFF_SubFontRec_
  165. {
  166. CFF_FontRecDictRec font_dict;
  167. CFF_PrivateRec private_dict;
  168. CFF_IndexRec local_subrs_index;
  169. FT_UInt num_local_subrs;
  170. FT_Byte** local_subrs;
  171. } CFF_SubFontRec, *CFF_SubFont;
  172. /* maximum number of sub-fonts in a CID-keyed file */
  173. #define CFF_MAX_CID_FONTS 32
  174. typedef struct CFF_FontRec_
  175. {
  176. FT_Stream stream;
  177. FT_Memory memory;
  178. FT_UInt num_faces;
  179. FT_UInt num_glyphs;
  180. FT_Byte version_major;
  181. FT_Byte version_minor;
  182. FT_Byte header_size;
  183. FT_Byte absolute_offsize;
  184. CFF_IndexRec name_index;
  185. CFF_IndexRec top_dict_index;
  186. CFF_IndexRec string_index;
  187. CFF_IndexRec global_subrs_index;
  188. CFF_EncodingRec encoding;
  189. CFF_CharsetRec charset;
  190. CFF_IndexRec charstrings_index;
  191. CFF_IndexRec font_dict_index;
  192. CFF_IndexRec private_index;
  193. CFF_IndexRec local_subrs_index;
  194. FT_String* font_name;
  195. FT_UInt num_global_subrs;
  196. FT_Byte** global_subrs;
  197. CFF_SubFontRec top_font;
  198. FT_UInt num_subfonts;
  199. CFF_SubFont subfonts[CFF_MAX_CID_FONTS];
  200. CFF_FDSelectRec fd_select;
  201. /* interface to PostScript hinter */
  202. void* pshinter;
  203. /* interface to Postscript Names service */
  204. void* psnames;
  205. /* since version 2.3.0 */
  206. PS_FontInfoRec* font_info; /* font info dictionary */
  207. /* since version 2.3.6 */
  208. FT_String* registry;
  209. FT_String* ordering;
  210. } CFF_FontRec, *CFF_Font;
  211. FT_END_HEADER
  212. #endif /* __CFFTYPES_H__ */
  213. /* END */