Eneboo - Documentación para desarrolladores
|
00001 /******************************************************************* 00002 * 00003 * ftxopen.h 00004 * 00005 * TrueType Open support. 00006 * 00007 * Copyright 1996-2000 by 00008 * David Turner, Robert Wilhelm, and Werner Lemberg. 00009 * 00010 * This file is part of the FreeType project, and may only be used 00011 * modified and distributed under the terms of the FreeType project 00012 * license, LICENSE.TXT. By continuing to use, modify, or distribute 00013 * this file you indicate that you have read the license and 00014 * understand and accept it fully. 00015 * 00016 * This file should be included by the application. Nevertheless, 00017 * the table specific APIs (and structures) are located in files like 00018 * ftxgsub.h or ftxgpos.h; these header files are read by ftxopen.h . 00019 * 00020 ******************************************************************/ 00021 00022 #ifndef FTXOPEN_H 00023 #define FTXOPEN_H 00024 00025 #include <ft2build.h> 00026 #include FT_FREETYPE_H 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 #define EXPORT_DEF 00033 #define EXPORT_FUNC 00034 00035 #define TTO_MAX_NESTING_LEVEL 100 00036 00037 #define TTO_Err_Invalid_SubTable_Format 0x1000 00038 #define TTO_Err_Invalid_SubTable 0x1001 00039 #define TTO_Err_Not_Covered 0x1002 00040 #define TTO_Err_Too_Many_Nested_Contexts 0x1003 00041 #define TTO_Err_No_MM_Interpreter 0x1004 00042 #define TTO_Err_Empty_Script 0x1005 00043 00044 00045 /* Script list related structures */ 00046 00047 struct TTO_LangSys_ 00048 { 00049 FT_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */ 00050 FT_UShort ReqFeatureIndex; /* required FeatureIndex */ 00051 FT_UShort FeatureCount; /* number of Feature indices */ 00052 FT_UShort* FeatureIndex; /* array of Feature indices */ 00053 }; 00054 00055 typedef struct TTO_LangSys_ TTO_LangSys; 00056 00057 00058 struct TTO_LangSysRecord_ 00059 { 00060 FT_ULong LangSysTag; /* LangSysTag identifier */ 00061 TTO_LangSys LangSys; /* LangSys table */ 00062 }; 00063 00064 typedef struct TTO_LangSysRecord_ TTO_LangSysRecord; 00065 00066 00067 struct TTO_Script_ 00068 { 00069 TTO_LangSys DefaultLangSys; /* DefaultLangSys table */ 00070 FT_UShort LangSysCount; /* number of LangSysRecords */ 00071 TTO_LangSysRecord* LangSysRecord; /* array of LangSysRecords */ 00072 }; 00073 00074 typedef struct TTO_Script_ TTO_Script; 00075 00076 00077 struct TTO_ScriptRecord_ 00078 { 00079 FT_ULong ScriptTag; /* ScriptTag identifier */ 00080 TTO_Script Script; /* Script table */ 00081 }; 00082 00083 typedef struct TTO_ScriptRecord_ TTO_ScriptRecord; 00084 00085 00086 struct TTO_ScriptList_ 00087 { 00088 FT_UShort ScriptCount; /* number of ScriptRecords */ 00089 TTO_ScriptRecord* ScriptRecord; /* array of ScriptRecords */ 00090 }; 00091 00092 typedef struct TTO_ScriptList_ TTO_ScriptList; 00093 00094 00095 /* Feature list related structures */ 00096 00097 struct TTO_Feature_ 00098 { 00099 FT_UShort FeatureParams; /* always 0 for TT Open 1.0 */ 00100 FT_UShort LookupListCount; /* number of LookupList indices */ 00101 FT_UShort* LookupListIndex; /* array of LookupList indices */ 00102 }; 00103 00104 typedef struct TTO_Feature_ TTO_Feature; 00105 00106 00107 struct TTO_FeatureRecord_ 00108 { 00109 FT_ULong FeatureTag; /* FeatureTag identifier */ 00110 TTO_Feature Feature; /* Feature table */ 00111 }; 00112 00113 typedef struct TTO_FeatureRecord_ TTO_FeatureRecord; 00114 00115 00116 struct TTO_FeatureList_ 00117 { 00118 FT_UShort FeatureCount; /* number of FeatureRecords */ 00119 TTO_FeatureRecord* FeatureRecord; /* array of FeatureRecords */ 00120 FT_UShort* ApplyOrder; /* order to apply features */ 00121 FT_UShort ApplyCount; /* number of elements in ApplyOrder */ 00122 }; 00123 00124 typedef struct TTO_FeatureList_ TTO_FeatureList; 00125 00126 00127 /* Lookup list related structures */ 00128 00129 struct TTO_SubTable_; /* defined below after inclusion 00130 of ftxgsub.h and ftxgpos.h */ 00131 typedef struct TTO_SubTable_ TTO_SubTable; 00132 00133 00134 struct TTO_Lookup_ 00135 { 00136 FT_UShort LookupType; /* Lookup type */ 00137 FT_UShort LookupFlag; /* Lookup qualifiers */ 00138 FT_UShort SubTableCount; /* number of SubTables */ 00139 TTO_SubTable* SubTable; /* array of SubTables */ 00140 }; 00141 00142 typedef struct TTO_Lookup_ TTO_Lookup; 00143 00144 00145 /* The `Properties' field is not defined in the TTO specification but 00146 is needed for processing lookups. If properties[n] is > 0, the 00147 functions TT_GSUB_Apply_String() resp. TT_GPOS_Apply_String() will 00148 process Lookup[n] for glyphs which have the specific bit not set in 00149 the `properties' field of the input string object. */ 00150 00151 struct TTO_LookupList_ 00152 { 00153 FT_UShort LookupCount; /* number of Lookups */ 00154 TTO_Lookup* Lookup; /* array of Lookup records */ 00155 FT_UInt* Properties; /* array of flags */ 00156 }; 00157 00158 typedef struct TTO_LookupList_ TTO_LookupList; 00159 00160 00161 /* Possible LookupFlag bit masks. `IGNORE_SPECIAL_MARKS' comes from the 00162 OpenType 1.2 specification; RIGHT_TO_LEFT has been (re)introduced in 00163 OpenType 1.3 -- if set, the last glyph in a cursive attachment 00164 sequence has to be positioned on the baseline -- regardless of the 00165 writing direction. */ 00166 00167 #define RIGHT_TO_LEFT 0x0001 00168 #define IGNORE_BASE_GLYPHS 0x0002 00169 #define IGNORE_LIGATURES 0x0004 00170 #define IGNORE_MARKS 0x0008 00171 #define IGNORE_SPECIAL_MARKS 0xFF00 00172 00173 00174 struct TTO_CoverageFormat1_ 00175 { 00176 FT_UShort GlyphCount; /* number of glyphs in GlyphArray */ 00177 FT_UShort* GlyphArray; /* array of glyph IDs */ 00178 }; 00179 00180 typedef struct TTO_CoverageFormat1_ TTO_CoverageFormat1; 00181 00182 00183 struct TTO_RangeRecord_ 00184 { 00185 FT_UShort Start; /* first glyph ID in the range */ 00186 FT_UShort End; /* last glyph ID in the range */ 00187 FT_UShort StartCoverageIndex; /* coverage index of first 00188 glyph ID in the range */ 00189 }; 00190 00191 typedef struct TTO_RangeRecord_ TTO_RangeRecord; 00192 00193 00194 struct TTO_CoverageFormat2_ 00195 { 00196 FT_UShort RangeCount; /* number of RangeRecords */ 00197 TTO_RangeRecord* RangeRecord; /* array of RangeRecords */ 00198 }; 00199 00200 typedef struct TTO_CoverageFormat2_ TTO_CoverageFormat2; 00201 00202 00203 struct TTO_Coverage_ 00204 { 00205 FT_UShort CoverageFormat; /* 1 or 2 */ 00206 00207 union 00208 { 00209 TTO_CoverageFormat1 cf1; 00210 TTO_CoverageFormat2 cf2; 00211 } cf; 00212 }; 00213 00214 typedef struct TTO_Coverage_ TTO_Coverage; 00215 00216 00217 struct TTO_ClassDefFormat1_ 00218 { 00219 FT_UShort StartGlyph; /* first glyph ID of the 00220 ClassValueArray */ 00221 FT_UShort GlyphCount; /* size of the ClassValueArray */ 00222 FT_UShort* ClassValueArray; /* array of class values */ 00223 }; 00224 00225 typedef struct TTO_ClassDefFormat1_ TTO_ClassDefFormat1; 00226 00227 00228 struct TTO_ClassRangeRecord_ 00229 { 00230 FT_UShort Start; /* first glyph ID in the range */ 00231 FT_UShort End; /* last glyph ID in the range */ 00232 FT_UShort Class; /* applied to all glyphs in range */ 00233 }; 00234 00235 typedef struct TTO_ClassRangeRecord_ TTO_ClassRangeRecord; 00236 00237 00238 struct TTO_ClassDefFormat2_ 00239 { 00240 FT_UShort ClassRangeCount; 00241 /* number of ClassRangeRecords */ 00242 TTO_ClassRangeRecord* ClassRangeRecord; 00243 /* array of ClassRangeRecords */ 00244 }; 00245 00246 typedef struct TTO_ClassDefFormat2_ TTO_ClassDefFormat2; 00247 00248 00249 /* The `Defined' field is not defined in the TTO specification but 00250 apparently needed for processing fonts like trado.ttf: This font 00251 refers to a class which contains not a single element. We map such 00252 classes to class 0. */ 00253 00254 struct TTO_ClassDefinition_ 00255 { 00256 FT_Bool loaded; 00257 00258 FT_Bool* Defined; /* array of Booleans. 00259 If Defined[n] is FALSE, 00260 class n contains no glyphs. */ 00261 FT_UShort ClassFormat; /* 1 or 2 */ 00262 00263 union 00264 { 00265 TTO_ClassDefFormat1 cd1; 00266 TTO_ClassDefFormat2 cd2; 00267 } cd; 00268 }; 00269 00270 typedef struct TTO_ClassDefinition_ TTO_ClassDefinition; 00271 00272 00273 struct TTO_Device_ 00274 { 00275 FT_UShort StartSize; /* smallest size to correct */ 00276 FT_UShort EndSize; /* largest size to correct */ 00277 FT_UShort DeltaFormat; /* DeltaValue array data format: 00278 1, 2, or 3 */ 00279 FT_UShort* DeltaValue; /* array of compressed data */ 00280 }; 00281 00282 typedef struct TTO_Device_ TTO_Device; 00283 00284 00285 #include "otlbuffer.h" 00286 #include "ftxgdef.h" 00287 #include "ftxgsub.h" 00288 #include "ftxgpos.h" 00289 00290 00291 struct TTO_SubTable_ 00292 { 00293 union 00294 { 00295 TTO_GSUB_SubTable gsub; 00296 TTO_GPOS_SubTable gpos; 00297 } st; 00298 }; 00299 00300 00301 enum TTO_Type_ 00302 { 00303 GSUB, 00304 GPOS 00305 }; 00306 00307 typedef enum TTO_Type_ TTO_Type; 00308 00309 00310 #ifdef __cplusplus 00311 } 00312 #endif 00313 00314 #endif /* FTXOPEN_H */ 00315 00316 00317 /* END */