/src/freetype/include/freetype/freetype.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 3945 lines · 481 code · 296 blank · 3168 comment · 0 complexity · 1144f01f2dfaa56d1237f8b041059b89 MD5 · raw file

Large files are truncated click here to view the full file

  1. /***************************************************************************/
  2. /* */
  3. /* freetype.h */
  4. /* */
  5. /* FreeType high-level API and common types (specification only). */
  6. /* */
  7. /* Copyright 1996-2012 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 FT_FREETYPE_H
  18. #error "`ft2build.h' hasn't been included yet!"
  19. #error "Please always use macros to include FreeType header files."
  20. #error "Example:"
  21. #error " #include <ft2build.h>"
  22. #error " #include FT_FREETYPE_H"
  23. #endif
  24. #ifndef __FREETYPE_H__
  25. #define __FREETYPE_H__
  26. #include <ft2build.h>
  27. #include FT_CONFIG_CONFIG_H
  28. #include FT_ERRORS_H
  29. #include FT_TYPES_H
  30. FT_BEGIN_HEADER
  31. /*************************************************************************/
  32. /* */
  33. /* <Section> */
  34. /* user_allocation */
  35. /* */
  36. /* <Title> */
  37. /* User allocation */
  38. /* */
  39. /* <Abstract> */
  40. /* How client applications should allocate FreeType data structures. */
  41. /* */
  42. /* <Description> */
  43. /* FreeType assumes that structures allocated by the user and passed */
  44. /* as arguments are zeroed out except for the actual data. In other */
  45. /* words, it is recommended to use `calloc' (or variants of it) */
  46. /* instead of `malloc' for allocation. */
  47. /* */
  48. /*************************************************************************/
  49. /*************************************************************************/
  50. /*************************************************************************/
  51. /* */
  52. /* B A S I C T Y P E S */
  53. /* */
  54. /*************************************************************************/
  55. /*************************************************************************/
  56. /*************************************************************************/
  57. /* */
  58. /* <Section> */
  59. /* base_interface */
  60. /* */
  61. /* <Title> */
  62. /* Base Interface */
  63. /* */
  64. /* <Abstract> */
  65. /* The FreeType~2 base font interface. */
  66. /* */
  67. /* <Description> */
  68. /* This section describes the public high-level API of FreeType~2. */
  69. /* */
  70. /* <Order> */
  71. /* FT_Library */
  72. /* FT_Face */
  73. /* FT_Size */
  74. /* FT_GlyphSlot */
  75. /* FT_CharMap */
  76. /* FT_Encoding */
  77. /* */
  78. /* FT_FaceRec */
  79. /* */
  80. /* FT_FACE_FLAG_SCALABLE */
  81. /* FT_FACE_FLAG_FIXED_SIZES */
  82. /* FT_FACE_FLAG_FIXED_WIDTH */
  83. /* FT_FACE_FLAG_HORIZONTAL */
  84. /* FT_FACE_FLAG_VERTICAL */
  85. /* FT_FACE_FLAG_SFNT */
  86. /* FT_FACE_FLAG_KERNING */
  87. /* FT_FACE_FLAG_MULTIPLE_MASTERS */
  88. /* FT_FACE_FLAG_GLYPH_NAMES */
  89. /* FT_FACE_FLAG_EXTERNAL_STREAM */
  90. /* FT_FACE_FLAG_FAST_GLYPHS */
  91. /* FT_FACE_FLAG_HINTER */
  92. /* */
  93. /* FT_STYLE_FLAG_BOLD */
  94. /* FT_STYLE_FLAG_ITALIC */
  95. /* */
  96. /* FT_SizeRec */
  97. /* FT_Size_Metrics */
  98. /* */
  99. /* FT_GlyphSlotRec */
  100. /* FT_Glyph_Metrics */
  101. /* FT_SubGlyph */
  102. /* */
  103. /* FT_Bitmap_Size */
  104. /* */
  105. /* FT_Init_FreeType */
  106. /* FT_Done_FreeType */
  107. /* */
  108. /* FT_New_Face */
  109. /* FT_Done_Face */
  110. /* FT_New_Memory_Face */
  111. /* FT_Open_Face */
  112. /* FT_Open_Args */
  113. /* FT_Parameter */
  114. /* FT_Attach_File */
  115. /* FT_Attach_Stream */
  116. /* */
  117. /* FT_Set_Char_Size */
  118. /* FT_Set_Pixel_Sizes */
  119. /* FT_Request_Size */
  120. /* FT_Select_Size */
  121. /* FT_Size_Request_Type */
  122. /* FT_Size_Request */
  123. /* FT_Set_Transform */
  124. /* FT_Load_Glyph */
  125. /* FT_Get_Char_Index */
  126. /* FT_Get_Name_Index */
  127. /* FT_Load_Char */
  128. /* */
  129. /* FT_OPEN_MEMORY */
  130. /* FT_OPEN_STREAM */
  131. /* FT_OPEN_PATHNAME */
  132. /* FT_OPEN_DRIVER */
  133. /* FT_OPEN_PARAMS */
  134. /* */
  135. /* FT_LOAD_DEFAULT */
  136. /* FT_LOAD_RENDER */
  137. /* FT_LOAD_MONOCHROME */
  138. /* FT_LOAD_LINEAR_DESIGN */
  139. /* FT_LOAD_NO_SCALE */
  140. /* FT_LOAD_NO_HINTING */
  141. /* FT_LOAD_NO_BITMAP */
  142. /* FT_LOAD_CROP_BITMAP */
  143. /* */
  144. /* FT_LOAD_VERTICAL_LAYOUT */
  145. /* FT_LOAD_IGNORE_TRANSFORM */
  146. /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
  147. /* FT_LOAD_FORCE_AUTOHINT */
  148. /* FT_LOAD_NO_RECURSE */
  149. /* FT_LOAD_PEDANTIC */
  150. /* */
  151. /* FT_LOAD_TARGET_NORMAL */
  152. /* FT_LOAD_TARGET_LIGHT */
  153. /* FT_LOAD_TARGET_MONO */
  154. /* FT_LOAD_TARGET_LCD */
  155. /* FT_LOAD_TARGET_LCD_V */
  156. /* */
  157. /* FT_Render_Glyph */
  158. /* FT_Render_Mode */
  159. /* FT_Get_Kerning */
  160. /* FT_Kerning_Mode */
  161. /* FT_Get_Track_Kerning */
  162. /* FT_Get_Glyph_Name */
  163. /* FT_Get_Postscript_Name */
  164. /* */
  165. /* FT_CharMapRec */
  166. /* FT_Select_Charmap */
  167. /* FT_Set_Charmap */
  168. /* FT_Get_Charmap_Index */
  169. /* */
  170. /* FT_FSTYPE_INSTALLABLE_EMBEDDING */
  171. /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
  172. /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
  173. /* FT_FSTYPE_EDITABLE_EMBEDDING */
  174. /* FT_FSTYPE_NO_SUBSETTING */
  175. /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
  176. /* */
  177. /* FT_Get_FSType_Flags */
  178. /* */
  179. /*************************************************************************/
  180. /*************************************************************************/
  181. /* */
  182. /* <Struct> */
  183. /* FT_Glyph_Metrics */
  184. /* */
  185. /* <Description> */
  186. /* A structure used to model the metrics of a single glyph. The */
  187. /* values are expressed in 26.6 fractional pixel format; if the flag */
  188. /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
  189. /* are expressed in font units instead. */
  190. /* */
  191. /* <Fields> */
  192. /* width :: */
  193. /* The glyph's width. */
  194. /* */
  195. /* height :: */
  196. /* The glyph's height. */
  197. /* */
  198. /* horiBearingX :: */
  199. /* Left side bearing for horizontal layout. */
  200. /* */
  201. /* horiBearingY :: */
  202. /* Top side bearing for horizontal layout. */
  203. /* */
  204. /* horiAdvance :: */
  205. /* Advance width for horizontal layout. */
  206. /* */
  207. /* vertBearingX :: */
  208. /* Left side bearing for vertical layout. */
  209. /* */
  210. /* vertBearingY :: */
  211. /* Top side bearing for vertical layout. Larger positive values */
  212. /* mean further below the vertical glyph origin. */
  213. /* */
  214. /* vertAdvance :: */
  215. /* Advance height for vertical layout. Positive values mean the */
  216. /* glyph has a positive advance downward. */
  217. /* */
  218. /* <Note> */
  219. /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
  220. /* dimensions of the hinted glyph (in case hinting is applicable). */
  221. /* */
  222. typedef struct FT_Glyph_Metrics_
  223. {
  224. FT_Pos width;
  225. FT_Pos height;
  226. FT_Pos horiBearingX;
  227. FT_Pos horiBearingY;
  228. FT_Pos horiAdvance;
  229. FT_Pos vertBearingX;
  230. FT_Pos vertBearingY;
  231. FT_Pos vertAdvance;
  232. } FT_Glyph_Metrics;
  233. /*************************************************************************/
  234. /* */
  235. /* <Struct> */
  236. /* FT_Bitmap_Size */
  237. /* */
  238. /* <Description> */
  239. /* This structure models the metrics of a bitmap strike (i.e., a set */
  240. /* of glyphs for a given point size and resolution) in a bitmap font. */
  241. /* It is used for the `available_sizes' field of @FT_Face. */
  242. /* */
  243. /* <Fields> */
  244. /* height :: The vertical distance, in pixels, between two */
  245. /* consecutive baselines. It is always positive. */
  246. /* */
  247. /* width :: The average width, in pixels, of all glyphs in the */
  248. /* strike. */
  249. /* */
  250. /* size :: The nominal size of the strike in 26.6 fractional */
  251. /* points. This field is not very useful. */
  252. /* */
  253. /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
  254. /* pixels. */
  255. /* */
  256. /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
  257. /* pixels. */
  258. /* */
  259. /* <Note> */
  260. /* Windows FNT: */
  261. /* The nominal size given in a FNT font is not reliable. Thus when */
  262. /* the driver finds it incorrect, it sets `size' to some calculated */
  263. /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
  264. /* height given in the font, respectively. */
  265. /* */
  266. /* TrueType embedded bitmaps: */
  267. /* `size', `width', and `height' values are not contained in the */
  268. /* bitmap strike itself. They are computed from the global font */
  269. /* parameters. */
  270. /* */
  271. typedef struct FT_Bitmap_Size_
  272. {
  273. FT_Short height;
  274. FT_Short width;
  275. FT_Pos size;
  276. FT_Pos x_ppem;
  277. FT_Pos y_ppem;
  278. } FT_Bitmap_Size;
  279. /*************************************************************************/
  280. /*************************************************************************/
  281. /* */
  282. /* O B J E C T C L A S S E S */
  283. /* */
  284. /*************************************************************************/
  285. /*************************************************************************/
  286. /*************************************************************************/
  287. /* */
  288. /* <Type> */
  289. /* FT_Library */
  290. /* */
  291. /* <Description> */
  292. /* A handle to a FreeType library instance. Each `library' is */
  293. /* completely independent from the others; it is the `root' of a set */
  294. /* of objects like fonts, faces, sizes, etc. */
  295. /* */
  296. /* It also embeds a memory manager (see @FT_Memory), as well as a */
  297. /* scan-line converter object (see @FT_Raster). */
  298. /* */
  299. /* For multi-threading applications each thread should have its own */
  300. /* FT_Library object. */
  301. /* */
  302. /* <Note> */
  303. /* Library objects are normally created by @FT_Init_FreeType, and */
  304. /* destroyed with @FT_Done_FreeType. */
  305. /* */
  306. typedef struct FT_LibraryRec_ *FT_Library;
  307. /*************************************************************************/
  308. /* */
  309. /* <Type> */
  310. /* FT_Module */
  311. /* */
  312. /* <Description> */
  313. /* A handle to a given FreeType module object. Each module can be a */
  314. /* font driver, a renderer, or anything else that provides services */
  315. /* to the formers. */
  316. /* */
  317. typedef struct FT_ModuleRec_* FT_Module;
  318. /*************************************************************************/
  319. /* */
  320. /* <Type> */
  321. /* FT_Driver */
  322. /* */
  323. /* <Description> */
  324. /* A handle to a given FreeType font driver object. Each font driver */
  325. /* is a special module capable of creating faces from font files. */
  326. /* */
  327. typedef struct FT_DriverRec_* FT_Driver;
  328. /*************************************************************************/
  329. /* */
  330. /* <Type> */
  331. /* FT_Renderer */
  332. /* */
  333. /* <Description> */
  334. /* A handle to a given FreeType renderer. A renderer is a special */
  335. /* module in charge of converting a glyph image to a bitmap, when */
  336. /* necessary. Each renderer supports a given glyph image format, and */
  337. /* one or more target surface depths. */
  338. /* */
  339. typedef struct FT_RendererRec_* FT_Renderer;
  340. /*************************************************************************/
  341. /* */
  342. /* <Type> */
  343. /* FT_Face */
  344. /* */
  345. /* <Description> */
  346. /* A handle to a given typographic face object. A face object models */
  347. /* a given typeface, in a given style. */
  348. /* */
  349. /* <Note> */
  350. /* Each face object also owns a single @FT_GlyphSlot object, as well */
  351. /* as one or more @FT_Size objects. */
  352. /* */
  353. /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
  354. /* a given filepathname or a custom input stream. */
  355. /* */
  356. /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
  357. /* */
  358. /* <Also> */
  359. /* See @FT_FaceRec for the publicly accessible fields of a given face */
  360. /* object. */
  361. /* */
  362. typedef struct FT_FaceRec_* FT_Face;
  363. /*************************************************************************/
  364. /* */
  365. /* <Type> */
  366. /* FT_Size */
  367. /* */
  368. /* <Description> */
  369. /* A handle to an object used to model a face scaled to a given */
  370. /* character size. */
  371. /* */
  372. /* <Note> */
  373. /* Each @FT_Face has an _active_ @FT_Size object that is used by */
  374. /* functions like @FT_Load_Glyph to determine the scaling */
  375. /* transformation which is used to load and hint glyphs and metrics. */
  376. /* */
  377. /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
  378. /* @FT_Request_Size or even @FT_Select_Size to change the content */
  379. /* (i.e., the scaling values) of the active @FT_Size. */
  380. /* */
  381. /* You can use @FT_New_Size to create additional size objects for a */
  382. /* given @FT_Face, but they won't be used by other functions until */
  383. /* you activate it through @FT_Activate_Size. Only one size can be */
  384. /* activated at any given time per face. */
  385. /* */
  386. /* <Also> */
  387. /* See @FT_SizeRec for the publicly accessible fields of a given size */
  388. /* object. */
  389. /* */
  390. typedef struct FT_SizeRec_* FT_Size;
  391. /*************************************************************************/
  392. /* */
  393. /* <Type> */
  394. /* FT_GlyphSlot */
  395. /* */
  396. /* <Description> */
  397. /* A handle to a given `glyph slot'. A slot is a container where it */
  398. /* is possible to load any of the glyphs contained in its parent */
  399. /* face. */
  400. /* */
  401. /* In other words, each time you call @FT_Load_Glyph or */
  402. /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
  403. /* i.e., the glyph's metrics, its image (bitmap or outline), and */
  404. /* other control information. */
  405. /* */
  406. /* <Also> */
  407. /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
  408. /* */
  409. typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
  410. /*************************************************************************/
  411. /* */
  412. /* <Type> */
  413. /* FT_CharMap */
  414. /* */
  415. /* <Description> */
  416. /* A handle to a given character map. A charmap is used to translate */
  417. /* character codes in a given encoding into glyph indexes for its */
  418. /* parent's face. Some font formats may provide several charmaps per */
  419. /* font. */
  420. /* */
  421. /* Each face object owns zero or more charmaps, but only one of them */
  422. /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
  423. /* */
  424. /* The list of available charmaps in a face is available through the */
  425. /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
  426. /* */
  427. /* The currently active charmap is available as `face->charmap'. */
  428. /* You should call @FT_Set_Charmap to change it. */
  429. /* */
  430. /* <Note> */
  431. /* When a new face is created (either through @FT_New_Face or */
  432. /* @FT_Open_Face), the library looks for a Unicode charmap within */
  433. /* the list and automatically activates it. */
  434. /* */
  435. /* <Also> */
  436. /* See @FT_CharMapRec for the publicly accessible fields of a given */
  437. /* character map. */
  438. /* */
  439. typedef struct FT_CharMapRec_* FT_CharMap;
  440. /*************************************************************************/
  441. /* */
  442. /* <Macro> */
  443. /* FT_ENC_TAG */
  444. /* */
  445. /* <Description> */
  446. /* This macro converts four-letter tags into an unsigned long. It is */
  447. /* used to define `encoding' identifiers (see @FT_Encoding). */
  448. /* */
  449. /* <Note> */
  450. /* Since many 16-bit compilers don't like 32-bit enumerations, you */
  451. /* should redefine this macro in case of problems to something like */
  452. /* this: */
  453. /* */
  454. /* { */
  455. /* #define FT_ENC_TAG( value, a, b, c, d ) value */
  456. /* } */
  457. /* */
  458. /* to get a simple enumeration without assigning special numbers. */
  459. /* */
  460. #ifndef FT_ENC_TAG
  461. #define FT_ENC_TAG( value, a, b, c, d ) \
  462. value = ( ( (FT_UInt32)(a) << 24 ) | \
  463. ( (FT_UInt32)(b) << 16 ) | \
  464. ( (FT_UInt32)(c) << 8 ) | \
  465. (FT_UInt32)(d) )
  466. #endif /* FT_ENC_TAG */
  467. /*************************************************************************/
  468. /* */
  469. /* <Enum> */
  470. /* FT_Encoding */
  471. /* */
  472. /* <Description> */
  473. /* An enumeration used to specify character sets supported by */
  474. /* charmaps. Used in the @FT_Select_Charmap API function. */
  475. /* */
  476. /* <Note> */
  477. /* Despite the name, this enumeration lists specific character */
  478. /* repertories (i.e., charsets), and not text encoding methods (e.g., */
  479. /* UTF-8, UTF-16, etc.). */
  480. /* */
  481. /* Other encodings might be defined in the future. */
  482. /* */
  483. /* <Values> */
  484. /* FT_ENCODING_NONE :: */
  485. /* The encoding value~0 is reserved. */
  486. /* */
  487. /* FT_ENCODING_UNICODE :: */
  488. /* Corresponds to the Unicode character set. This value covers */
  489. /* all versions of the Unicode repertoire, including ASCII and */
  490. /* Latin-1. Most fonts include a Unicode charmap, but not all */
  491. /* of them. */
  492. /* */
  493. /* For example, if you want to access Unicode value U+1F028 (and */
  494. /* the font contains it), use value 0x1F028 as the input value for */
  495. /* @FT_Get_Char_Index. */
  496. /* */
  497. /* FT_ENCODING_MS_SYMBOL :: */
  498. /* Corresponds to the Microsoft Symbol encoding, used to encode */
  499. /* mathematical symbols in the 32..255 character code range. For */
  500. /* more information, see `http://www.ceviz.net/symbol.htm'. */
  501. /* */
  502. /* FT_ENCODING_SJIS :: */
  503. /* Corresponds to Japanese SJIS encoding. More info at */
  504. /* at `http://langsupport.japanreference.com/encoding.shtml'. */
  505. /* See note on multi-byte encodings below. */
  506. /* */
  507. /* FT_ENCODING_GB2312 :: */
  508. /* Corresponds to an encoding system for Simplified Chinese as used */
  509. /* used in mainland China. */
  510. /* */
  511. /* FT_ENCODING_BIG5 :: */
  512. /* Corresponds to an encoding system for Traditional Chinese as */
  513. /* used in Taiwan and Hong Kong. */
  514. /* */
  515. /* FT_ENCODING_WANSUNG :: */
  516. /* Corresponds to the Korean encoding system known as Wansung. */
  517. /* For more information see */
  518. /* `http://www.microsoft.com/typography/unicode/949.txt'. */
  519. /* */
  520. /* FT_ENCODING_JOHAB :: */
  521. /* The Korean standard character set (KS~C 5601-1992), which */
  522. /* corresponds to MS Windows code page 1361. This character set */
  523. /* includes all possible Hangeul character combinations. */
  524. /* */
  525. /* FT_ENCODING_ADOBE_LATIN_1 :: */
  526. /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
  527. /* PostScript font. It is limited to 256 character codes. */
  528. /* */
  529. /* FT_ENCODING_ADOBE_STANDARD :: */
  530. /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
  531. /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
  532. /* codes. */
  533. /* */
  534. /* FT_ENCODING_ADOBE_EXPERT :: */
  535. /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
  536. /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
  537. /* codes. */
  538. /* */
  539. /* FT_ENCODING_ADOBE_CUSTOM :: */
  540. /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
  541. /* OpenType/CFF fonts. It is limited to 256 character codes. */
  542. /* */
  543. /* FT_ENCODING_APPLE_ROMAN :: */
  544. /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
  545. /* and OpenType fonts contain a charmap for this encoding, since */
  546. /* older versions of Mac OS are able to use it. */
  547. /* */
  548. /* FT_ENCODING_OLD_LATIN_2 :: */
  549. /* This value is deprecated and was never used nor reported by */
  550. /* FreeType. Don't use or test for it. */
  551. /* */
  552. /* FT_ENCODING_MS_SJIS :: */
  553. /* Same as FT_ENCODING_SJIS. Deprecated. */
  554. /* */
  555. /* FT_ENCODING_MS_GB2312 :: */
  556. /* Same as FT_ENCODING_GB2312. Deprecated. */
  557. /* */
  558. /* FT_ENCODING_MS_BIG5 :: */
  559. /* Same as FT_ENCODING_BIG5. Deprecated. */
  560. /* */
  561. /* FT_ENCODING_MS_WANSUNG :: */
  562. /* Same as FT_ENCODING_WANSUNG. Deprecated. */
  563. /* */
  564. /* FT_ENCODING_MS_JOHAB :: */
  565. /* Same as FT_ENCODING_JOHAB. Deprecated. */
  566. /* */
  567. /* <Note> */
  568. /* By default, FreeType automatically synthesizes a Unicode charmap */
  569. /* for PostScript fonts, using their glyph names dictionaries. */
  570. /* However, it also reports the encodings defined explicitly in the */
  571. /* font file, for the cases when they are needed, with the Adobe */
  572. /* values as well. */
  573. /* */
  574. /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
  575. /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
  576. /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
  577. /* which encoding is really present. If, for example, the */
  578. /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
  579. /* the font is encoded in KOI8-R. */
  580. /* */
  581. /* FT_ENCODING_NONE is always set (with a single exception) by the */
  582. /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
  583. /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
  584. /* which encoding is really present. For example, */
  585. /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
  586. /* Russian). */
  587. /* */
  588. /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
  589. /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
  590. /* FT_ENCODING_APPLE_ROMAN). */
  591. /* */
  592. /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
  593. /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
  594. /* be needed to be able to distinguish Apple encoding variants. See */
  595. /* */
  596. /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
  597. /* */
  598. /* to get an idea how to do that. Basically, if the language ID */
  599. /* is~0, don't use it, otherwise subtract 1 from the language ID. */
  600. /* Then examine `encoding_id'. If, for example, `encoding_id' is */
  601. /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
  602. /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
  603. /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
  604. /* variant the Arabic encoding. */
  605. /* */
  606. typedef enum FT_Encoding_
  607. {
  608. FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
  609. FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
  610. FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
  611. FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
  612. FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
  613. FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
  614. FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
  615. FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
  616. /* for backwards compatibility */
  617. FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
  618. FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
  619. FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
  620. FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
  621. FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
  622. FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
  623. FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
  624. FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
  625. FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
  626. FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
  627. FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
  628. } FT_Encoding;
  629. /*************************************************************************/
  630. /* */
  631. /* <Enum> */
  632. /* ft_encoding_xxx */
  633. /* */
  634. /* <Description> */
  635. /* These constants are deprecated; use the corresponding @FT_Encoding */
  636. /* values instead. */
  637. /* */
  638. #define ft_encoding_none FT_ENCODING_NONE
  639. #define ft_encoding_unicode FT_ENCODING_UNICODE
  640. #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
  641. #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
  642. #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
  643. #define ft_encoding_sjis FT_ENCODING_SJIS
  644. #define ft_encoding_gb2312 FT_ENCODING_GB2312
  645. #define ft_encoding_big5 FT_ENCODING_BIG5
  646. #define ft_encoding_wansung FT_ENCODING_WANSUNG
  647. #define ft_encoding_johab FT_ENCODING_JOHAB
  648. #define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
  649. #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
  650. #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
  651. #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
  652. /*************************************************************************/
  653. /* */
  654. /* <Struct> */
  655. /* FT_CharMapRec */
  656. /* */
  657. /* <Description> */
  658. /* The base charmap structure. */
  659. /* */
  660. /* <Fields> */
  661. /* face :: A handle to the parent face object. */
  662. /* */
  663. /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
  664. /* this with @FT_Select_Charmap. */
  665. /* */
  666. /* platform_id :: An ID number describing the platform for the */
  667. /* following encoding ID. This comes directly from */
  668. /* the TrueType specification and should be emulated */
  669. /* for other formats. */
  670. /* */
  671. /* encoding_id :: A platform specific encoding number. This also */
  672. /* comes from the TrueType specification and should be */
  673. /* emulated similarly. */
  674. /* */
  675. typedef struct FT_CharMapRec_
  676. {
  677. FT_Face face;
  678. FT_Encoding encoding;
  679. FT_UShort platform_id;
  680. FT_UShort encoding_id;
  681. } FT_CharMapRec;
  682. /*************************************************************************/
  683. /*************************************************************************/
  684. /* */
  685. /* B A S E O B J E C T C L A S S E S */
  686. /* */