vrshoot
diff libs/ft2static/freetype/ftotval.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/ftotval.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,203 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftotval.h */ 1.7 +/* */ 1.8 +/* FreeType API for validating OpenType tables (specification). */ 1.9 +/* */ 1.10 +/* Copyright 2004, 2005, 2006, 2007 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +/***************************************************************************/ 1.23 +/* */ 1.24 +/* */ 1.25 +/* Warning: This module might be moved to a different library in the */ 1.26 +/* future to avoid a tight dependency between FreeType and the */ 1.27 +/* OpenType specification. */ 1.28 +/* */ 1.29 +/* */ 1.30 +/***************************************************************************/ 1.31 + 1.32 + 1.33 +#ifndef __FTOTVAL_H__ 1.34 +#define __FTOTVAL_H__ 1.35 + 1.36 +#include <ft2build.h> 1.37 +#include FT_FREETYPE_H 1.38 + 1.39 +#ifdef FREETYPE_H 1.40 +#error "freetype.h of FreeType 1 has been loaded!" 1.41 +#error "Please fix the directory search order for header files" 1.42 +#error "so that freetype.h of FreeType 2 is found first." 1.43 +#endif 1.44 + 1.45 + 1.46 +FT_BEGIN_HEADER 1.47 + 1.48 + 1.49 + /*************************************************************************/ 1.50 + /* */ 1.51 + /* <Section> */ 1.52 + /* ot_validation */ 1.53 + /* */ 1.54 + /* <Title> */ 1.55 + /* OpenType Validation */ 1.56 + /* */ 1.57 + /* <Abstract> */ 1.58 + /* An API to validate OpenType tables. */ 1.59 + /* */ 1.60 + /* <Description> */ 1.61 + /* This section contains the declaration of functions to validate */ 1.62 + /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ 1.63 + /* */ 1.64 + /*************************************************************************/ 1.65 + 1.66 + 1.67 + /********************************************************************** 1.68 + * 1.69 + * @enum: 1.70 + * FT_VALIDATE_OTXXX 1.71 + * 1.72 + * @description: 1.73 + * A list of bit-field constants used with @FT_OpenType_Validate to 1.74 + * indicate which OpenType tables should be validated. 1.75 + * 1.76 + * @values: 1.77 + * FT_VALIDATE_BASE :: 1.78 + * Validate BASE table. 1.79 + * 1.80 + * FT_VALIDATE_GDEF :: 1.81 + * Validate GDEF table. 1.82 + * 1.83 + * FT_VALIDATE_GPOS :: 1.84 + * Validate GPOS table. 1.85 + * 1.86 + * FT_VALIDATE_GSUB :: 1.87 + * Validate GSUB table. 1.88 + * 1.89 + * FT_VALIDATE_JSTF :: 1.90 + * Validate JSTF table. 1.91 + * 1.92 + * FT_VALIDATE_MATH :: 1.93 + * Validate MATH table. 1.94 + * 1.95 + * FT_VALIDATE_OT :: 1.96 + * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). 1.97 + * 1.98 + */ 1.99 +#define FT_VALIDATE_BASE 0x0100 1.100 +#define FT_VALIDATE_GDEF 0x0200 1.101 +#define FT_VALIDATE_GPOS 0x0400 1.102 +#define FT_VALIDATE_GSUB 0x0800 1.103 +#define FT_VALIDATE_JSTF 0x1000 1.104 +#define FT_VALIDATE_MATH 0x2000 1.105 + 1.106 +#define FT_VALIDATE_OT FT_VALIDATE_BASE | \ 1.107 + FT_VALIDATE_GDEF | \ 1.108 + FT_VALIDATE_GPOS | \ 1.109 + FT_VALIDATE_GSUB | \ 1.110 + FT_VALIDATE_JSTF | \ 1.111 + FT_VALIDATE_MATH 1.112 + 1.113 + /* */ 1.114 + 1.115 + /********************************************************************** 1.116 + * 1.117 + * @function: 1.118 + * FT_OpenType_Validate 1.119 + * 1.120 + * @description: 1.121 + * Validate various OpenType tables to assure that all offsets and 1.122 + * indices are valid. The idea is that a higher-level library which 1.123 + * actually does the text layout can access those tables without 1.124 + * error checking (which can be quite time consuming). 1.125 + * 1.126 + * @input: 1.127 + * face :: 1.128 + * A handle to the input face. 1.129 + * 1.130 + * validation_flags :: 1.131 + * A bit field which specifies the tables to be validated. See 1.132 + * @FT_VALIDATE_OTXXX for possible values. 1.133 + * 1.134 + * @output: 1.135 + * BASE_table :: 1.136 + * A pointer to the BASE table. 1.137 + * 1.138 + * GDEF_table :: 1.139 + * A pointer to the GDEF table. 1.140 + * 1.141 + * GPOS_table :: 1.142 + * A pointer to the GPOS table. 1.143 + * 1.144 + * GSUB_table :: 1.145 + * A pointer to the GSUB table. 1.146 + * 1.147 + * JSTF_table :: 1.148 + * A pointer to the JSTF table. 1.149 + * 1.150 + * @return: 1.151 + * FreeType error code. 0~means success. 1.152 + * 1.153 + * @note: 1.154 + * This function only works with OpenType fonts, returning an error 1.155 + * otherwise. 1.156 + * 1.157 + * After use, the application should deallocate the five tables with 1.158 + * @FT_OpenType_Free. A NULL value indicates that the table either 1.159 + * doesn't exist in the font, or the application hasn't asked for 1.160 + * validation. 1.161 + */ 1.162 + FT_EXPORT( FT_Error ) 1.163 + FT_OpenType_Validate( FT_Face face, 1.164 + FT_UInt validation_flags, 1.165 + FT_Bytes *BASE_table, 1.166 + FT_Bytes *GDEF_table, 1.167 + FT_Bytes *GPOS_table, 1.168 + FT_Bytes *GSUB_table, 1.169 + FT_Bytes *JSTF_table ); 1.170 + 1.171 + /* */ 1.172 + 1.173 + /********************************************************************** 1.174 + * 1.175 + * @function: 1.176 + * FT_OpenType_Free 1.177 + * 1.178 + * @description: 1.179 + * Free the buffer allocated by OpenType validator. 1.180 + * 1.181 + * @input: 1.182 + * face :: 1.183 + * A handle to the input face. 1.184 + * 1.185 + * table :: 1.186 + * The pointer to the buffer that is allocated by 1.187 + * @FT_OpenType_Validate. 1.188 + * 1.189 + * @note: 1.190 + * This function must be used to free the buffer allocated by 1.191 + * @FT_OpenType_Validate only. 1.192 + */ 1.193 + FT_EXPORT( void ) 1.194 + FT_OpenType_Free( FT_Face face, 1.195 + FT_Bytes table ); 1.196 + 1.197 + 1.198 + /* */ 1.199 + 1.200 + 1.201 +FT_END_HEADER 1.202 + 1.203 +#endif /* __FTOTVAL_H__ */ 1.204 + 1.205 + 1.206 +/* END */