OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ftgxval.h */ | 3 /* ftgxval.h */ |
4 /* */ | 4 /* */ |
5 /* FreeType API for validating TrueTypeGX/AAT tables (specification). */ | 5 /* FreeType API for validating TrueTypeGX/AAT tables (specification). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2004, 2005, 2006 by */ | 7 /* Copyright 2004-2006, 2013 by */ |
8 /* Masatake YAMATO, Redhat K.K, */ | 8 /* Masatake YAMATO, Redhat K.K, */ |
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
10 /* */ | 10 /* */ |
11 /* This file is part of the FreeType project, and may only be used, */ | 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 */ | 12 /* modified, and distributed under the terms of the FreeType project */ |
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
14 /* this file you indicate that you have read the license and */ | 14 /* this file you indicate that you have read the license and */ |
15 /* understand and accept it fully. */ | 15 /* understand and accept it fully. */ |
16 /* */ | 16 /* */ |
17 /***************************************************************************/ | 17 /***************************************************************************/ |
18 | 18 |
19 /***************************************************************************/ | 19 /***************************************************************************/ |
20 /* */ | 20 /* */ |
21 /* gxvalid is derived from both gxlayout module and otvalid module. */ | 21 /* gxvalid is derived from both gxlayout module and otvalid module. */ |
22 /* Development of gxlayout is supported by the Information-technology */ | 22 /* Development of gxlayout is supported by the Information-technology */ |
23 /* Promotion Agency(IPA), Japan. */ | 23 /* Promotion Agency(IPA), Japan. */ |
24 /* */ | 24 /* */ |
25 /***************************************************************************/ | 25 /***************************************************************************/ |
26 | 26 |
27 | 27 |
28 #ifndef __FTGXVAL_H__ | 28 #ifndef __FTGXVAL_H__ |
29 #define __FTGXVAL_H__ | 29 #define __FTGXVAL_H__ |
30 | 30 |
31 #include "../ft2build.h" | 31 #include <ft2build.h> |
32 #include "freetype.h" | 32 #include FT_FREETYPE_H |
33 | 33 |
34 #ifdef FREETYPE_H | 34 #ifdef FREETYPE_H |
35 #error "freetype.h of FreeType 1 has been loaded!" | 35 #error "freetype.h of FreeType 1 has been loaded!" |
36 #error "Please fix the directory search order for header files" | 36 #error "Please fix the directory search order for header files" |
37 #error "so that freetype.h of FreeType 2 is found first." | 37 #error "so that freetype.h of FreeType 2 is found first." |
38 #endif | 38 #endif |
39 | 39 |
40 | 40 |
41 FT_BEGIN_HEADER | 41 FT_BEGIN_HEADER |
42 | 42 |
43 | 43 |
44 /*************************************************************************/ | 44 /*************************************************************************/ |
45 /* */ | 45 /* */ |
46 /* <Section> */ | 46 /* <Section> */ |
47 /* gx_validation */ | 47 /* gx_validation */ |
48 /* */ | 48 /* */ |
49 /* <Title> */ | 49 /* <Title> */ |
50 /* TrueTypeGX/AAT Validation */ | 50 /* TrueTypeGX/AAT Validation */ |
51 /* */ | 51 /* */ |
52 /* <Abstract> */ | 52 /* <Abstract> */ |
53 /* An API to validate TrueTypeGX/AAT tables. */ | 53 /* An API to validate TrueTypeGX/AAT tables. */ |
54 /* */ | 54 /* */ |
55 /* <Description> */ | 55 /* <Description> */ |
56 /* This section contains the declaration of functions to validate */ | 56 /* This section contains the declaration of functions to validate */ |
57 /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ | 57 /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ |
58 /* trak, prop, lcar). */ | 58 /* trak, prop, lcar). */ |
59 /* */ | 59 /* */ |
| 60 /* <Order> */ |
| 61 /* FT_TrueTypeGX_Validate */ |
| 62 /* FT_TrueTypeGX_Free */ |
| 63 /* */ |
| 64 /* FT_ClassicKern_Validate */ |
| 65 /* FT_ClassicKern_Free */ |
| 66 /* */ |
| 67 /* FT_VALIDATE_GX_LENGTH */ |
| 68 /* FT_VALIDATE_GXXXX */ |
| 69 /* FT_VALIDATE_CKERNXXX */ |
| 70 /* */ |
60 /*************************************************************************/ | 71 /*************************************************************************/ |
61 | 72 |
62 | |
63 /*************************************************************************/ | 73 /*************************************************************************/ |
64 /* */ | 74 /* */ |
65 /* */ | 75 /* */ |
66 /* Warning: Use FT_VALIDATE_XXX to validate a table. */ | 76 /* Warning: Use FT_VALIDATE_XXX to validate a table. */ |
67 /* Following definitions are for gxvalid developers. */ | 77 /* Following definitions are for gxvalid developers. */ |
68 /* */ | 78 /* */ |
69 /* */ | 79 /* */ |
70 /*************************************************************************/ | 80 /*************************************************************************/ |
71 | 81 |
72 #define FT_VALIDATE_feat_INDEX 0 | 82 #define FT_VALIDATE_feat_INDEX 0 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 FT_VALIDATE_morx | \ | 174 FT_VALIDATE_morx | \ |
165 FT_VALIDATE_bsln | \ | 175 FT_VALIDATE_bsln | \ |
166 FT_VALIDATE_just | \ | 176 FT_VALIDATE_just | \ |
167 FT_VALIDATE_kern | \ | 177 FT_VALIDATE_kern | \ |
168 FT_VALIDATE_opbd | \ | 178 FT_VALIDATE_opbd | \ |
169 FT_VALIDATE_trak | \ | 179 FT_VALIDATE_trak | \ |
170 FT_VALIDATE_prop | \ | 180 FT_VALIDATE_prop | \ |
171 FT_VALIDATE_lcar ) | 181 FT_VALIDATE_lcar ) |
172 | 182 |
173 | 183 |
174 /* */ | |
175 | |
176 /********************************************************************** | 184 /********************************************************************** |
177 * | 185 * |
178 * @function: | 186 * @function: |
179 * FT_TrueTypeGX_Validate | 187 * FT_TrueTypeGX_Validate |
180 * | 188 * |
181 * @description: | 189 * @description: |
182 * Validate various TrueTypeGX tables to assure that all offsets and | 190 * Validate various TrueTypeGX tables to assure that all offsets and |
183 * indices are valid. The idea is that a higher-level library which | 191 * indices are valid. The idea is that a higher-level library that |
184 * actually does the text layout can access those tables without | 192 * actually does the text layout can access those tables without |
185 * error checking (which can be quite time consuming). | 193 * error checking (which can be quite time consuming). |
186 * | 194 * |
187 * @input: | 195 * @input: |
188 * face :: | 196 * face :: |
189 * A handle to the input face. | 197 * A handle to the input face. |
190 * | 198 * |
191 * validation_flags :: | 199 * validation_flags :: |
192 * A bit field which specifies the tables to be validated. See | 200 * A bit field that specifies the tables to be validated. See |
193 * @FT_VALIDATE_GXXXX for possible values. | 201 * @FT_VALIDATE_GXXXX for possible values. |
194 * | 202 * |
195 * table_length :: | 203 * table_length :: |
196 * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH | 204 * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH |
197 * should be passed. | 205 * should be passed. |
198 * | 206 * |
199 * @output: | 207 * @output: |
200 * tables :: | 208 * tables :: |
201 * The array where all validated sfnt tables are stored. | 209 * The array where all validated sfnt tables are stored. |
202 * The array itself must be allocated by a client. | 210 * The array itself must be allocated by a client. |
(...skipping 11 matching lines...) Expand all Loading... |
214 * application hasn't asked for validation, or the validator doesn't have | 222 * application hasn't asked for validation, or the validator doesn't have |
215 * the ability to validate the sfnt table. | 223 * the ability to validate the sfnt table. |
216 */ | 224 */ |
217 FT_EXPORT( FT_Error ) | 225 FT_EXPORT( FT_Error ) |
218 FT_TrueTypeGX_Validate( FT_Face face, | 226 FT_TrueTypeGX_Validate( FT_Face face, |
219 FT_UInt validation_flags, | 227 FT_UInt validation_flags, |
220 FT_Bytes tables[FT_VALIDATE_GX_LENGTH], | 228 FT_Bytes tables[FT_VALIDATE_GX_LENGTH], |
221 FT_UInt table_length ); | 229 FT_UInt table_length ); |
222 | 230 |
223 | 231 |
224 /* */ | |
225 | |
226 /********************************************************************** | 232 /********************************************************************** |
227 * | 233 * |
228 * @function: | 234 * @function: |
229 * FT_TrueTypeGX_Free | 235 * FT_TrueTypeGX_Free |
230 * | 236 * |
231 * @description: | 237 * @description: |
232 * Free the buffer allocated by TrueTypeGX validator. | 238 * Free the buffer allocated by TrueTypeGX validator. |
233 * | 239 * |
234 * @input: | 240 * @input: |
235 * face :: | 241 * face :: |
236 * A handle to the input face. | 242 * A handle to the input face. |
237 * | 243 * |
238 * table :: | 244 * table :: |
239 * The pointer to the buffer allocated by | 245 * The pointer to the buffer allocated by |
240 * @FT_TrueTypeGX_Validate. | 246 * @FT_TrueTypeGX_Validate. |
241 * | 247 * |
242 * @note: | 248 * @note: |
243 * This function must be used to free the buffer allocated by | 249 * This function must be used to free the buffer allocated by |
244 * @FT_TrueTypeGX_Validate only. | 250 * @FT_TrueTypeGX_Validate only. |
245 */ | 251 */ |
246 FT_EXPORT( void ) | 252 FT_EXPORT( void ) |
247 FT_TrueTypeGX_Free( FT_Face face, | 253 FT_TrueTypeGX_Free( FT_Face face, |
248 FT_Bytes table ); | 254 FT_Bytes table ); |
249 | 255 |
250 | 256 |
251 /* */ | |
252 | |
253 /********************************************************************** | 257 /********************************************************************** |
254 * | 258 * |
255 * @enum: | 259 * @enum: |
256 * FT_VALIDATE_CKERNXXX | 260 * FT_VALIDATE_CKERNXXX |
257 * | 261 * |
258 * @description: | 262 * @description: |
259 * A list of bit-field constants used with @FT_ClassicKern_Validate | 263 * A list of bit-field constants used with @FT_ClassicKern_Validate |
260 * to indicate the classic kern dialect or dialects. If the selected | 264 * to indicate the classic kern dialect or dialects. If the selected |
261 * type doesn't fit, @FT_ClassicKern_Validate regards the table as | 265 * type doesn't fit, @FT_ClassicKern_Validate regards the table as |
262 * invalid. | 266 * invalid. |
263 * | 267 * |
264 * @values: | 268 * @values: |
265 * FT_VALIDATE_MS :: | 269 * FT_VALIDATE_MS :: |
266 * Handle the `kern' table as a classic Microsoft kern table. | 270 * Handle the `kern' table as a classic Microsoft kern table. |
267 * | 271 * |
268 * FT_VALIDATE_APPLE :: | 272 * FT_VALIDATE_APPLE :: |
269 * Handle the `kern' table as a classic Apple kern table. | 273 * Handle the `kern' table as a classic Apple kern table. |
270 * | 274 * |
271 * FT_VALIDATE_CKERN :: | 275 * FT_VALIDATE_CKERN :: |
272 * Handle the `kern' as either classic Apple or Microsoft kern table. | 276 * Handle the `kern' as either classic Apple or Microsoft kern table. |
273 */ | 277 */ |
274 #define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) | 278 #define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) |
275 #define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) | 279 #define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) |
276 | 280 |
277 #define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) | 281 #define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) |
278 | 282 |
279 | 283 |
280 /* */ | |
281 | |
282 /********************************************************************** | 284 /********************************************************************** |
283 * | 285 * |
284 * @function: | 286 * @function: |
285 * FT_ClassicKern_Validate | 287 * FT_ClassicKern_Validate |
286 * | 288 * |
287 * @description: | 289 * @description: |
288 * Validate classic (16-bit format) kern table to assure that the offsets | 290 * Validate classic (16-bit format) kern table to assure that the offsets |
289 * and indices are valid. The idea is that a higher-level library which | 291 * and indices are valid. The idea is that a higher-level library that |
290 * actually does the text layout can access those tables without error | 292 * actually does the text layout can access those tables without error |
291 * checking (which can be quite time consuming). | 293 * checking (which can be quite time consuming). |
292 * | 294 * |
293 * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both | 295 * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both |
294 * the new 32-bit format and the classic 16-bit format, while | 296 * the new 32-bit format and the classic 16-bit format, while |
295 * FT_ClassicKern_Validate only supports the classic 16-bit format. | 297 * FT_ClassicKern_Validate only supports the classic 16-bit format. |
296 * | 298 * |
297 * @input: | 299 * @input: |
298 * face :: | 300 * face :: |
299 * A handle to the input face. | 301 * A handle to the input face. |
300 * | 302 * |
301 * validation_flags :: | 303 * validation_flags :: |
302 * A bit field which specifies the dialect to be validated. See | 304 * A bit field that specifies the dialect to be validated. See |
303 * @FT_VALIDATE_CKERNXXX for possible values. | 305 * @FT_VALIDATE_CKERNXXX for possible values. |
304 * | 306 * |
305 * @output: | 307 * @output: |
306 * ckern_table :: | 308 * ckern_table :: |
307 * A pointer to the kern table. | 309 * A pointer to the kern table. |
308 * | 310 * |
309 * @return: | 311 * @return: |
310 * FreeType error code. 0~means success. | 312 * FreeType error code. 0~means success. |
311 * | 313 * |
312 * @note: | 314 * @note: |
313 * After use, the application should deallocate the buffers pointed to by | 315 * After use, the application should deallocate the buffers pointed to by |
314 * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value | 316 * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value |
315 * indicates that the table doesn't exist in the font. | 317 * indicates that the table doesn't exist in the font. |
316 */ | 318 */ |
317 FT_EXPORT( FT_Error ) | 319 FT_EXPORT( FT_Error ) |
318 FT_ClassicKern_Validate( FT_Face face, | 320 FT_ClassicKern_Validate( FT_Face face, |
319 FT_UInt validation_flags, | 321 FT_UInt validation_flags, |
320 FT_Bytes *ckern_table ); | 322 FT_Bytes *ckern_table ); |
321 | 323 |
322 | 324 |
323 /* */ | |
324 | |
325 /********************************************************************** | 325 /********************************************************************** |
326 * | 326 * |
327 * @function: | 327 * @function: |
328 * FT_ClassicKern_Free | 328 * FT_ClassicKern_Free |
329 * | 329 * |
330 * @description: | 330 * @description: |
331 * Free the buffer allocated by classic Kern validator. | 331 * Free the buffer allocated by classic Kern validator. |
332 * | 332 * |
333 * @input: | 333 * @input: |
334 * face :: | 334 * face :: |
335 * A handle to the input face. | 335 * A handle to the input face. |
336 * | 336 * |
337 * table :: | 337 * table :: |
338 * The pointer to the buffer that is allocated by | 338 * The pointer to the buffer that is allocated by |
339 * @FT_ClassicKern_Validate. | 339 * @FT_ClassicKern_Validate. |
340 * | 340 * |
341 * @note: | 341 * @note: |
342 * This function must be used to free the buffer allocated by | 342 * This function must be used to free the buffer allocated by |
343 * @FT_ClassicKern_Validate only. | 343 * @FT_ClassicKern_Validate only. |
344 */ | 344 */ |
345 FT_EXPORT( void ) | 345 FT_EXPORT( void ) |
346 FT_ClassicKern_Free( FT_Face face, | 346 FT_ClassicKern_Free( FT_Face face, |
347 FT_Bytes table ); | 347 FT_Bytes table ); |
348 | 348 |
349 | 349 /* */ |
350 /* */ | |
351 | 350 |
352 | 351 |
353 FT_END_HEADER | 352 FT_END_HEADER |
354 | 353 |
355 #endif /* __FTGXVAL_H__ */ | 354 #endif /* __FTGXVAL_H__ */ |
356 | 355 |
357 | 356 |
358 /* END */ | 357 /* END */ |
OLD | NEW |