1 /***************************************************************************/
5 /* FreeType API for validating OpenType tables (specification). */
7 /* Copyright 2004-2015 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, MATH). */
62 /* FT_OpenType_Validate */
63 /* FT_OpenType_Free */
65 /* FT_VALIDATE_OTXXX */
67 /*************************************************************************/
70 /**********************************************************************
76 * A list of bit-field constants used with @FT_OpenType_Validate to
77 * indicate which OpenType tables should be validated.
81 * Validate BASE table.
84 * Validate GDEF table.
87 * Validate GPOS table.
90 * Validate GSUB table.
93 * Validate JSTF table.
96 * Validate MATH table.
99 * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
102 #define FT_VALIDATE_BASE 0x0100
103 #define FT_VALIDATE_GDEF 0x0200
104 #define FT_VALIDATE_GPOS 0x0400
105 #define FT_VALIDATE_GSUB 0x0800
106 #define FT_VALIDATE_JSTF 0x1000
107 #define FT_VALIDATE_MATH 0x2000
109 #define FT_VALIDATE_OT FT_VALIDATE_BASE | \
116 /**********************************************************************
119 * FT_OpenType_Validate
122 * Validate various OpenType tables to assure that all offsets and
123 * indices are valid. The idea is that a higher-level library that
124 * actually does the text layout can access those tables without
125 * error checking (which can be quite time consuming).
129 * A handle to the input face.
131 * validation_flags ::
132 * A bit field that specifies the tables to be validated. See
133 * @FT_VALIDATE_OTXXX for possible values.
137 * A pointer to the BASE table.
140 * A pointer to the GDEF table.
143 * A pointer to the GPOS table.
146 * A pointer to the GSUB table.
149 * A pointer to the JSTF table.
152 * FreeType error code. 0~means success.
155 * This function only works with OpenType fonts, returning an error
158 * After use, the application should deallocate the five tables with
159 * @FT_OpenType_Free. A NULL value indicates that the table either
160 * doesn't exist in the font, or the application hasn't asked for
163 FT_EXPORT( FT_Error
)
164 FT_OpenType_Validate( FT_Face face
,
165 FT_UInt validation_flags
,
166 FT_Bytes
*BASE_table
,
167 FT_Bytes
*GDEF_table
,
168 FT_Bytes
*GPOS_table
,
169 FT_Bytes
*GSUB_table
,
170 FT_Bytes
*JSTF_table
);
172 /**********************************************************************
178 * Free the buffer allocated by OpenType validator.
182 * A handle to the input face.
185 * The pointer to the buffer that is allocated by
186 * @FT_OpenType_Validate.
189 * This function must be used to free the buffer allocated by
190 * @FT_OpenType_Validate only.
193 FT_OpenType_Free( FT_Face face
,
201 #endif /* __FTOTVAL_H__ */