/src/compiler/android-ndk/jni/freetype/include/freetype/t1tables.h

http://ftk.googlecode.com/ · C++ Header · 504 lines · 164 code · 99 blank · 241 comment · 0 complexity · 2d7c7e51f6bef55c98c188bd17c02c33 MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* t1tables.h */
  4. /* */
  5. /* Basic Type 1/Type 2 tables definitions and interface (specification */
  6. /* only). */
  7. /* */
  8. /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 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 __T1TABLES_H__
  19. #define __T1TABLES_H__
  20. #include <ft2build.h>
  21. #include FT_FREETYPE_H
  22. #ifdef FREETYPE_H
  23. #error "freetype.h of FreeType 1 has been loaded!"
  24. #error "Please fix the directory search order for header files"
  25. #error "so that freetype.h of FreeType 2 is found first."
  26. #endif
  27. FT_BEGIN_HEADER
  28. /*************************************************************************/
  29. /* */
  30. /* <Section> */
  31. /* type1_tables */
  32. /* */
  33. /* <Title> */
  34. /* Type 1 Tables */
  35. /* */
  36. /* <Abstract> */
  37. /* Type~1 (PostScript) specific font tables. */
  38. /* */
  39. /* <Description> */
  40. /* This section contains the definition of Type 1-specific tables, */
  41. /* including structures related to other PostScript font formats. */
  42. /* */
  43. /*************************************************************************/
  44. /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
  45. /* structures in order to support Multiple Master fonts. */
  46. /*************************************************************************/
  47. /* */
  48. /* <Struct> */
  49. /* PS_FontInfoRec */
  50. /* */
  51. /* <Description> */
  52. /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
  53. /* Note that for Multiple Master fonts, each instance has its own */
  54. /* FontInfo dictionary. */
  55. /* */
  56. typedef struct PS_FontInfoRec_
  57. {
  58. FT_String* version;
  59. FT_String* notice;
  60. FT_String* full_name;
  61. FT_String* family_name;
  62. FT_String* weight;
  63. FT_Long italic_angle;
  64. FT_Bool is_fixed_pitch;
  65. FT_Short underline_position;
  66. FT_UShort underline_thickness;
  67. } PS_FontInfoRec;
  68. /*************************************************************************/
  69. /* */
  70. /* <Struct> */
  71. /* PS_FontInfo */
  72. /* */
  73. /* <Description> */
  74. /* A handle to a @PS_FontInfoRec structure. */
  75. /* */
  76. typedef struct PS_FontInfoRec_* PS_FontInfo;
  77. /*************************************************************************/
  78. /* */
  79. /* <Struct> */
  80. /* T1_FontInfo */
  81. /* */
  82. /* <Description> */
  83. /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
  84. /* kept to maintain source compatibility between various versions of */
  85. /* FreeType. */
  86. /* */
  87. typedef PS_FontInfoRec T1_FontInfo;
  88. /*************************************************************************/
  89. /* */
  90. /* <Struct> */
  91. /* PS_PrivateRec */
  92. /* */
  93. /* <Description> */
  94. /* A structure used to model a Type~1 or Type~2 private dictionary. */
  95. /* Note that for Multiple Master fonts, each instance has its own */
  96. /* Private dictionary. */
  97. /* */
  98. typedef struct PS_PrivateRec_
  99. {
  100. FT_Int unique_id;
  101. FT_Int lenIV;
  102. FT_Byte num_blue_values;
  103. FT_Byte num_other_blues;
  104. FT_Byte num_family_blues;
  105. FT_Byte num_family_other_blues;
  106. FT_Short blue_values[14];
  107. FT_Short other_blues[10];
  108. FT_Short family_blues [14];
  109. FT_Short family_other_blues[10];
  110. FT_Fixed blue_scale;
  111. FT_Int blue_shift;
  112. FT_Int blue_fuzz;
  113. FT_UShort standard_width[1];
  114. FT_UShort standard_height[1];
  115. FT_Byte num_snap_widths;
  116. FT_Byte num_snap_heights;
  117. FT_Bool force_bold;
  118. FT_Bool round_stem_up;
  119. FT_Short snap_widths [13]; /* including std width */
  120. FT_Short snap_heights[13]; /* including std height */
  121. FT_Fixed expansion_factor;
  122. FT_Long language_group;
  123. FT_Long password;
  124. FT_Short min_feature[2];
  125. } PS_PrivateRec;
  126. /*************************************************************************/
  127. /* */
  128. /* <Struct> */
  129. /* PS_Private */
  130. /* */
  131. /* <Description> */
  132. /* A handle to a @PS_PrivateRec structure. */
  133. /* */
  134. typedef struct PS_PrivateRec_* PS_Private;
  135. /*************************************************************************/
  136. /* */
  137. /* <Struct> */
  138. /* T1_Private */
  139. /* */
  140. /* <Description> */
  141. /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
  142. /* kept to maintain source compatibility between various versions of */
  143. /* FreeType. */
  144. /* */
  145. typedef PS_PrivateRec T1_Private;
  146. /*************************************************************************/
  147. /* */
  148. /* <Enum> */
  149. /* T1_Blend_Flags */
  150. /* */
  151. /* <Description> */
  152. /* A set of flags used to indicate which fields are present in a */
  153. /* given blend dictionary (font info or private). Used to support */
  154. /* Multiple Masters fonts. */
  155. /* */
  156. typedef enum T1_Blend_Flags_
  157. {
  158. /*# required fields in a FontInfo blend dictionary */
  159. T1_BLEND_UNDERLINE_POSITION = 0,
  160. T1_BLEND_UNDERLINE_THICKNESS,
  161. T1_BLEND_ITALIC_ANGLE,
  162. /*# required fields in a Private blend dictionary */
  163. T1_BLEND_BLUE_VALUES,
  164. T1_BLEND_OTHER_BLUES,
  165. T1_BLEND_STANDARD_WIDTH,
  166. T1_BLEND_STANDARD_HEIGHT,
  167. T1_BLEND_STEM_SNAP_WIDTHS,
  168. T1_BLEND_STEM_SNAP_HEIGHTS,
  169. T1_BLEND_BLUE_SCALE,
  170. T1_BLEND_BLUE_SHIFT,
  171. T1_BLEND_FAMILY_BLUES,
  172. T1_BLEND_FAMILY_OTHER_BLUES,
  173. T1_BLEND_FORCE_BOLD,
  174. /*# never remove */
  175. T1_BLEND_MAX
  176. } T1_Blend_Flags;
  177. /* */
  178. /*# backwards compatible definitions */
  179. #define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
  180. #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
  181. #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
  182. #define t1_blend_blue_values T1_BLEND_BLUE_VALUES
  183. #define t1_blend_other_blues T1_BLEND_OTHER_BLUES
  184. #define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
  185. #define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
  186. #define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
  187. #define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
  188. #define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
  189. #define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
  190. #define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
  191. #define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
  192. #define t1_blend_force_bold T1_BLEND_FORCE_BOLD
  193. #define t1_blend_max T1_BLEND_MAX
  194. /* maximum number of Multiple Masters designs, as defined in the spec */
  195. #define T1_MAX_MM_DESIGNS 16
  196. /* maximum number of Multiple Masters axes, as defined in the spec */
  197. #define T1_MAX_MM_AXIS 4
  198. /* maximum number of elements in a design map */
  199. #define T1_MAX_MM_MAP_POINTS 20
  200. /* this structure is used to store the BlendDesignMap entry for an axis */
  201. typedef struct PS_DesignMap_
  202. {
  203. FT_Byte num_points;
  204. FT_Long* design_points;
  205. FT_Fixed* blend_points;
  206. } PS_DesignMapRec, *PS_DesignMap;
  207. /* backwards-compatible definition */
  208. typedef PS_DesignMapRec T1_DesignMap;
  209. typedef struct PS_BlendRec_
  210. {
  211. FT_UInt num_designs;
  212. FT_UInt num_axis;
  213. FT_String* axis_names[T1_MAX_MM_AXIS];
  214. FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
  215. PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
  216. FT_Fixed* weight_vector;
  217. FT_Fixed* default_weight_vector;
  218. PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
  219. PS_Private privates [T1_MAX_MM_DESIGNS + 1];
  220. FT_ULong blend_bitflags;
  221. FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
  222. /* since 2.3.0 */
  223. /* undocumented, optional: the default design instance; */
  224. /* corresponds to default_weight_vector -- */
  225. /* num_default_design_vector == 0 means it is not present */
  226. /* in the font and associated metrics files */
  227. FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
  228. FT_UInt num_default_design_vector;
  229. } PS_BlendRec, *PS_Blend;
  230. /* backwards-compatible definition */
  231. typedef PS_BlendRec T1_Blend;
  232. /*************************************************************************/
  233. /* */
  234. /* <Struct> */
  235. /* CID_FaceDictRec */
  236. /* */
  237. /* <Description> */
  238. /* A structure used to represent data in a CID top-level dictionary. */
  239. /* */
  240. typedef struct CID_FaceDictRec_
  241. {
  242. PS_PrivateRec private_dict;
  243. FT_UInt len_buildchar;
  244. FT_Fixed forcebold_threshold;
  245. FT_Pos stroke_width;
  246. FT_Fixed expansion_factor;
  247. FT_Byte paint_type;
  248. FT_Byte font_type;
  249. FT_Matrix font_matrix;
  250. FT_Vector font_offset;
  251. FT_UInt num_subrs;
  252. FT_ULong subrmap_offset;
  253. FT_Int sd_bytes;
  254. } CID_FaceDictRec;
  255. /*************************************************************************/
  256. /* */
  257. /* <Struct> */
  258. /* CID_FaceDict */
  259. /* */
  260. /* <Description> */
  261. /* A handle to a @CID_FaceDictRec structure. */
  262. /* */
  263. typedef struct CID_FaceDictRec_* CID_FaceDict;
  264. /* */
  265. /* backwards-compatible definition */
  266. typedef CID_FaceDictRec CID_FontDict;
  267. /*************************************************************************/
  268. /* */
  269. /* <Struct> */
  270. /* CID_FaceInfoRec */
  271. /* */
  272. /* <Description> */
  273. /* A structure used to represent CID Face information. */
  274. /* */
  275. typedef struct CID_FaceInfoRec_
  276. {
  277. FT_String* cid_font_name;
  278. FT_Fixed cid_version;
  279. FT_Int cid_font_type;
  280. FT_String* registry;
  281. FT_String* ordering;
  282. FT_Int supplement;
  283. PS_FontInfoRec font_info;
  284. FT_BBox font_bbox;
  285. FT_ULong uid_base;
  286. FT_Int num_xuid;
  287. FT_ULong xuid[16];
  288. FT_ULong cidmap_offset;
  289. FT_Int fd_bytes;
  290. FT_Int gd_bytes;
  291. FT_ULong cid_count;
  292. FT_Int num_dicts;
  293. CID_FaceDict font_dicts;
  294. FT_ULong data_offset;
  295. } CID_FaceInfoRec;
  296. /*************************************************************************/
  297. /* */
  298. /* <Struct> */
  299. /* CID_FaceInfo */
  300. /* */
  301. /* <Description> */
  302. /* A handle to a @CID_FaceInfoRec structure. */
  303. /* */
  304. typedef struct CID_FaceInfoRec_* CID_FaceInfo;
  305. /*************************************************************************/
  306. /* */
  307. /* <Struct> */
  308. /* CID_Info */
  309. /* */
  310. /* <Description> */
  311. /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
  312. /* kept to maintain source compatibility between various versions of */
  313. /* FreeType. */
  314. /* */
  315. typedef CID_FaceInfoRec CID_Info;
  316. /************************************************************************
  317. *
  318. * @function:
  319. * FT_Has_PS_Glyph_Names
  320. *
  321. * @description:
  322. * Return true if a given face provides reliable PostScript glyph
  323. * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
  324. * except that certain fonts (mostly TrueType) contain incorrect
  325. * glyph name tables.
  326. *
  327. * When this function returns true, the caller is sure that the glyph
  328. * names returned by @FT_Get_Glyph_Name are reliable.
  329. *
  330. * @input:
  331. * face ::
  332. * face handle
  333. *
  334. * @return:
  335. * Boolean. True if glyph names are reliable.
  336. *
  337. */
  338. FT_EXPORT( FT_Int )
  339. FT_Has_PS_Glyph_Names( FT_Face face );
  340. /************************************************************************
  341. *
  342. * @function:
  343. * FT_Get_PS_Font_Info
  344. *
  345. * @description:
  346. * Retrieve the @PS_FontInfoRec structure corresponding to a given
  347. * PostScript font.
  348. *
  349. * @input:
  350. * face ::
  351. * PostScript face handle.
  352. *
  353. * @output:
  354. * afont_info ::
  355. * Output font info structure pointer.
  356. *
  357. * @return:
  358. * FreeType error code. 0~means success.
  359. *
  360. * @note:
  361. * The string pointers within the font info structure are owned by
  362. * the face and don't need to be freed by the caller.
  363. *
  364. * If the font's format is not PostScript-based, this function will
  365. * return the `FT_Err_Invalid_Argument' error code.
  366. *
  367. */
  368. FT_EXPORT( FT_Error )
  369. FT_Get_PS_Font_Info( FT_Face face,
  370. PS_FontInfo afont_info );
  371. /************************************************************************
  372. *
  373. * @function:
  374. * FT_Get_PS_Font_Private
  375. *
  376. * @description:
  377. * Retrieve the @PS_PrivateRec structure corresponding to a given
  378. * PostScript font.
  379. *
  380. * @input:
  381. * face ::
  382. * PostScript face handle.
  383. *
  384. * @output:
  385. * afont_private ::
  386. * Output private dictionary structure pointer.
  387. *
  388. * @return:
  389. * FreeType error code. 0~means success.
  390. *
  391. * @note:
  392. * The string pointers within the @PS_PrivateRec structure are owned by
  393. * the face and don't need to be freed by the caller.
  394. *
  395. * If the font's format is not PostScript-based, this function returns
  396. * the `FT_Err_Invalid_Argument' error code.
  397. *
  398. */
  399. FT_EXPORT( FT_Error )
  400. FT_Get_PS_Font_Private( FT_Face face,
  401. PS_Private afont_private );
  402. /* */
  403. FT_END_HEADER
  404. #endif /* __T1TABLES_H__ */
  405. /* END */