| 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-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010 by */ | 7 /* Copyright 1996-2007, 2010, 2012-2013 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 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 { | 100 { |
| 101 FT_Int Caller_Range; | 101 FT_Int Caller_Range; |
| 102 FT_Long Caller_IP; | 102 FT_Long Caller_IP; |
| 103 FT_Long Cur_Count; | 103 FT_Long Cur_Count; |
| 104 FT_Long Cur_Restart; | 104 FT_Long Cur_Restart; |
| 105 FT_Long Cur_End; | 105 FT_Long Cur_End; |
| 106 | 106 |
| 107 } TT_CallRec, *TT_CallStack; | 107 } TT_CallRec, *TT_CallStack; |
| 108 | 108 |
| 109 | 109 |
| 110 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING |
| 111 |
| 112 /*************************************************************************/ |
| 113 /* */ |
| 114 /* These structures define rules used to tweak subpixel hinting for */ |
| 115 /* various fonts. "", 0, "", NULL value indicates to match any value. */ |
| 116 /* */ |
| 117 |
| 118 #define SPH_MAX_NAME_SIZE 32 |
| 119 #define SPH_MAX_CLASS_MEMBERS 100 |
| 120 |
| 121 typedef struct SPH_TweakRule_ |
| 122 { |
| 123 const char family[SPH_MAX_NAME_SIZE]; |
| 124 const FT_UInt ppem; |
| 125 const char style[SPH_MAX_NAME_SIZE]; |
| 126 const FT_ULong glyph; |
| 127 |
| 128 } SPH_TweakRule; |
| 129 |
| 130 |
| 131 typedef struct SPH_ScaleRule_ |
| 132 { |
| 133 const char family[SPH_MAX_NAME_SIZE]; |
| 134 const FT_UInt ppem; |
| 135 const char style[SPH_MAX_NAME_SIZE]; |
| 136 const FT_ULong glyph; |
| 137 const FT_ULong scale; |
| 138 |
| 139 } SPH_ScaleRule; |
| 140 |
| 141 |
| 142 typedef struct SPH_Font_Class_ |
| 143 { |
| 144 const char name[SPH_MAX_NAME_SIZE]; |
| 145 const char member[SPH_MAX_CLASS_MEMBERS][SPH_MAX_NAME_SIZE]; |
| 146 |
| 147 } SPH_Font_Class; |
| 148 |
| 149 #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ |
| 150 |
| 151 |
| 110 /*************************************************************************/ | 152 /*************************************************************************/ |
| 111 /* */ | 153 /* */ |
| 112 /* The main structure for the interpreter which collects all necessary */ | 154 /* The main structure for the interpreter which collects all necessary */ |
| 113 /* variables and states. */ | 155 /* variables and states. */ |
| 114 /* */ | 156 /* */ |
| 115 typedef struct TT_ExecContextRec_ | 157 typedef struct TT_ExecContextRec_ |
| 116 { | 158 { |
| 117 TT_Face face; | 159 TT_Face face; |
| 118 TT_Size size; | 160 TT_Size size; |
| 119 FT_Memory memory; | 161 FT_Memory memory; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 253 |
| 212 TT_Move_Func func_move; /* current point move function */ | 254 TT_Move_Func func_move; /* current point move function */ |
| 213 TT_Move_Func func_move_orig; /* move original position function */ | 255 TT_Move_Func func_move_orig; /* move original position function */ |
| 214 | 256 |
| 215 TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ | 257 TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ |
| 216 TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ | 258 TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ |
| 217 TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ | 259 TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ |
| 218 | 260 |
| 219 FT_Bool grayscale; /* are we hinting for grayscale? */ | 261 FT_Bool grayscale; /* are we hinting for grayscale? */ |
| 220 | 262 |
| 263 #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING |
| 264 TT_Round_Func func_round_sphn; /* subpixel rounding function */ |
| 265 |
| 266 FT_Bool grayscale_hinting; /* Using grayscale 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 */ |
| 270 /* subpixel hinting. On if gray */ |
| 271 /* or subpixel hinting is on ) */ |
| 272 |
| 273 /* The following 4 aren't fully implemented but here for MS rasterizer */ |
| 274 /* compatibility. */ |
| 275 FT_Bool compatible_widths; /* compatible widths? */ |
| 276 FT_Bool symmetrical_smoothing; /* symmetrical_smoothing? */ |
| 277 FT_Bool bgr; /* bgr instead of rgb? */ |
| 278 FT_Bool subpixel_positioned; /* subpixel positioned */ |
| 279 /* (DirectWrite ClearType)? */ |
| 280 |
| 281 FT_Int rasterizer_version; /* MS rasterizer version */ |
| 282 |
| 283 FT_Bool iup_called; /* IUP called for glyph? */ |
| 284 |
| 285 FT_ULong sph_tweak_flags; /* flags to control */ |
| 286 /* hint tweaks */ |
| 287 |
| 288 FT_ULong sph_in_func_flags; /* flags to indicate if in */ |
| 289 /* special functions */ |
| 290 |
| 291 #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ |
| 292 |
| 221 } TT_ExecContextRec; | 293 } TT_ExecContextRec; |
| 222 | 294 |
| 223 | 295 |
| 224 extern const TT_GraphicsState tt_default_graphics_state; | 296 extern const TT_GraphicsState tt_default_graphics_state; |
| 225 | 297 |
| 226 | 298 |
| 299 #ifdef TT_USE_BYTECODE_INTERPRETER |
| 227 FT_LOCAL( FT_Error ) | 300 FT_LOCAL( FT_Error ) |
| 228 TT_Goto_CodeRange( TT_ExecContext exec, | 301 TT_Goto_CodeRange( TT_ExecContext exec, |
| 229 FT_Int range, | 302 FT_Int range, |
| 230 FT_Long IP ); | 303 FT_Long IP ); |
| 231 | 304 |
| 232 FT_LOCAL( FT_Error ) | 305 FT_LOCAL( FT_Error ) |
| 233 TT_Set_CodeRange( TT_ExecContext exec, | 306 TT_Set_CodeRange( TT_ExecContext exec, |
| 234 FT_Int range, | 307 FT_Int range, |
| 235 void* base, | 308 void* base, |
| 236 FT_Long length ); | 309 FT_Long length ); |
| 237 | 310 |
| 238 FT_LOCAL( FT_Error ) | 311 FT_LOCAL( FT_Error ) |
| 239 TT_Clear_CodeRange( TT_ExecContext exec, | 312 TT_Clear_CodeRange( TT_ExecContext exec, |
| 240 FT_Int range ); | 313 FT_Int range ); |
| 241 | 314 |
| 242 | 315 |
| 243 FT_LOCAL( FT_Error ) | 316 FT_LOCAL( FT_Error ) |
| 244 Update_Max( FT_Memory memory, | 317 Update_Max( FT_Memory memory, |
| 245 FT_ULong* size, | 318 FT_ULong* size, |
| 246 FT_Long multiplier, | 319 FT_Long multiplier, |
| 247 void* _pbuff, | 320 void* _pbuff, |
| 248 FT_ULong new_max ); | 321 FT_ULong new_max ); |
| 322 #endif /* TT_USE_BYTECODE_INTERPRETER */ |
| 249 | 323 |
| 250 | 324 |
| 251 /*************************************************************************/ | 325 /*************************************************************************/ |
| 252 /* */ | 326 /* */ |
| 253 /* <Function> */ | 327 /* <Function> */ |
| 254 /* TT_New_Context */ | 328 /* TT_New_Context */ |
| 255 /* */ | 329 /* */ |
| 256 /* <Description> */ | 330 /* <Description> */ |
| 257 /* Queries the face context for a given font. Note that there is */ | 331 /* Queries the face context for a given font. Note that there is */ |
| 258 /* now a _single_ execution context in the TrueType driver which is */ | 332 /* now a _single_ execution context in the TrueType driver which is */ |
| 259 /* shared among faces. */ | 333 /* shared among faces. */ |
| 260 /* */ | 334 /* */ |
| 261 /* <Input> */ | 335 /* <Input> */ |
| 262 /* face :: A handle to the source face object. */ | 336 /* face :: A handle to the source face object. */ |
| 263 /* */ | 337 /* */ |
| 264 /* <Return> */ | 338 /* <Return> */ |
| 265 /* A handle to the execution context. Initialized for `face'. */ | 339 /* A handle to the execution context. Initialized for `face'. */ |
| 266 /* */ | 340 /* */ |
| 267 /* <Note> */ | 341 /* <Note> */ |
| 268 /* Only the glyph loader and debugger should call this function. */ | 342 /* Only the glyph loader and debugger should call this function. */ |
| 269 /* */ | 343 /* */ |
| 270 FT_EXPORT( TT_ExecContext ) | 344 FT_EXPORT( TT_ExecContext ) |
| 271 TT_New_Context( TT_Driver driver ); | 345 TT_New_Context( TT_Driver driver ); |
| 272 | 346 |
| 347 |
| 348 #ifdef TT_USE_BYTECODE_INTERPRETER |
| 273 FT_LOCAL( FT_Error ) | 349 FT_LOCAL( FT_Error ) |
| 274 TT_Done_Context( TT_ExecContext exec ); | 350 TT_Done_Context( TT_ExecContext exec ); |
| 275 | 351 |
| 276 FT_LOCAL( FT_Error ) | 352 FT_LOCAL( FT_Error ) |
| 277 TT_Load_Context( TT_ExecContext exec, | 353 TT_Load_Context( TT_ExecContext exec, |
| 278 TT_Face face, | 354 TT_Face face, |
| 279 TT_Size size ); | 355 TT_Size size ); |
| 280 | 356 |
| 281 FT_LOCAL( FT_Error ) | 357 FT_LOCAL( FT_Error ) |
| 282 TT_Save_Context( TT_ExecContext exec, | 358 TT_Save_Context( TT_ExecContext exec, |
| 283 TT_Size ins ); | 359 TT_Size ins ); |
| 284 | 360 |
| 285 FT_LOCAL( FT_Error ) | 361 FT_LOCAL( FT_Error ) |
| 286 TT_Run_Context( TT_ExecContext exec, | 362 TT_Run_Context( TT_ExecContext exec, |
| 287 FT_Bool debug ); | 363 FT_Bool debug ); |
| 364 #endif /* TT_USE_BYTECODE_INTERPRETER */ |
| 288 | 365 |
| 289 | 366 |
| 290 /*************************************************************************/ | 367 /*************************************************************************/ |
| 291 /* */ | 368 /* */ |
| 292 /* <Function> */ | 369 /* <Function> */ |
| 293 /* TT_RunIns */ | 370 /* TT_RunIns */ |
| 294 /* */ | 371 /* */ |
| 295 /* <Description> */ | 372 /* <Description> */ |
| 296 /* Executes one or more instruction in the execution context. This */ | 373 /* Executes one or more instruction in the execution context. This */ |
| 297 /* is the main function of the TrueType opcode interpreter. */ | 374 /* is the main function of the TrueType opcode interpreter. */ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 311 FT_EXPORT( FT_Error ) | 388 FT_EXPORT( FT_Error ) |
| 312 TT_RunIns( TT_ExecContext exec ); | 389 TT_RunIns( TT_ExecContext exec ); |
| 313 | 390 |
| 314 | 391 |
| 315 FT_END_HEADER | 392 FT_END_HEADER |
| 316 | 393 |
| 317 #endif /* __TTINTERP_H__ */ | 394 #endif /* __TTINTERP_H__ */ |
| 318 | 395 |
| 319 | 396 |
| 320 /* END */ | 397 /* END */ |
| OLD | NEW |