Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /***************************************************************************/ |
michael@0 | 2 | /* */ |
michael@0 | 3 | /* ftotval.h */ |
michael@0 | 4 | /* */ |
michael@0 | 5 | /* FreeType API for validating OpenType tables (specification). */ |
michael@0 | 6 | /* */ |
michael@0 | 7 | /* Copyright 2004-2007, 2013 by */ |
michael@0 | 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
michael@0 | 9 | /* */ |
michael@0 | 10 | /* This file is part of the FreeType project, and may only be used, */ |
michael@0 | 11 | /* modified, and distributed under the terms of the FreeType project */ |
michael@0 | 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
michael@0 | 13 | /* this file you indicate that you have read the license and */ |
michael@0 | 14 | /* understand and accept it fully. */ |
michael@0 | 15 | /* */ |
michael@0 | 16 | /***************************************************************************/ |
michael@0 | 17 | |
michael@0 | 18 | |
michael@0 | 19 | /***************************************************************************/ |
michael@0 | 20 | /* */ |
michael@0 | 21 | /* */ |
michael@0 | 22 | /* Warning: This module might be moved to a different library in the */ |
michael@0 | 23 | /* future to avoid a tight dependency between FreeType and the */ |
michael@0 | 24 | /* OpenType specification. */ |
michael@0 | 25 | /* */ |
michael@0 | 26 | /* */ |
michael@0 | 27 | /***************************************************************************/ |
michael@0 | 28 | |
michael@0 | 29 | |
michael@0 | 30 | #ifndef __FTOTVAL_H__ |
michael@0 | 31 | #define __FTOTVAL_H__ |
michael@0 | 32 | |
michael@0 | 33 | #include <ft2build.h> |
michael@0 | 34 | #include FT_FREETYPE_H |
michael@0 | 35 | |
michael@0 | 36 | #ifdef FREETYPE_H |
michael@0 | 37 | #error "freetype.h of FreeType 1 has been loaded!" |
michael@0 | 38 | #error "Please fix the directory search order for header files" |
michael@0 | 39 | #error "so that freetype.h of FreeType 2 is found first." |
michael@0 | 40 | #endif |
michael@0 | 41 | |
michael@0 | 42 | |
michael@0 | 43 | FT_BEGIN_HEADER |
michael@0 | 44 | |
michael@0 | 45 | |
michael@0 | 46 | /*************************************************************************/ |
michael@0 | 47 | /* */ |
michael@0 | 48 | /* <Section> */ |
michael@0 | 49 | /* ot_validation */ |
michael@0 | 50 | /* */ |
michael@0 | 51 | /* <Title> */ |
michael@0 | 52 | /* OpenType Validation */ |
michael@0 | 53 | /* */ |
michael@0 | 54 | /* <Abstract> */ |
michael@0 | 55 | /* An API to validate OpenType tables. */ |
michael@0 | 56 | /* */ |
michael@0 | 57 | /* <Description> */ |
michael@0 | 58 | /* This section contains the declaration of functions to validate */ |
michael@0 | 59 | /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ |
michael@0 | 60 | /* */ |
michael@0 | 61 | /*************************************************************************/ |
michael@0 | 62 | |
michael@0 | 63 | |
michael@0 | 64 | /********************************************************************** |
michael@0 | 65 | * |
michael@0 | 66 | * @enum: |
michael@0 | 67 | * FT_VALIDATE_OTXXX |
michael@0 | 68 | * |
michael@0 | 69 | * @description: |
michael@0 | 70 | * A list of bit-field constants used with @FT_OpenType_Validate to |
michael@0 | 71 | * indicate which OpenType tables should be validated. |
michael@0 | 72 | * |
michael@0 | 73 | * @values: |
michael@0 | 74 | * FT_VALIDATE_BASE :: |
michael@0 | 75 | * Validate BASE table. |
michael@0 | 76 | * |
michael@0 | 77 | * FT_VALIDATE_GDEF :: |
michael@0 | 78 | * Validate GDEF table. |
michael@0 | 79 | * |
michael@0 | 80 | * FT_VALIDATE_GPOS :: |
michael@0 | 81 | * Validate GPOS table. |
michael@0 | 82 | * |
michael@0 | 83 | * FT_VALIDATE_GSUB :: |
michael@0 | 84 | * Validate GSUB table. |
michael@0 | 85 | * |
michael@0 | 86 | * FT_VALIDATE_JSTF :: |
michael@0 | 87 | * Validate JSTF table. |
michael@0 | 88 | * |
michael@0 | 89 | * FT_VALIDATE_MATH :: |
michael@0 | 90 | * Validate MATH table. |
michael@0 | 91 | * |
michael@0 | 92 | * FT_VALIDATE_OT :: |
michael@0 | 93 | * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). |
michael@0 | 94 | * |
michael@0 | 95 | */ |
michael@0 | 96 | #define FT_VALIDATE_BASE 0x0100 |
michael@0 | 97 | #define FT_VALIDATE_GDEF 0x0200 |
michael@0 | 98 | #define FT_VALIDATE_GPOS 0x0400 |
michael@0 | 99 | #define FT_VALIDATE_GSUB 0x0800 |
michael@0 | 100 | #define FT_VALIDATE_JSTF 0x1000 |
michael@0 | 101 | #define FT_VALIDATE_MATH 0x2000 |
michael@0 | 102 | |
michael@0 | 103 | #define FT_VALIDATE_OT FT_VALIDATE_BASE | \ |
michael@0 | 104 | FT_VALIDATE_GDEF | \ |
michael@0 | 105 | FT_VALIDATE_GPOS | \ |
michael@0 | 106 | FT_VALIDATE_GSUB | \ |
michael@0 | 107 | FT_VALIDATE_JSTF | \ |
michael@0 | 108 | FT_VALIDATE_MATH |
michael@0 | 109 | |
michael@0 | 110 | /* */ |
michael@0 | 111 | |
michael@0 | 112 | /********************************************************************** |
michael@0 | 113 | * |
michael@0 | 114 | * @function: |
michael@0 | 115 | * FT_OpenType_Validate |
michael@0 | 116 | * |
michael@0 | 117 | * @description: |
michael@0 | 118 | * Validate various OpenType tables to assure that all offsets and |
michael@0 | 119 | * indices are valid. The idea is that a higher-level library that |
michael@0 | 120 | * actually does the text layout can access those tables without |
michael@0 | 121 | * error checking (which can be quite time consuming). |
michael@0 | 122 | * |
michael@0 | 123 | * @input: |
michael@0 | 124 | * face :: |
michael@0 | 125 | * A handle to the input face. |
michael@0 | 126 | * |
michael@0 | 127 | * validation_flags :: |
michael@0 | 128 | * A bit field that specifies the tables to be validated. See |
michael@0 | 129 | * @FT_VALIDATE_OTXXX for possible values. |
michael@0 | 130 | * |
michael@0 | 131 | * @output: |
michael@0 | 132 | * BASE_table :: |
michael@0 | 133 | * A pointer to the BASE table. |
michael@0 | 134 | * |
michael@0 | 135 | * GDEF_table :: |
michael@0 | 136 | * A pointer to the GDEF table. |
michael@0 | 137 | * |
michael@0 | 138 | * GPOS_table :: |
michael@0 | 139 | * A pointer to the GPOS table. |
michael@0 | 140 | * |
michael@0 | 141 | * GSUB_table :: |
michael@0 | 142 | * A pointer to the GSUB table. |
michael@0 | 143 | * |
michael@0 | 144 | * JSTF_table :: |
michael@0 | 145 | * A pointer to the JSTF table. |
michael@0 | 146 | * |
michael@0 | 147 | * @return: |
michael@0 | 148 | * FreeType error code. 0~means success. |
michael@0 | 149 | * |
michael@0 | 150 | * @note: |
michael@0 | 151 | * This function only works with OpenType fonts, returning an error |
michael@0 | 152 | * otherwise. |
michael@0 | 153 | * |
michael@0 | 154 | * After use, the application should deallocate the five tables with |
michael@0 | 155 | * @FT_OpenType_Free. A NULL value indicates that the table either |
michael@0 | 156 | * doesn't exist in the font, or the application hasn't asked for |
michael@0 | 157 | * validation. |
michael@0 | 158 | */ |
michael@0 | 159 | FT_EXPORT( FT_Error ) |
michael@0 | 160 | FT_OpenType_Validate( FT_Face face, |
michael@0 | 161 | FT_UInt validation_flags, |
michael@0 | 162 | FT_Bytes *BASE_table, |
michael@0 | 163 | FT_Bytes *GDEF_table, |
michael@0 | 164 | FT_Bytes *GPOS_table, |
michael@0 | 165 | FT_Bytes *GSUB_table, |
michael@0 | 166 | FT_Bytes *JSTF_table ); |
michael@0 | 167 | |
michael@0 | 168 | /* */ |
michael@0 | 169 | |
michael@0 | 170 | /********************************************************************** |
michael@0 | 171 | * |
michael@0 | 172 | * @function: |
michael@0 | 173 | * FT_OpenType_Free |
michael@0 | 174 | * |
michael@0 | 175 | * @description: |
michael@0 | 176 | * Free the buffer allocated by OpenType validator. |
michael@0 | 177 | * |
michael@0 | 178 | * @input: |
michael@0 | 179 | * face :: |
michael@0 | 180 | * A handle to the input face. |
michael@0 | 181 | * |
michael@0 | 182 | * table :: |
michael@0 | 183 | * The pointer to the buffer that is allocated by |
michael@0 | 184 | * @FT_OpenType_Validate. |
michael@0 | 185 | * |
michael@0 | 186 | * @note: |
michael@0 | 187 | * This function must be used to free the buffer allocated by |
michael@0 | 188 | * @FT_OpenType_Validate only. |
michael@0 | 189 | */ |
michael@0 | 190 | FT_EXPORT( void ) |
michael@0 | 191 | FT_OpenType_Free( FT_Face face, |
michael@0 | 192 | FT_Bytes table ); |
michael@0 | 193 | |
michael@0 | 194 | |
michael@0 | 195 | /* */ |
michael@0 | 196 | |
michael@0 | 197 | |
michael@0 | 198 | FT_END_HEADER |
michael@0 | 199 | |
michael@0 | 200 | #endif /* __FTOTVAL_H__ */ |
michael@0 | 201 | |
michael@0 | 202 | |
michael@0 | 203 | /* END */ |