ftwinfnt.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /***************************************************************************/
  2. /* */
  3. /* ftwinfnt.h */
  4. /* */
  5. /* FreeType API for accessing Windows fnt-specific data. */
  6. /* */
  7. /* Copyright 2003, 2004, 2008 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 __FTWINFNT_H__
  18. #define __FTWINFNT_H__
  19. #include <ft2build.h>
  20. #include FT_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. /* winfnt_fonts */
  31. /* */
  32. /* <Title> */
  33. /* Window FNT Files */
  34. /* */
  35. /* <Abstract> */
  36. /* Windows FNT specific API. */
  37. /* */
  38. /* <Description> */
  39. /* This section contains the declaration of Windows FNT specific */
  40. /* functions. */
  41. /* */
  42. /*************************************************************************/
  43. /*************************************************************************
  44. *
  45. * @enum:
  46. * FT_WinFNT_ID_XXX
  47. *
  48. * @description:
  49. * A list of valid values for the `charset' byte in
  50. * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
  51. * encodings (except for cp1361) can be found at
  52. * ftp://ftp.unicode.org/public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
  53. * subdirectory. cp1361 is roughly a superset of
  54. * MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
  55. *
  56. * @values:
  57. * FT_WinFNT_ID_DEFAULT ::
  58. * This is used for font enumeration and font creation as a
  59. * `don't care' value. Valid font files don't contain this value.
  60. * When querying for information about the character set of the font
  61. * that is currently selected into a specified device context, this
  62. * return value (of the related Windows API) simply denotes failure.
  63. *
  64. * FT_WinFNT_ID_SYMBOL ::
  65. * There is no known mapping table available.
  66. *
  67. * FT_WinFNT_ID_MAC ::
  68. * Mac Roman encoding.
  69. *
  70. * FT_WinFNT_ID_OEM ::
  71. * From Michael Pöttgen <[email protected]>:
  72. *
  73. * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
  74. * is used for the charset of vector fonts, like `modern.fon',
  75. * `roman.fon', and `script.fon' on Windows.
  76. *
  77. * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
  78. * specifies a character set that is operating-system dependent.
  79. *
  80. * The `IFIMETRICS' documentation from the `Windows Driver
  81. * Development Kit' says: This font supports an OEM-specific
  82. * character set. The OEM character set is system dependent.
  83. *
  84. * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
  85. * second default codepage that most international versions of
  86. * Windows have. It is one of the OEM codepages from
  87. *
  88. * http://www.microsoft.com/globaldev/reference/cphome.mspx,
  89. *
  90. * and is used for the `DOS boxes', to support legacy applications.
  91. * A German Windows version for example usually uses ANSI codepage
  92. * 1252 and OEM codepage 850.
  93. *
  94. * FT_WinFNT_ID_CP874 ::
  95. * A superset of Thai TIS 620 and ISO 8859-11.
  96. *
  97. * FT_WinFNT_ID_CP932 ::
  98. * A superset of Japanese Shift-JIS (with minor deviations).
  99. *
  100. * FT_WinFNT_ID_CP936 ::
  101. * A superset of simplified Chinese GB 2312-1980 (with different
  102. * ordering and minor deviations).
  103. *
  104. * FT_WinFNT_ID_CP949 ::
  105. * A superset of Korean Hangul KS~C 5601-1987 (with different
  106. * ordering and minor deviations).
  107. *
  108. * FT_WinFNT_ID_CP950 ::
  109. * A superset of traditional Chinese Big~5 ETen (with different
  110. * ordering and minor deviations).
  111. *
  112. * FT_WinFNT_ID_CP1250 ::
  113. * A superset of East European ISO 8859-2 (with slightly different
  114. * ordering).
  115. *
  116. * FT_WinFNT_ID_CP1251 ::
  117. * A superset of Russian ISO 8859-5 (with different ordering).
  118. *
  119. * FT_WinFNT_ID_CP1252 ::
  120. * ANSI encoding. A superset of ISO 8859-1.
  121. *
  122. * FT_WinFNT_ID_CP1253 ::
  123. * A superset of Greek ISO 8859-7 (with minor modifications).
  124. *
  125. * FT_WinFNT_ID_CP1254 ::
  126. * A superset of Turkish ISO 8859-9.
  127. *
  128. * FT_WinFNT_ID_CP1255 ::
  129. * A superset of Hebrew ISO 8859-8 (with some modifications).
  130. *
  131. * FT_WinFNT_ID_CP1256 ::
  132. * A superset of Arabic ISO 8859-6 (with different ordering).
  133. *
  134. * FT_WinFNT_ID_CP1257 ::
  135. * A superset of Baltic ISO 8859-13 (with some deviations).
  136. *
  137. * FT_WinFNT_ID_CP1258 ::
  138. * For Vietnamese. This encoding doesn't cover all necessary
  139. * characters.
  140. *
  141. * FT_WinFNT_ID_CP1361 ::
  142. * Korean (Johab).
  143. */
  144. #define FT_WinFNT_ID_CP1252 0
  145. #define FT_WinFNT_ID_DEFAULT 1
  146. #define FT_WinFNT_ID_SYMBOL 2
  147. #define FT_WinFNT_ID_MAC 77
  148. #define FT_WinFNT_ID_CP932 128
  149. #define FT_WinFNT_ID_CP949 129
  150. #define FT_WinFNT_ID_CP1361 130
  151. #define FT_WinFNT_ID_CP936 134
  152. #define FT_WinFNT_ID_CP950 136
  153. #define FT_WinFNT_ID_CP1253 161
  154. #define FT_WinFNT_ID_CP1254 162
  155. #define FT_WinFNT_ID_CP1258 163
  156. #define FT_WinFNT_ID_CP1255 177
  157. #define FT_WinFNT_ID_CP1256 178
  158. #define FT_WinFNT_ID_CP1257 186
  159. #define FT_WinFNT_ID_CP1251 204
  160. #define FT_WinFNT_ID_CP874 222
  161. #define FT_WinFNT_ID_CP1250 238
  162. #define FT_WinFNT_ID_OEM 255
  163. /*************************************************************************/
  164. /* */
  165. /* <Struct> */
  166. /* FT_WinFNT_HeaderRec */
  167. /* */
  168. /* <Description> */
  169. /* Windows FNT Header info. */
  170. /* */
  171. typedef struct FT_WinFNT_HeaderRec_
  172. {
  173. FT_UShort version;
  174. FT_ULong file_size;
  175. FT_Byte copyright[60];
  176. FT_UShort file_type;
  177. FT_UShort nominal_point_size;
  178. FT_UShort vertical_resolution;
  179. FT_UShort horizontal_resolution;
  180. FT_UShort ascent;
  181. FT_UShort internal_leading;
  182. FT_UShort external_leading;
  183. FT_Byte italic;
  184. FT_Byte underline;
  185. FT_Byte strike_out;
  186. FT_UShort weight;
  187. FT_Byte charset;
  188. FT_UShort pixel_width;
  189. FT_UShort pixel_height;
  190. FT_Byte pitch_and_family;
  191. FT_UShort avg_width;
  192. FT_UShort max_width;
  193. FT_Byte first_char;
  194. FT_Byte last_char;
  195. FT_Byte default_char;
  196. FT_Byte break_char;
  197. FT_UShort bytes_per_row;
  198. FT_ULong device_offset;
  199. FT_ULong face_name_offset;
  200. FT_ULong bits_pointer;
  201. FT_ULong bits_offset;
  202. FT_Byte reserved;
  203. FT_ULong flags;
  204. FT_UShort A_space;
  205. FT_UShort B_space;
  206. FT_UShort C_space;
  207. FT_UShort color_table_offset;
  208. FT_ULong reserved1[4];
  209. } FT_WinFNT_HeaderRec;
  210. /*************************************************************************/
  211. /* */
  212. /* <Struct> */
  213. /* FT_WinFNT_Header */
  214. /* */
  215. /* <Description> */
  216. /* A handle to an @FT_WinFNT_HeaderRec structure. */
  217. /* */
  218. typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
  219. /**********************************************************************
  220. *
  221. * @function:
  222. * FT_Get_WinFNT_Header
  223. *
  224. * @description:
  225. * Retrieve a Windows FNT font info header.
  226. *
  227. * @input:
  228. * face :: A handle to the input face.
  229. *
  230. * @output:
  231. * aheader :: The WinFNT header.
  232. *
  233. * @return:
  234. * FreeType error code. 0~means success.
  235. *
  236. * @note:
  237. * This function only works with Windows FNT faces, returning an error
  238. * otherwise.
  239. */
  240. FT_EXPORT( FT_Error )
  241. FT_Get_WinFNT_Header( FT_Face face,
  242. FT_WinFNT_HeaderRec *aheader );
  243. /* */
  244. FT_END_HEADER
  245. #endif /* __FTWINFNT_H__ */
  246. /* END */
  247. /* Local Variables: */
  248. /* coding: utf-8 */
  249. /* End: */