t1tables.h 23 KB

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