1 /***************************************************************************/
5 /* FreeType API for validating OpenType tables (specification). */
7 /* Copyright 2004, 2005 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16 /***************************************************************************/
19 /***************************************************************************/
22 /* Warning: This module might be moved to a different library in the */
23 /* future to avoid a tight dependency between FreeType and the */
24 /* OpenType specification. */
27 /***************************************************************************/
34 #include FT_FREETYPE_H
37 #error "freetype.h of FreeType 1 has been loaded!"
38 #error "Please fix the directory search order for header files"
39 #error "so that freetype.h of FreeType 2 is found first."
46 /*************************************************************************/
52 /* OpenType Validation */
55 /* An API to validate OpenType tables. */
58 /* This section contains the declaration of functions to validate */
59 /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF). */
61 /*************************************************************************/
64 /**********************************************************************
70 * A list of bit-field constants used with @FT_OpenType_Validate to
71 * indicate which OpenType tables should be validated.
75 * Validate BASE table.
78 * Validate GDEF table.
81 * Validate GPOS table.
84 * Validate GSUB table.
87 * Validate JSTF table.
90 * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).
93 #define FT_VALIDATE_BASE 0x0100
94 #define FT_VALIDATE_GDEF 0x0200
95 #define FT_VALIDATE_GPOS 0x0400
96 #define FT_VALIDATE_GSUB 0x0800
97 #define FT_VALIDATE_JSTF 0x1000
99 #define FT_VALIDATE_OT FT_VALIDATE_BASE | \
107 /**********************************************************************
110 * FT_OpenType_Validate
113 * Validate various OpenType tables to assure that all offsets and
114 * indices are valid. The idea is that a higher-level library which
115 * actually does the text layout can access those tables without
116 * error checking (which can be quite time consuming).
120 * A handle to the input face.
122 * validation_flags ::
123 * A bit field which specifies the tables to be validated. See
124 * @FT_VALIDATE_XXX for possible values.
128 * A pointer to the BASE table.
131 * A pointer to the GDEF table.
134 * A pointer to the GPOS table.
137 * A pointer to the GSUB table.
140 * A pointer to the JSTF table.
143 * FreeType error code. 0 means success.
146 * This function only works with OpenType fonts, returning an error
149 * After use, the application should deallocate the five tables with
150 * `free'. A NULL value indicates that the table either doesn't exist
151 * in the font, or the application hasn't asked for validation.
153 FT_EXPORT( FT_Error )
154 FT_OpenType_Validate( FT_Face face,
155 FT_UInt validation_flags,
156 FT_Bytes *BASE_table,
157 FT_Bytes *GDEF_table,
158 FT_Bytes *GPOS_table,
159 FT_Bytes *GSUB_table,
160 FT_Bytes *JSTF_table );
167 #endif /* __FTOTVAL_H__ */