📄 ttobjs.h
字号:
/***********************************************************************/ /* */ /* FreeType Instance Type */ /* */ /***********************************************************************/ struct TInstance_ { PFace owner; /* face object */ Bool valid; TIns_Metrics metrics; UShort numFDefs; /* number of function definitions */ UShort maxFDefs; PDefArray FDefs; /* table of FDefs entries */ UShort numIDefs; /* number of instruction definitions */ UShort maxIDefs; PDefArray IDefs; /* table of IDefs entries */ Int maxFunc; /* maximum function definition id */ Int maxIns; /* maximum instruction definition id */ TCodeRangeTable codeRangeTable; TGraphicsState GS; TGraphicsState default_GS; ULong cvtSize; /* the scaled control value table */ PLong cvt; ULong storeSize; /* The storage area is now part of the */ PLong storage; /* instance */ TGlyph_Zone twilight; /* The instance's twilight zone */ /* debugging variables */ /* When using the debugger, we must keep the */ /* execution context tied to the instance */ /* object rather than asking it on demand */ Bool debug; PExecution_Context context; /* a generic pointer for client use - see TT_Set/Get_Instance_Pointer */ void* generic; }; /***********************************************************************/ /* */ /* FreeType Execution Context Type */ /* */ /***********************************************************************/ struct TExecution_Context_ { PFace face; PInstance instance; /* instructions state */ TT_Error error; /* last execution error */ Long top; /* top of exec. stack */ ULong stackSize; /* size of exec. stack */ PStorage stack; /* current exec. stack */ Long args; ULong new_top; /* new top after exec. */ TGlyph_Zone zp0, /* zone records */ zp1, zp2, pts, twilight; TIns_Metrics metrics; /* instance metrics */ TGraphicsState GS; /* current graphics state */ Int curRange; /* current code range number */ PByte code; /* current code range */ ULong IP; /* current instruction pointer */ ULong codeSize; /* size of current range */ Byte opcode; /* current opcode */ Int length; /* length of current opcode */ Bool step_ins; /* true if the interpreter must */ /* increment IP after ins. exec */ ULong cvtSize; PLong cvt; ULong glyphSize; /* glyph instructions buffer size */ PByte glyphIns; /* glyph instructions buffer */ UShort numFDefs; /* number of function defs */ UShort maxFDefs; /* maximum number of function defs */ PDefRecord FDefs; /* table of FDefs entries */ UShort numIDefs; /* number of instruction defs */ UShort maxIDefs; /* maximum number of instruction defs */ PDefRecord IDefs; /* table of IDefs entries */ Int maxFunc; Int maxIns; Int callTop, /* top of call stack during execution */ callSize; /* size of call stack */ PCallStack callStack; /* call stack */ UShort maxPoints; /* capacity of this context's "pts" */ UShort maxContours; /* record, expressed in points and */ /* contours.. */ TCodeRangeTable codeRangeTable; /* table of valid coderanges */ /* useful for the debugger */ ULong storeSize; /* size of current storage */ PLong storage; /* storage area */ TT_F26Dot6 period; /* values used for the */ TT_F26Dot6 phase; /* 'SuperRounding' */ TT_F26Dot6 threshold; /* this seems to be unused */#if 0 Int cur_ppem; /* ppem along the current proj vector */#endif Long scale1; /* scaling values along the current */ Long scale2; /* projection vector too.. */ Bool cached_metrics; /* the ppem is computed lazily. used */ /* to trigger computation when needed */ Bool instruction_trap; /* If True, the interpreter will */ /* exit after each instruction */ TGraphicsState default_GS; /* graphics state resulting from */ /* the prep program */ Bool is_composite; /* ture if the glyph is composite */ Bool pedantic_hinting; /* if true, read and write array */ /* bounds faults halt the hinting */ /* latest interpreter additions */ Long F_dot_P; /* dot product of freedom and projection */ /* vectors */ TRound_Function func_round; /* current rounding function */ TProject_Function func_project, /* current projection function */ func_dualproj, /* current dual proj. function */ func_freeProj; /* current freedom proj. func */ TMove_Function func_move; /* current point move function */ TGet_CVT_Function func_read_cvt; /* read a cvt entry */ TSet_CVT_Function func_write_cvt; /* write a cvt entry (in pixels) */ TSet_CVT_Function func_move_cvt; /* incr a cvt entry (in pixels) */ ULong loadSize; PSubglyph_Stack loadStack; /* loading subglyph stack */ }; /***********************************************************************/ /* */ /* FreeType Glyph Object Type */ /* */ /***********************************************************************/ struct TGlyph_ { PFace face; TT_Big_Glyph_Metrics metrics; TT_Outline outline; }; /* The following type is used to load a font from a collection. */ /* See Face_Create in ttobjs.c */ struct TFont_Input_ { TT_Stream stream; /* input stream */ ULong fontIndex; /* index of font in collection */ PEngine_Instance engine; /* parent engine instance */ }; typedef struct TFont_Input_ TFont_Input; /********************************************************************/ /* */ /* Code Range Functions */ /* */ /********************************************************************/ /* Goto a specified coderange */ LOCAL_DEF TT_Error Goto_CodeRange( PExecution_Context exec, Int range, ULong IP );#if 0 /* Return a pointer to a given coderange record. */ /* Used only by the debugger. */ LOCAL_DEF PCodeRange Get_CodeRange( PExecution_Context exec, Int range );#endif /* Set a given code range properties */ LOCAL_DEF TT_Error Set_CodeRange( PExecution_Context exec, Int range, void* base, ULong length ); /* Clear a given coderange */ LOCAL_DEF TT_Error Clear_CodeRange( PExecution_Context exec, Int range ); LOCAL_DEF PExecution_Context New_Context( PFace face ); LOCAL_DEF TT_Error Done_Context( PExecution_Context exec ); LOCAL_DEF TT_Error Context_Load( PExecution_Context exec, PFace face, PInstance ins ); LOCAL_DEF TT_Error Context_Save( PExecution_Context exec, PInstance ins ); LOCAL_DEF TT_Error Context_Run( PExecution_Context exec, Bool debug ); LOCAL_DEF TT_Error Instance_Init( PInstance ins ); LOCAL_DEF TT_Error Instance_Reset( PInstance ins ); /********************************************************************/ /* */ /* Handy scaling functions */ /* */ /********************************************************************/ LOCAL_DEF TT_Pos Scale_X( PIns_Metrics metrics, TT_Pos x ); LOCAL_DEF TT_Pos Scale_Y( PIns_Metrics metrics, TT_Pos y ); /********************************************************************/ /* */ /* Component Initializer/Finalizer */ /* */ /* Called from 'freetype.c' */ /* The component must create and register the face, instance and */ /* execution context cache classes before any object can be */ /* managed. */ /* */ /********************************************************************/ LOCAL_DEF TT_Error TTObjs_Init( PEngine_Instance engine ); LOCAL_DEF TT_Error TTObjs_Done( PEngine_Instance engine );#ifdef __cplusplus }#endif#endif /* TTOBJS_H *//* END */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -