1
/***************************************************************************/
5
/* FreeType API for validating OpenType tables (specification). */
7
/* Copyright 2004, 2005, 2006, 2007 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). */
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 MATH table.
93
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
96
#define FT_VALIDATE_BASE 0x0100
97
#define FT_VALIDATE_GDEF 0x0200
98
#define FT_VALIDATE_GPOS 0x0400
99
#define FT_VALIDATE_GSUB 0x0800
100
#define FT_VALIDATE_JSTF 0x1000
101
#define FT_VALIDATE_MATH 0x2000
103
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
112
/**********************************************************************
115
* FT_OpenType_Validate
118
* Validate various OpenType tables to assure that all offsets and
119
* indices are valid. The idea is that a higher-level library which
120
* actually does the text layout can access those tables without
121
* error checking (which can be quite time consuming).
125
* A handle to the input face.
127
* validation_flags ::
128
* A bit field which specifies the tables to be validated. See
129
* @FT_VALIDATE_OTXXX for possible values.
133
* A pointer to the BASE table.
136
* A pointer to the GDEF table.
139
* A pointer to the GPOS table.
142
* A pointer to the GSUB table.
145
* A pointer to the JSTF table.
148
* FreeType error code. 0~means success.
151
* This function only works with OpenType fonts, returning an error
154
* After use, the application should deallocate the five tables with
155
* @FT_OpenType_Free. A NULL value indicates that the table either
156
* doesn't exist in the font, or the application hasn't asked for
159
FT_EXPORT( FT_Error )
160
FT_OpenType_Validate( FT_Face face,
161
FT_UInt validation_flags,
162
FT_Bytes *BASE_table,
163
FT_Bytes *GDEF_table,
164
FT_Bytes *GPOS_table,
165
FT_Bytes *GSUB_table,
166
FT_Bytes *JSTF_table );
170
/**********************************************************************
176
* Free the buffer allocated by OpenType validator.
180
* A handle to the input face.
183
* The pointer to the buffer that is allocated by
184
* @FT_OpenType_Validate.
187
* This function must be used to free the buffer allocated by
188
* @FT_OpenType_Validate only.
191
FT_OpenType_Free( FT_Face face,
200
#endif /* __FTOTVAL_H__ */