michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* ftotval.h */ michael@0: /* */ michael@0: /* FreeType API for validating OpenType tables (specification). */ michael@0: /* */ michael@0: /* Copyright 2004-2007, 2013 by */ michael@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ michael@0: /* */ michael@0: /* This file is part of the FreeType project, and may only be used, */ michael@0: /* modified, and distributed under the terms of the FreeType project */ michael@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ michael@0: /* this file you indicate that you have read the license and */ michael@0: /* understand and accept it fully. */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* */ michael@0: /* Warning: This module might be moved to a different library in the */ michael@0: /* future to avoid a tight dependency between FreeType and the */ michael@0: /* OpenType specification. */ michael@0: /* */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: #ifndef __FTOTVAL_H__ michael@0: #define __FTOTVAL_H__ michael@0: michael@0: #include michael@0: #include FT_FREETYPE_H michael@0: michael@0: #ifdef FREETYPE_H michael@0: #error "freetype.h of FreeType 1 has been loaded!" michael@0: #error "Please fix the directory search order for header files" michael@0: #error "so that freetype.h of FreeType 2 is found first." michael@0: #endif michael@0: michael@0: michael@0: FT_BEGIN_HEADER michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /*
*/ michael@0: /* ot_validation */ michael@0: /* */ michael@0: /* */ michael@0: /* OpenType Validation */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* An API to validate OpenType tables. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This section contains the declaration of functions to validate */ michael@0: /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @enum: michael@0: * FT_VALIDATE_OTXXX michael@0: * michael@0: * @description: michael@0: * A list of bit-field constants used with @FT_OpenType_Validate to michael@0: * indicate which OpenType tables should be validated. michael@0: * michael@0: * @values: michael@0: * FT_VALIDATE_BASE :: michael@0: * Validate BASE table. michael@0: * michael@0: * FT_VALIDATE_GDEF :: michael@0: * Validate GDEF table. michael@0: * michael@0: * FT_VALIDATE_GPOS :: michael@0: * Validate GPOS table. michael@0: * michael@0: * FT_VALIDATE_GSUB :: michael@0: * Validate GSUB table. michael@0: * michael@0: * FT_VALIDATE_JSTF :: michael@0: * Validate JSTF table. michael@0: * michael@0: * FT_VALIDATE_MATH :: michael@0: * Validate MATH table. michael@0: * michael@0: * FT_VALIDATE_OT :: michael@0: * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). michael@0: * michael@0: */ michael@0: #define FT_VALIDATE_BASE 0x0100 michael@0: #define FT_VALIDATE_GDEF 0x0200 michael@0: #define FT_VALIDATE_GPOS 0x0400 michael@0: #define FT_VALIDATE_GSUB 0x0800 michael@0: #define FT_VALIDATE_JSTF 0x1000 michael@0: #define FT_VALIDATE_MATH 0x2000 michael@0: michael@0: #define FT_VALIDATE_OT FT_VALIDATE_BASE | \ michael@0: FT_VALIDATE_GDEF | \ michael@0: FT_VALIDATE_GPOS | \ michael@0: FT_VALIDATE_GSUB | \ michael@0: FT_VALIDATE_JSTF | \ michael@0: FT_VALIDATE_MATH michael@0: michael@0: /* */ michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @function: michael@0: * FT_OpenType_Validate michael@0: * michael@0: * @description: michael@0: * Validate various OpenType tables to assure that all offsets and michael@0: * indices are valid. The idea is that a higher-level library that michael@0: * actually does the text layout can access those tables without michael@0: * error checking (which can be quite time consuming). michael@0: * michael@0: * @input: michael@0: * face :: michael@0: * A handle to the input face. michael@0: * michael@0: * validation_flags :: michael@0: * A bit field that specifies the tables to be validated. See michael@0: * @FT_VALIDATE_OTXXX for possible values. michael@0: * michael@0: * @output: michael@0: * BASE_table :: michael@0: * A pointer to the BASE table. michael@0: * michael@0: * GDEF_table :: michael@0: * A pointer to the GDEF table. michael@0: * michael@0: * GPOS_table :: michael@0: * A pointer to the GPOS table. michael@0: * michael@0: * GSUB_table :: michael@0: * A pointer to the GSUB table. michael@0: * michael@0: * JSTF_table :: michael@0: * A pointer to the JSTF table. michael@0: * michael@0: * @return: michael@0: * FreeType error code. 0~means success. michael@0: * michael@0: * @note: michael@0: * This function only works with OpenType fonts, returning an error michael@0: * otherwise. michael@0: * michael@0: * After use, the application should deallocate the five tables with michael@0: * @FT_OpenType_Free. A NULL value indicates that the table either michael@0: * doesn't exist in the font, or the application hasn't asked for michael@0: * validation. michael@0: */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_OpenType_Validate( FT_Face face, michael@0: FT_UInt validation_flags, michael@0: FT_Bytes *BASE_table, michael@0: FT_Bytes *GDEF_table, michael@0: FT_Bytes *GPOS_table, michael@0: FT_Bytes *GSUB_table, michael@0: FT_Bytes *JSTF_table ); michael@0: michael@0: /* */ michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @function: michael@0: * FT_OpenType_Free michael@0: * michael@0: * @description: michael@0: * Free the buffer allocated by OpenType validator. michael@0: * michael@0: * @input: michael@0: * face :: michael@0: * A handle to the input face. michael@0: * michael@0: * table :: michael@0: * The pointer to the buffer that is allocated by michael@0: * @FT_OpenType_Validate. michael@0: * michael@0: * @note: michael@0: * This function must be used to free the buffer allocated by michael@0: * @FT_OpenType_Validate only. michael@0: */ michael@0: FT_EXPORT( void ) michael@0: FT_OpenType_Free( FT_Face face, michael@0: FT_Bytes table ); michael@0: michael@0: michael@0: /* */ michael@0: michael@0: michael@0: FT_END_HEADER michael@0: michael@0: #endif /* __FTOTVAL_H__ */ michael@0: michael@0: michael@0: /* END */