t1tables.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. /***************************************************************************/
  2. /* */
  3. /* t1tables.h */
  4. /* */
  5. /* Basic Type 1/Type 2 tables definitions and interface (specification */
  6. /* only). */
  7. /* */
  8. /* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2014 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. /* <Order> */
  44. /* PS_FontInfoRec */
  45. /* PS_FontInfo */
  46. /* PS_PrivateRec */
  47. /* PS_Private */
  48. /* */
  49. /* CID_FaceDictRec */
  50. /* CID_FaceDict */
  51. /* CID_FaceInfoRec */
  52. /* CID_FaceInfo */
  53. /* */
  54. /* FT_Has_PS_Glyph_Names */
  55. /* FT_Get_PS_Font_Info */
  56. /* FT_Get_PS_Font_Private */
  57. /* FT_Get_PS_Font_Value */
  58. /* */
  59. /* T1_Blend_Flags */
  60. /* T1_EncodingType */
  61. /* PS_Dict_Keys */
  62. /* */
  63. /*************************************************************************/
  64. /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
  65. /* structures in order to support Multiple Master fonts. */
  66. /*************************************************************************/
  67. /* */
  68. /* <Struct> */
  69. /* PS_FontInfoRec */
  70. /* */
  71. /* <Description> */
  72. /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
  73. /* Note that for Multiple Master fonts, each instance has its own */
  74. /* FontInfo dictionary. */
  75. /* */
  76. typedef struct PS_FontInfoRec_
  77. {
  78. FT_String* version;
  79. FT_String* notice;
  80. FT_String* full_name;
  81. FT_String* family_name;
  82. FT_String* weight;
  83. FT_Long italic_angle;
  84. FT_Bool is_fixed_pitch;
  85. FT_Short underline_position;
  86. FT_UShort underline_thickness;
  87. } PS_FontInfoRec;
  88. /*************************************************************************/
  89. /* */
  90. /* <Struct> */
  91. /* PS_FontInfo */
  92. /* */
  93. /* <Description> */
  94. /* A handle to a @PS_FontInfoRec structure. */
  95. /* */
  96. typedef struct PS_FontInfoRec_* PS_FontInfo;
  97. /*************************************************************************/
  98. /* */
  99. /* <Struct> */
  100. /* T1_FontInfo */
  101. /* */
  102. /* <Description> */
  103. /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
  104. /* kept to maintain source compatibility between various versions of */
  105. /* FreeType. */
  106. /* */
  107. typedef PS_FontInfoRec T1_FontInfo;
  108. /*************************************************************************/
  109. /* */
  110. /* <Struct> */
  111. /* PS_PrivateRec */
  112. /* */
  113. /* <Description> */
  114. /* A structure used to model a Type~1 or Type~2 private dictionary. */
  115. /* Note that for Multiple Master fonts, each instance has its own */
  116. /* Private dictionary. */
  117. /* */
  118. typedef struct PS_PrivateRec_
  119. {
  120. FT_Int unique_id;
  121. FT_Int lenIV;
  122. FT_Byte num_blue_values;
  123. FT_Byte num_other_blues;
  124. FT_Byte num_family_blues;
  125. FT_Byte num_family_other_blues;
  126. FT_Short blue_values[14];
  127. FT_Short other_blues[10];
  128. FT_Short family_blues [14];
  129. FT_Short family_other_blues[10];
  130. FT_Fixed blue_scale;
  131. FT_Int blue_shift;
  132. FT_Int blue_fuzz;
  133. FT_UShort standard_width[1];
  134. FT_UShort standard_height[1];
  135. FT_Byte num_snap_widths;
  136. FT_Byte num_snap_heights;
  137. FT_Bool force_bold;
  138. FT_Bool round_stem_up;
  139. FT_Short snap_widths [13]; /* including std width */
  140. FT_Short snap_heights[13]; /* including std height */
  141. FT_Fixed expansion_factor;
  142. FT_Long language_group;
  143. FT_Long password;
  144. FT_Short min_feature[2];
  145. } PS_PrivateRec;
  146. /*************************************************************************/
  147. /* */
  148. /* <Struct> */
  149. /* PS_Private */
  150. /* */
  151. /* <Description> */
  152. /* A handle to a @PS_PrivateRec structure. */
  153. /* */
  154. typedef struct PS_PrivateRec_* PS_Private;
  155. /*************************************************************************/
  156. /* */
  157. /* <Struct> */
  158. /* T1_Private */
  159. /* */
  160. /* <Description> */
  161. /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
  162. /* kept to maintain source compatibility between various versions of */
  163. /* FreeType. */
  164. /* */
  165. typedef PS_PrivateRec T1_Private;
  166. /*************************************************************************/
  167. /* */
  168. /* <Enum> */
  169. /* T1_Blend_Flags */
  170. /* */
  171. /* <Description> */
  172. /* A set of flags used to indicate which fields are present in a */
  173. /* given blend dictionary (font info or private). Used to support */
  174. /* Multiple Masters fonts. */
  175. /* */
  176. /* <Values> */
  177. /* T1_BLEND_UNDERLINE_POSITION :: */
  178. /* T1_BLEND_UNDERLINE_THICKNESS :: */
  179. /* T1_BLEND_ITALIC_ANGLE :: */
  180. /* T1_BLEND_BLUE_VALUES :: */
  181. /* T1_BLEND_OTHER_BLUES :: */
  182. /* T1_BLEND_STANDARD_WIDTH :: */
  183. /* T1_BLEND_STANDARD_HEIGHT :: */
  184. /* T1_BLEND_STEM_SNAP_WIDTHS :: */
  185. /* T1_BLEND_STEM_SNAP_HEIGHTS :: */
  186. /* T1_BLEND_BLUE_SCALE :: */
  187. /* T1_BLEND_BLUE_SHIFT :: */
  188. /* T1_BLEND_FAMILY_BLUES :: */
  189. /* T1_BLEND_FAMILY_OTHER_BLUES :: */
  190. /* T1_BLEND_FORCE_BOLD :: */
  191. /* */
  192. typedef enum T1_Blend_Flags_
  193. {
  194. /* required fields in a FontInfo blend dictionary */
  195. T1_BLEND_UNDERLINE_POSITION = 0,
  196. T1_BLEND_UNDERLINE_THICKNESS,
  197. T1_BLEND_ITALIC_ANGLE,
  198. /* required fields in a Private blend dictionary */
  199. T1_BLEND_BLUE_VALUES,
  200. T1_BLEND_OTHER_BLUES,
  201. T1_BLEND_STANDARD_WIDTH,
  202. T1_BLEND_STANDARD_HEIGHT,
  203. T1_BLEND_STEM_SNAP_WIDTHS,
  204. T1_BLEND_STEM_SNAP_HEIGHTS,
  205. T1_BLEND_BLUE_SCALE,
  206. T1_BLEND_BLUE_SHIFT,
  207. T1_BLEND_FAMILY_BLUES,
  208. T1_BLEND_FAMILY_OTHER_BLUES,
  209. T1_BLEND_FORCE_BOLD,
  210. T1_BLEND_MAX /* do not remove */
  211. } T1_Blend_Flags;
  212. /* these constants are deprecated; use the corresponding */
  213. /* `T1_Blend_Flags' values instead */
  214. #define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
  215. #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
  216. #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
  217. #define t1_blend_blue_values T1_BLEND_BLUE_VALUES
  218. #define t1_blend_other_blues T1_BLEND_OTHER_BLUES
  219. #define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
  220. #define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
  221. #define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
  222. #define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
  223. #define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
  224. #define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
  225. #define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
  226. #define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
  227. #define t1_blend_force_bold T1_BLEND_FORCE_BOLD
  228. #define t1_blend_max T1_BLEND_MAX
  229. /* */
  230. /* maximum number of Multiple Masters designs, as defined in the spec */
  231. #define T1_MAX_MM_DESIGNS 16
  232. /* maximum number of Multiple Masters axes, as defined in the spec */
  233. #define T1_MAX_MM_AXIS 4
  234. /* maximum number of elements in a design map */
  235. #define T1_MAX_MM_MAP_POINTS 20
  236. /* this structure is used to store the BlendDesignMap entry for an axis */
  237. typedef struct PS_DesignMap_
  238. {
  239. FT_Byte num_points;
  240. FT_Long* design_points;
  241. FT_Fixed* blend_points;
  242. } PS_DesignMapRec, *PS_DesignMap;
  243. /* backwards-compatible definition */
  244. typedef PS_DesignMapRec T1_DesignMap;
  245. typedef struct PS_BlendRec_
  246. {
  247. FT_UInt num_designs;
  248. FT_UInt num_axis;
  249. FT_String* axis_names[T1_MAX_MM_AXIS];
  250. FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
  251. PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
  252. FT_Fixed* weight_vector;
  253. FT_Fixed* default_weight_vector;
  254. PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
  255. PS_Private privates [T1_MAX_MM_DESIGNS + 1];
  256. FT_ULong blend_bitflags;
  257. FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
  258. /* since 2.3.0 */
  259. /* undocumented, optional: the default design instance; */
  260. /* corresponds to default_weight_vector -- */
  261. /* num_default_design_vector == 0 means it is not present */
  262. /* in the font and associated metrics files */
  263. FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
  264. FT_UInt num_default_design_vector;
  265. } PS_BlendRec, *PS_Blend;
  266. /* backwards-compatible definition */
  267. typedef PS_BlendRec T1_Blend;
  268. /*************************************************************************/
  269. /* */
  270. /* <Struct> */
  271. /* CID_FaceDictRec */
  272. /* */
  273. /* <Description> */
  274. /* A structure used to represent data in a CID top-level dictionary. */
  275. /* */
  276. typedef struct CID_FaceDictRec_
  277. {
  278. PS_PrivateRec private_dict;
  279. FT_UInt len_buildchar;
  280. FT_Fixed forcebold_threshold;
  281. FT_Pos stroke_width;
  282. FT_Fixed expansion_factor;
  283. FT_Byte paint_type;
  284. FT_Byte font_type;
  285. FT_Matrix font_matrix;
  286. FT_Vector font_offset;
  287. FT_UInt num_subrs;
  288. FT_ULong subrmap_offset;
  289. FT_Int sd_bytes;
  290. } CID_FaceDictRec;
  291. /*************************************************************************/
  292. /* */
  293. /* <Struct> */
  294. /* CID_FaceDict */
  295. /* */
  296. /* <Description> */
  297. /* A handle to a @CID_FaceDictRec structure. */
  298. /* */
  299. typedef struct CID_FaceDictRec_* CID_FaceDict;
  300. /*************************************************************************/
  301. /* */
  302. /* <Struct> */
  303. /* CID_FontDict */
  304. /* */
  305. /* <Description> */
  306. /* This type is equivalent to @CID_FaceDictRec. It is deprecated but */
  307. /* kept to maintain source compatibility between various versions of */
  308. /* FreeType. */
  309. /* */
  310. typedef CID_FaceDictRec CID_FontDict;
  311. /*************************************************************************/
  312. /* */
  313. /* <Struct> */
  314. /* CID_FaceInfoRec */
  315. /* */
  316. /* <Description> */
  317. /* A structure used to represent CID Face information. */
  318. /* */
  319. typedef struct CID_FaceInfoRec_
  320. {
  321. FT_String* cid_font_name;
  322. FT_Fixed cid_version;
  323. FT_Int cid_font_type;
  324. FT_String* registry;
  325. FT_String* ordering;
  326. FT_Int supplement;
  327. PS_FontInfoRec font_info;
  328. FT_BBox font_bbox;
  329. FT_ULong uid_base;
  330. FT_Int num_xuid;
  331. FT_ULong xuid[16];
  332. FT_ULong cidmap_offset;
  333. FT_Int fd_bytes;
  334. FT_Int gd_bytes;
  335. FT_ULong cid_count;
  336. FT_Int num_dicts;
  337. CID_FaceDict font_dicts;
  338. FT_ULong data_offset;
  339. } CID_FaceInfoRec;
  340. /*************************************************************************/
  341. /* */
  342. /* <Struct> */
  343. /* CID_FaceInfo */
  344. /* */
  345. /* <Description> */
  346. /* A handle to a @CID_FaceInfoRec structure. */
  347. /* */
  348. typedef struct CID_FaceInfoRec_* CID_FaceInfo;
  349. /*************************************************************************/
  350. /* */
  351. /* <Struct> */
  352. /* CID_Info */
  353. /* */
  354. /* <Description> */
  355. /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
  356. /* kept to maintain source compatibility between various versions of */
  357. /* FreeType. */
  358. /* */
  359. typedef CID_FaceInfoRec CID_Info;
  360. /************************************************************************
  361. *
  362. * @function:
  363. * FT_Has_PS_Glyph_Names
  364. *
  365. * @description:
  366. * Return true if a given face provides reliable PostScript glyph
  367. * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
  368. * except that certain fonts (mostly TrueType) contain incorrect
  369. * glyph name tables.
  370. *
  371. * When this function returns true, the caller is sure that the glyph
  372. * names returned by @FT_Get_Glyph_Name are reliable.
  373. *
  374. * @input:
  375. * face ::
  376. * face handle
  377. *
  378. * @return:
  379. * Boolean. True if glyph names are reliable.
  380. *
  381. */
  382. FT_EXPORT( FT_Int )
  383. FT_Has_PS_Glyph_Names( FT_Face face );
  384. /************************************************************************
  385. *
  386. * @function:
  387. * FT_Get_PS_Font_Info
  388. *
  389. * @description:
  390. * Retrieve the @PS_FontInfoRec structure corresponding to a given
  391. * PostScript font.
  392. *
  393. * @input:
  394. * face ::
  395. * PostScript face handle.
  396. *
  397. * @output:
  398. * afont_info ::
  399. * Output font info structure pointer.
  400. *
  401. * @return:
  402. * FreeType error code. 0~means success.
  403. *
  404. * @note:
  405. * The string pointers within the font info structure are owned by
  406. * the face and don't need to be freed by the caller.
  407. *
  408. * If the font's format is not PostScript-based, this function will
  409. * return the `FT_Err_Invalid_Argument' error code.
  410. *
  411. */
  412. FT_EXPORT( FT_Error )
  413. FT_Get_PS_Font_Info( FT_Face face,
  414. PS_FontInfo afont_info );
  415. /************************************************************************
  416. *
  417. * @function:
  418. * FT_Get_PS_Font_Private
  419. *
  420. * @description:
  421. * Retrieve the @PS_PrivateRec structure corresponding to a given
  422. * PostScript font.
  423. *
  424. * @input:
  425. * face ::
  426. * PostScript face handle.
  427. *
  428. * @output:
  429. * afont_private ::
  430. * Output private dictionary structure pointer.
  431. *
  432. * @return:
  433. * FreeType error code. 0~means success.
  434. *
  435. * @note:
  436. * The string pointers within the @PS_PrivateRec structure are owned by
  437. * the face and don't need to be freed by the caller.
  438. *
  439. * If the font's format is not PostScript-based, this function returns
  440. * the `FT_Err_Invalid_Argument' error code.
  441. *
  442. */
  443. FT_EXPORT( FT_Error )
  444. FT_Get_PS_Font_Private( FT_Face face,
  445. PS_Private afont_private );
  446. /*************************************************************************/
  447. /* */
  448. /* <Enum> */
  449. /* T1_EncodingType */
  450. /* */
  451. /* <Description> */
  452. /* An enumeration describing the `Encoding' entry in a Type 1 */
  453. /* dictionary. */
  454. /* */
  455. /* <Values> */
  456. /* T1_ENCODING_TYPE_NONE :: */
  457. /* T1_ENCODING_TYPE_ARRAY :: */
  458. /* T1_ENCODING_TYPE_STANDARD :: */
  459. /* T1_ENCODING_TYPE_ISOLATIN1 :: */
  460. /* T1_ENCODING_TYPE_EXPERT :: */
  461. /* */
  462. typedef enum T1_EncodingType_
  463. {
  464. T1_ENCODING_TYPE_NONE = 0,
  465. T1_ENCODING_TYPE_ARRAY,
  466. T1_ENCODING_TYPE_STANDARD,
  467. T1_ENCODING_TYPE_ISOLATIN1,
  468. T1_ENCODING_TYPE_EXPERT
  469. } T1_EncodingType;
  470. /*************************************************************************/
  471. /* */
  472. /* <Enum> */
  473. /* PS_Dict_Keys */
  474. /* */
  475. /* <Description> */
  476. /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
  477. /* the Type~1 dictionary entry to retrieve. */
  478. /* */
  479. /* <Values> */
  480. /* PS_DICT_FONT_TYPE :: */
  481. /* PS_DICT_FONT_MATRIX :: */
  482. /* PS_DICT_FONT_BBOX :: */
  483. /* PS_DICT_PAINT_TYPE :: */
  484. /* PS_DICT_FONT_NAME :: */
  485. /* PS_DICT_UNIQUE_ID :: */
  486. /* PS_DICT_NUM_CHAR_STRINGS :: */
  487. /* PS_DICT_CHAR_STRING_KEY :: */
  488. /* PS_DICT_CHAR_STRING :: */
  489. /* PS_DICT_ENCODING_TYPE :: */
  490. /* PS_DICT_ENCODING_ENTRY :: */
  491. /* PS_DICT_NUM_SUBRS :: */
  492. /* PS_DICT_SUBR :: */
  493. /* PS_DICT_STD_HW :: */
  494. /* PS_DICT_STD_VW :: */
  495. /* PS_DICT_NUM_BLUE_VALUES :: */
  496. /* PS_DICT_BLUE_VALUE :: */
  497. /* PS_DICT_BLUE_FUZZ :: */
  498. /* PS_DICT_NUM_OTHER_BLUES :: */
  499. /* PS_DICT_OTHER_BLUE :: */
  500. /* PS_DICT_NUM_FAMILY_BLUES :: */
  501. /* PS_DICT_FAMILY_BLUE :: */
  502. /* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */
  503. /* PS_DICT_FAMILY_OTHER_BLUE :: */
  504. /* PS_DICT_BLUE_SCALE :: */
  505. /* PS_DICT_BLUE_SHIFT :: */
  506. /* PS_DICT_NUM_STEM_SNAP_H :: */
  507. /* PS_DICT_STEM_SNAP_H :: */
  508. /* PS_DICT_NUM_STEM_SNAP_V :: */
  509. /* PS_DICT_STEM_SNAP_V :: */
  510. /* PS_DICT_FORCE_BOLD :: */
  511. /* PS_DICT_RND_STEM_UP :: */
  512. /* PS_DICT_MIN_FEATURE :: */
  513. /* PS_DICT_LEN_IV :: */
  514. /* PS_DICT_PASSWORD :: */
  515. /* PS_DICT_LANGUAGE_GROUP :: */
  516. /* PS_DICT_VERSION :: */
  517. /* PS_DICT_NOTICE :: */
  518. /* PS_DICT_FULL_NAME :: */
  519. /* PS_DICT_FAMILY_NAME :: */
  520. /* PS_DICT_WEIGHT :: */
  521. /* PS_DICT_IS_FIXED_PITCH :: */
  522. /* PS_DICT_UNDERLINE_POSITION :: */
  523. /* PS_DICT_UNDERLINE_THICKNESS :: */
  524. /* PS_DICT_FS_TYPE :: */
  525. /* PS_DICT_ITALIC_ANGLE :: */
  526. /* */
  527. typedef enum PS_Dict_Keys_
  528. {
  529. /* conventionally in the font dictionary */
  530. PS_DICT_FONT_TYPE, /* FT_Byte */
  531. PS_DICT_FONT_MATRIX, /* FT_Fixed */
  532. PS_DICT_FONT_BBOX, /* FT_Fixed */
  533. PS_DICT_PAINT_TYPE, /* FT_Byte */
  534. PS_DICT_FONT_NAME, /* FT_String* */
  535. PS_DICT_UNIQUE_ID, /* FT_Int */
  536. PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */
  537. PS_DICT_CHAR_STRING_KEY, /* FT_String* */
  538. PS_DICT_CHAR_STRING, /* FT_String* */
  539. PS_DICT_ENCODING_TYPE, /* T1_EncodingType */
  540. PS_DICT_ENCODING_ENTRY, /* FT_String* */
  541. /* conventionally in the font Private dictionary */
  542. PS_DICT_NUM_SUBRS, /* FT_Int */
  543. PS_DICT_SUBR, /* FT_String* */
  544. PS_DICT_STD_HW, /* FT_UShort */
  545. PS_DICT_STD_VW, /* FT_UShort */
  546. PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */
  547. PS_DICT_BLUE_VALUE, /* FT_Short */
  548. PS_DICT_BLUE_FUZZ, /* FT_Int */
  549. PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */
  550. PS_DICT_OTHER_BLUE, /* FT_Short */
  551. PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */
  552. PS_DICT_FAMILY_BLUE, /* FT_Short */
  553. PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */
  554. PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */
  555. PS_DICT_BLUE_SCALE, /* FT_Fixed */
  556. PS_DICT_BLUE_SHIFT, /* FT_Int */
  557. PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */
  558. PS_DICT_STEM_SNAP_H, /* FT_Short */
  559. PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */
  560. PS_DICT_STEM_SNAP_V, /* FT_Short */
  561. PS_DICT_FORCE_BOLD, /* FT_Bool */
  562. PS_DICT_RND_STEM_UP, /* FT_Bool */
  563. PS_DICT_MIN_FEATURE, /* FT_Short */
  564. PS_DICT_LEN_IV, /* FT_Int */
  565. PS_DICT_PASSWORD, /* FT_Long */
  566. PS_DICT_LANGUAGE_GROUP, /* FT_Long */
  567. /* conventionally in the font FontInfo dictionary */
  568. PS_DICT_VERSION, /* FT_String* */
  569. PS_DICT_NOTICE, /* FT_String* */
  570. PS_DICT_FULL_NAME, /* FT_String* */
  571. PS_DICT_FAMILY_NAME, /* FT_String* */
  572. PS_DICT_WEIGHT, /* FT_String* */
  573. PS_DICT_IS_FIXED_PITCH, /* FT_Bool */
  574. PS_DICT_UNDERLINE_POSITION, /* FT_Short */
  575. PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */
  576. PS_DICT_FS_TYPE, /* FT_UShort */
  577. PS_DICT_ITALIC_ANGLE, /* FT_Long */
  578. PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
  579. } PS_Dict_Keys;
  580. /************************************************************************
  581. *
  582. * @function:
  583. * FT_Get_PS_Font_Value
  584. *
  585. * @description:
  586. * Retrieve the value for the supplied key from a PostScript font.
  587. *
  588. * @input:
  589. * face ::
  590. * PostScript face handle.
  591. *
  592. * key ::
  593. * An enumeration value representing the dictionary key to retrieve.
  594. *
  595. * idx ::
  596. * For array values, this specifies the index to be returned.
  597. *
  598. * value ::
  599. * A pointer to memory into which to write the value.
  600. *
  601. * valen_len ::
  602. * The size, in bytes, of the memory supplied for the value.
  603. *
  604. * @output:
  605. * value ::
  606. * The value matching the above key, if it exists.
  607. *
  608. * @return:
  609. * The amount of memory (in bytes) required to hold the requested
  610. * value (if it exists, -1 otherwise).
  611. *
  612. * @note:
  613. * The values returned are not pointers into the internal structures of
  614. * the face, but are `fresh' copies, so that the memory containing them
  615. * belongs to the calling application. This also enforces the
  616. * `read-only' nature of these values, i.e., this function cannot be
  617. * used to manipulate the face.
  618. *
  619. * `value' is a void pointer because the values returned can be of
  620. * various types.
  621. *
  622. * If either `value' is NULL or `value_len' is too small, just the
  623. * required memory size for the requested entry is returned.
  624. *
  625. * The `idx' parameter is used, not only to retrieve elements of, for
  626. * example, the FontMatrix or FontBBox, but also to retrieve name keys
  627. * from the CharStrings dictionary, and the charstrings themselves. It
  628. * is ignored for atomic values.
  629. *
  630. * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To
  631. * get the value as in the font stream, you need to divide by
  632. * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
  633. *
  634. * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
  635. * be retrieved. So, for example, PostScript procedures such as NP,
  636. * ND, and RD are not available. Arbitrary keys are, obviously, not be
  637. * available either.
  638. *
  639. * If the font's format is not PostScript-based, this function returns
  640. * the `FT_Err_Invalid_Argument' error code.
  641. *
  642. */
  643. FT_EXPORT( FT_Long )
  644. FT_Get_PS_Font_Value( FT_Face face,
  645. PS_Dict_Keys key,
  646. FT_UInt idx,
  647. void *value,
  648. FT_Long value_len );
  649. /* */
  650. FT_END_HEADER
  651. #endif /* __T1TABLES_H__ */
  652. /* END */