00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __TTINTERP_H__
00020 #define __TTINTERP_H__
00021
00022 #include <ft2build.h>
00023 #include "ttobjs.h"
00024
00025
00026 FT_BEGIN_HEADER
00027
00028
00029 #ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER
00030
00031 #define EXEC_OP_ TT_ExecContext exc,
00032 #define EXEC_OP TT_ExecContext exc
00033 #define EXEC_ARG_ exc,
00034 #define EXEC_ARG exc
00035
00036 #else
00037
00038 #define EXEC_OP_
00039 #define EXEC_OP
00040 #define EXEC_ARG_
00041 #define EXEC_ARG
00042
00043 #endif
00044
00045
00046
00047
00048
00049
00050 #define TT_Round_Off 5
00051 #define TT_Round_To_Half_Grid 0
00052 #define TT_Round_To_Grid 1
00053 #define TT_Round_To_Double_Grid 2
00054 #define TT_Round_Up_To_Grid 4
00055 #define TT_Round_Down_To_Grid 3
00056 #define TT_Round_Super 6
00057 #define TT_Round_Super_45 7
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 typedef FT_F26Dot6
00070 (*TT_Round_Func)( EXEC_OP_ FT_F26Dot6 distance,
00071 FT_F26Dot6 compensation );
00072
00073
00074 typedef void
00075 (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone,
00076 FT_UShort point,
00077 FT_F26Dot6 distance );
00078
00079
00080 typedef FT_F26Dot6
00081 (*TT_Project_Func)( EXEC_OP_ FT_Pos dx,
00082 FT_Pos dy );
00083
00084
00085 typedef FT_F26Dot6
00086 (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx );
00087
00088
00089
00090 typedef void
00091 (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx,
00092 FT_F26Dot6 value );
00093
00094
00095
00096
00097
00098
00099 typedef struct TT_CallRec_
00100 {
00101 FT_Int Caller_Range;
00102 FT_Long Caller_IP;
00103 FT_Long Cur_Count;
00104 FT_Long Cur_Restart;
00105
00106 } TT_CallRec, *TT_CallStack;
00107
00108
00109
00110
00111
00112
00113
00114 typedef struct TT_ExecContextRec_
00115 {
00116 TT_Face face;
00117 TT_Size size;
00118 FT_Memory memory;
00119
00120
00121
00122 FT_Error error;
00123
00124 FT_Long top;
00125
00126 FT_UInt stackSize;
00127 FT_Long* stack;
00128
00129 FT_Long args;
00130 FT_UInt new_top;
00131
00132 TT_GlyphZoneRec zp0,
00133 zp1,
00134 zp2,
00135 pts,
00136 twilight;
00137
00138 FT_Size_Metrics metrics;
00139 TT_Size_Metrics tt_metrics;
00140
00141 TT_GraphicsState GS;
00142
00143 FT_Int curRange;
00144 FT_Byte* code;
00145 FT_Long IP;
00146 FT_Long codeSize;
00147
00148 FT_Byte opcode;
00149 FT_Int length;
00150
00151 FT_Bool step_ins;
00152
00153 FT_Long cvtSize;
00154 FT_Long* cvt;
00155
00156 FT_UInt glyphSize;
00157 FT_Byte* glyphIns;
00158
00159 FT_UInt numFDefs;
00160 FT_UInt maxFDefs;
00161 TT_DefArray FDefs;
00162
00163 FT_UInt numIDefs;
00164 FT_UInt maxIDefs;
00165 TT_DefArray IDefs;
00166
00167 FT_UInt maxFunc;
00168 FT_UInt maxIns;
00169
00170 FT_Int callTop,
00171 callSize;
00172 TT_CallStack callStack;
00173
00174 FT_UShort maxPoints;
00175 FT_Short maxContours;
00176
00177
00178 TT_CodeRangeTable codeRangeTable;
00179
00180
00181 FT_UShort storeSize;
00182 FT_Long* storage;
00183
00184 FT_F26Dot6 period;
00185 FT_F26Dot6 phase;
00186 FT_F26Dot6 threshold;
00187
00188 #if 0
00189
00190 FT_Int cur_ppem;
00191 #endif
00192
00193 FT_Bool instruction_trap;
00194
00195
00196 TT_GraphicsState default_GS;
00197
00198 FT_Bool is_composite;
00199 FT_Bool pedantic_hinting;
00200
00201
00202
00203 FT_Long F_dot_P;
00204
00205 TT_Round_Func func_round;
00206
00207 TT_Project_Func func_project,
00208 func_dualproj,
00209 func_freeProj;
00210
00211 TT_Move_Func func_move;
00212 TT_Move_Func func_move_orig;
00213
00214 TT_Get_CVT_Func func_read_cvt;
00215 TT_Set_CVT_Func func_write_cvt;
00216 TT_Set_CVT_Func func_move_cvt;
00217
00218 FT_Bool grayscale;
00219
00220 } TT_ExecContextRec;
00221
00222
00223 extern const TT_GraphicsState tt_default_graphics_state;
00224
00225
00226 FT_LOCAL( FT_Error )
00227 TT_Goto_CodeRange( TT_ExecContext exec,
00228 FT_Int range,
00229 FT_Long IP );
00230
00231 FT_LOCAL( FT_Error )
00232 TT_Set_CodeRange( TT_ExecContext exec,
00233 FT_Int range,
00234 void* base,
00235 FT_Long length );
00236
00237 FT_LOCAL( FT_Error )
00238 TT_Clear_CodeRange( TT_ExecContext exec,
00239 FT_Int range );
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261 FT_EXPORT( TT_ExecContext )
00262 TT_New_Context( TT_Driver driver );
00263
00264 FT_LOCAL( FT_Error )
00265 TT_Done_Context( TT_ExecContext exec );
00266
00267 FT_LOCAL( FT_Error )
00268 TT_Load_Context( TT_ExecContext exec,
00269 TT_Face face,
00270 TT_Size size );
00271
00272 FT_LOCAL( FT_Error )
00273 TT_Save_Context( TT_ExecContext exec,
00274 TT_Size ins );
00275
00276 FT_LOCAL( FT_Error )
00277 TT_Run_Context( TT_ExecContext exec,
00278 FT_Bool debug );
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302 FT_EXPORT( FT_Error )
00303 TT_RunIns( TT_ExecContext exec );
00304
00305
00306 FT_END_HEADER
00307
00308 #endif
00309
00310
00311