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