OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ttinterp.h */ | 3 /* ttinterp.h */ |
4 /* */ | 4 /* */ |
5 /* TrueType bytecode interpreter (specification). */ | 5 /* TrueType bytecode interpreter (specification). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 1996-2007, 2010, 2012-2013 by */ | 7 /* Copyright 1996-2007, 2010, 2012-2014 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
15 /* */ | 15 /* */ |
16 /***************************************************************************/ | 16 /***************************************************************************/ |
17 | 17 |
18 | 18 |
19 #ifndef __TTINTERP_H__ | 19 #ifndef __TTINTERP_H__ |
20 #define __TTINTERP_H__ | 20 #define __TTINTERP_H__ |
21 | 21 |
22 #include "../../include/ft2build.h" | 22 #include <ft2build.h> |
23 #include "ttobjs.h" | 23 #include "ttobjs.h" |
24 | 24 |
25 | 25 |
26 FT_BEGIN_HEADER | 26 FT_BEGIN_HEADER |
27 | 27 |
28 | 28 |
29 #ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */ | 29 #ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */ |
30 | 30 |
31 #define EXEC_OP_ TT_ExecContext exc, | 31 #define EXEC_OP_ TT_ExecContext exc, |
32 #define EXEC_OP TT_ExecContext exc | 32 #define EXEC_OP TT_ExecContext exc |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 typedef void | 74 typedef void |
75 (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone, | 75 (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone, |
76 FT_UShort point, | 76 FT_UShort point, |
77 FT_F26Dot6 distance ); | 77 FT_F26Dot6 distance ); |
78 | 78 |
79 /* Distance projection along one of the projection vectors */ | 79 /* Distance projection along one of the projection vectors */ |
80 typedef FT_F26Dot6 | 80 typedef FT_F26Dot6 |
81 (*TT_Project_Func)( EXEC_OP_ FT_Pos dx, | 81 (*TT_Project_Func)( EXEC_OP_ FT_Pos dx, |
82 FT_Pos dy ); | 82 FT_Pos dy ); |
83 | 83 |
| 84 /* getting current ppem. Take care of non-square pixels if necessary */ |
| 85 typedef FT_Long |
| 86 (*TT_Cur_Ppem_Func)( EXEC_OP ); |
| 87 |
84 /* reading a cvt value. Take care of non-square pixels if necessary */ | 88 /* reading a cvt value. Take care of non-square pixels if necessary */ |
85 typedef FT_F26Dot6 | 89 typedef FT_F26Dot6 |
86 (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx ); | 90 (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx ); |
87 | 91 |
88 /* setting or moving a cvt value. Take care of non-square pixels */ | 92 /* setting or moving a cvt value. Take care of non-square pixels */ |
89 /* if necessary */ | 93 /* if necessary */ |
90 typedef void | 94 typedef void |
91 (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx, | 95 (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx, |
92 FT_F26Dot6 value ); | 96 FT_F26Dot6 value ); |
93 | 97 |
94 | 98 |
95 /*************************************************************************/ | 99 /*************************************************************************/ |
96 /* */ | 100 /* */ |
97 /* This structure defines a call record, used to manage function calls. */ | 101 /* This structure defines a call record, used to manage function calls. */ |
98 /* */ | 102 /* */ |
99 typedef struct TT_CallRec_ | 103 typedef struct TT_CallRec_ |
100 { | 104 { |
101 FT_Int Caller_Range; | 105 FT_Int Caller_Range; |
102 FT_Long Caller_IP; | 106 FT_Long Caller_IP; |
103 FT_Long Cur_Count; | 107 FT_Long Cur_Count; |
104 FT_Long Cur_Restart; | 108 |
105 FT_Long Cur_End; | 109 TT_DefRecord *Def; /* either FDEF or IDEF */ |
106 | 110 |
107 } TT_CallRec, *TT_CallStack; | 111 } TT_CallRec, *TT_CallStack; |
108 | 112 |
109 | 113 |
110 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING | 114 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING |
111 | 115 |
112 /*************************************************************************/ | 116 /*************************************************************************/ |
113 /* */ | 117 /* */ |
114 /* These structures define rules used to tweak subpixel hinting for */ | 118 /* These structures define rules used to tweak subpixel hinting for */ |
115 /* various fonts. "", 0, "", NULL value indicates to match any value. */ | 119 /* various fonts. "", 0, "", NULL value indicates to match any value. */ |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 TT_CodeRangeTable codeRangeTable; /* table of valid code ranges */ | 225 TT_CodeRangeTable codeRangeTable; /* table of valid code ranges */ |
222 /* useful for the debugger */ | 226 /* useful for the debugger */ |
223 | 227 |
224 FT_UShort storeSize; /* size of current storage */ | 228 FT_UShort storeSize; /* size of current storage */ |
225 FT_Long* storage; /* storage area */ | 229 FT_Long* storage; /* storage area */ |
226 | 230 |
227 FT_F26Dot6 period; /* values used for the */ | 231 FT_F26Dot6 period; /* values used for the */ |
228 FT_F26Dot6 phase; /* `SuperRounding' */ | 232 FT_F26Dot6 phase; /* `SuperRounding' */ |
229 FT_F26Dot6 threshold; | 233 FT_F26Dot6 threshold; |
230 | 234 |
231 #if 0 | |
232 /* this seems to be unused */ | |
233 FT_Int cur_ppem; /* ppem along the current proj vector */ | |
234 #endif | |
235 | |
236 FT_Bool instruction_trap; /* If `True', the interpreter will */ | 235 FT_Bool instruction_trap; /* If `True', the interpreter will */ |
237 /* exit after each instruction */ | 236 /* exit after each instruction */ |
238 | 237 |
239 TT_GraphicsState default_GS; /* graphics state resulting from */ | 238 TT_GraphicsState default_GS; /* graphics state resulting from */ |
240 /* the prep program */ | 239 /* the prep program */ |
241 FT_Bool is_composite; /* true if the glyph is composite */ | 240 FT_Bool is_composite; /* true if the glyph is composite */ |
242 FT_Bool pedantic_hinting; /* true if pedantic interpretation */ | 241 FT_Bool pedantic_hinting; /* true if pedantic interpretation */ |
243 | 242 |
244 /* latest interpreter additions */ | 243 /* latest interpreter additions */ |
245 | 244 |
246 FT_Long F_dot_P; /* dot product of freedom and projection */ | 245 FT_Long F_dot_P; /* dot product of freedom and projection */ |
247 /* vectors */ | 246 /* vectors */ |
248 TT_Round_Func func_round; /* current rounding function */ | 247 TT_Round_Func func_round; /* current rounding function */ |
249 | 248 |
250 TT_Project_Func func_project, /* current projection function */ | 249 TT_Project_Func func_project, /* current projection function */ |
251 func_dualproj, /* current dual proj. function */ | 250 func_dualproj, /* current dual proj. function */ |
252 func_freeProj; /* current freedom proj. func */ | 251 func_freeProj; /* current freedom proj. func */ |
253 | 252 |
254 TT_Move_Func func_move; /* current point move function */ | 253 TT_Move_Func func_move; /* current point move function */ |
255 TT_Move_Func func_move_orig; /* move original position function */ | 254 TT_Move_Func func_move_orig; /* move original position function */ |
256 | 255 |
| 256 TT_Cur_Ppem_Func func_cur_ppem; /* get current proj. ppem value */ |
| 257 |
257 TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ | 258 TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ |
258 TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ | 259 TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ |
259 TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ | 260 TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ |
260 | 261 |
261 FT_Bool grayscale; /* are we hinting for grayscale? */ | 262 FT_Bool grayscale; /* are we hinting for grayscale? */ |
262 | 263 |
263 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING | 264 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING |
264 TT_Round_Func func_round_sphn; /* subpixel rounding function */ | 265 TT_Round_Func func_round_sphn; /* subpixel rounding function */ |
265 | 266 |
266 FT_Bool grayscale_hinting; /* Using grayscale hinting? */ | 267 FT_Bool subpixel; /* Using subpixel hinting? */ |
267 FT_Bool subpixel_hinting; /* Using subpixel hinting? */ | |
268 FT_Bool native_hinting; /* Using native hinting? */ | |
269 FT_Bool ignore_x_mode; /* Standard rendering mode for */ | 268 FT_Bool ignore_x_mode; /* Standard rendering mode for */ |
270 /* subpixel hinting. On if gray */ | 269 /* subpixel hinting. On if gray */ |
271 /* or subpixel hinting is on ) */ | 270 /* or subpixel hinting is on. */ |
272 | 271 |
273 /* The following 4 aren't fully implemented but here for MS rasterizer */ | 272 /* The following 4 aren't fully implemented but here for MS rasterizer */ |
274 /* compatibility. */ | 273 /* compatibility. */ |
275 FT_Bool compatible_widths; /* compatible widths? */ | 274 FT_Bool compatible_widths; /* compatible widths? */ |
276 FT_Bool symmetrical_smoothing; /* symmetrical_smoothing? */ | 275 FT_Bool symmetrical_smoothing; /* symmetrical_smoothing? */ |
277 FT_Bool bgr; /* bgr instead of rgb? */ | 276 FT_Bool bgr; /* bgr instead of rgb? */ |
278 FT_Bool subpixel_positioned; /* subpixel positioned */ | 277 FT_Bool subpixel_positioned; /* subpixel positioned */ |
279 /* (DirectWrite ClearType)? */ | 278 /* (DirectWrite ClearType)? */ |
280 | 279 |
281 FT_Int rasterizer_version; /* MS rasterizer version */ | 280 FT_Int rasterizer_version; /* MS rasterizer version */ |
282 | 281 |
283 FT_Bool iup_called; /* IUP called for glyph? */ | 282 FT_Bool iup_called; /* IUP called for glyph? */ |
284 | 283 |
285 FT_ULong sph_tweak_flags; /* flags to control */ | 284 FT_ULong sph_tweak_flags; /* flags to control */ |
286 /* hint tweaks */ | 285 /* hint tweaks */ |
287 | 286 |
288 FT_ULong sph_in_func_flags; /* flags to indicate if in */ | 287 FT_ULong sph_in_func_flags; /* flags to indicate if in */ |
289 /* special functions */ | 288 /* special functions */ |
290 | 289 |
291 #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ | 290 #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ |
292 | 291 |
293 } TT_ExecContextRec; | 292 } TT_ExecContextRec; |
294 | 293 |
295 | 294 |
296 extern const TT_GraphicsState tt_default_graphics_state; | 295 extern const TT_GraphicsState tt_default_graphics_state; |
297 | 296 |
298 | 297 |
299 #ifdef TT_USE_BYTECODE_INTERPRETER | 298 #ifdef TT_USE_BYTECODE_INTERPRETER |
300 FT_LOCAL( FT_Error ) | 299 FT_LOCAL( void ) |
301 TT_Goto_CodeRange( TT_ExecContext exec, | 300 TT_Goto_CodeRange( TT_ExecContext exec, |
302 FT_Int range, | 301 FT_Int range, |
303 FT_Long IP ); | 302 FT_Long IP ); |
304 | 303 |
305 FT_LOCAL( FT_Error ) | 304 FT_LOCAL( void ) |
306 TT_Set_CodeRange( TT_ExecContext exec, | 305 TT_Set_CodeRange( TT_ExecContext exec, |
307 FT_Int range, | 306 FT_Int range, |
308 void* base, | 307 void* base, |
309 FT_Long length ); | 308 FT_Long length ); |
310 | 309 |
311 FT_LOCAL( FT_Error ) | 310 FT_LOCAL( void ) |
312 TT_Clear_CodeRange( TT_ExecContext exec, | 311 TT_Clear_CodeRange( TT_ExecContext exec, |
313 FT_Int range ); | 312 FT_Int range ); |
314 | 313 |
315 | 314 |
316 FT_LOCAL( FT_Error ) | 315 FT_LOCAL( FT_Error ) |
317 Update_Max( FT_Memory memory, | 316 Update_Max( FT_Memory memory, |
318 FT_ULong* size, | 317 FT_ULong* size, |
319 FT_Long multiplier, | 318 FT_Long multiplier, |
320 void* _pbuff, | 319 void* _pbuff, |
321 FT_ULong new_max ); | 320 FT_ULong new_max ); |
(...skipping 17 matching lines...) Expand all Loading... |
339 /* A handle to the execution context. Initialized for `face'. */ | 338 /* A handle to the execution context. Initialized for `face'. */ |
340 /* */ | 339 /* */ |
341 /* <Note> */ | 340 /* <Note> */ |
342 /* Only the glyph loader and debugger should call this function. */ | 341 /* Only the glyph loader and debugger should call this function. */ |
343 /* */ | 342 /* */ |
344 FT_EXPORT( TT_ExecContext ) | 343 FT_EXPORT( TT_ExecContext ) |
345 TT_New_Context( TT_Driver driver ); | 344 TT_New_Context( TT_Driver driver ); |
346 | 345 |
347 | 346 |
348 #ifdef TT_USE_BYTECODE_INTERPRETER | 347 #ifdef TT_USE_BYTECODE_INTERPRETER |
349 FT_LOCAL( FT_Error ) | 348 FT_LOCAL( void ) |
350 TT_Done_Context( TT_ExecContext exec ); | 349 TT_Done_Context( TT_ExecContext exec ); |
351 | 350 |
352 FT_LOCAL( FT_Error ) | 351 FT_LOCAL( FT_Error ) |
353 TT_Load_Context( TT_ExecContext exec, | 352 TT_Load_Context( TT_ExecContext exec, |
354 TT_Face face, | 353 TT_Face face, |
355 TT_Size size ); | 354 TT_Size size ); |
356 | 355 |
357 FT_LOCAL( FT_Error ) | 356 FT_LOCAL( void ) |
358 TT_Save_Context( TT_ExecContext exec, | 357 TT_Save_Context( TT_ExecContext exec, |
359 TT_Size ins ); | 358 TT_Size ins ); |
360 | 359 |
361 FT_LOCAL( FT_Error ) | 360 FT_LOCAL( FT_Error ) |
362 TT_Run_Context( TT_ExecContext exec, | 361 TT_Run_Context( TT_ExecContext exec, |
363 FT_Bool debug ); | 362 FT_Bool debug ); |
364 #endif /* TT_USE_BYTECODE_INTERPRETER */ | 363 #endif /* TT_USE_BYTECODE_INTERPRETER */ |
365 | 364 |
366 | 365 |
367 /*************************************************************************/ | 366 /*************************************************************************/ |
(...skipping 20 matching lines...) Expand all Loading... |
388 FT_EXPORT( FT_Error ) | 387 FT_EXPORT( FT_Error ) |
389 TT_RunIns( TT_ExecContext exec ); | 388 TT_RunIns( TT_ExecContext exec ); |
390 | 389 |
391 | 390 |
392 FT_END_HEADER | 391 FT_END_HEADER |
393 | 392 |
394 #endif /* __TTINTERP_H__ */ | 393 #endif /* __TTINTERP_H__ */ |
395 | 394 |
396 | 395 |
397 /* END */ | 396 /* END */ |
OLD | NEW |