/* Functions for function pointer in local graphic state */ F26Dot6 fnt_GetCVTEntryFast(fnt_LocalGraphicStateType* gs, ArrayIndex n) { if (IS_BAD_CVT_INDEX(gs, n)) { FatalInterpreterError(gs, interp_font_program_error); } return gs->globalGS->controlValueTable[n]; }
/* * Internal function for fnt_IF(), and fnt_FDEF() */ void fnt_SkipPushCrap(register fnt_LocalGraphicStateType *gs) { register tt_uint8 opCode = gs->opCode; register tt_uint8* instr = gs->insPtr; register ArrayIndex count = 0; if ( opCode == NPUSHB_CODE ) { count = (ArrayIndex)*instr++; instr += count; } else if ( opCode == NPUSHW_CODE ) { count = (ArrayIndex)*instr++; instr += count + count; } else if ( opCode >= PUSHB_START && opCode <= PUSHB_END ) { count = (ArrayIndex)(opCode - PUSHB_START + 1); instr += count; } else if ( opCode >= PUSHW_START && opCode <= PUSHW_END ) { count = (ArrayIndex)(opCode - PUSHW_START + 1); instr += count + count; } if (count < 0 || IS_BAD_INSTR_POINTER(gs, instr)) { FatalInterpreterError(gs, interp_font_program_error); } gs->insPtr = instr; }
void fnt_ChangeCvt(fnt_LocalGraphicStateType* gs, fnt_ElementType* elem, ArrayIndex number, F26Dot6 delta) { if (IS_BAD_CVT_INDEX(gs, number)) { FatalInterpreterError(gs, interp_font_program_error); } CHECK_CVT_WRITE(gs, number, gs->globalGS->controlValueTable[number] + delta); gs->globalGS->controlValueTable[number] += delta; }
F26Dot6 fnt_GetCVTEntrySlow(register fnt_LocalGraphicStateType *gs, ArrayIndex n) { register fixed scale; if (IS_BAD_CVT_INDEX(gs, n)) { FatalInterpreterError(gs, interp_font_program_error); } scale = fnt_GetCVTScale( gs ); return ( FixedMultiply( gs->globalGS->controlValueTable[ n ], scale ) ); }
/* * For use when the projection and freedom vectors coincide along the y-axis. */ void fnt_YMovePoint( fnt_LocalGraphicStateType* gs, register fnt_ElementType *element, ArrayIndex gxPoint, F26Dot6 delta ) { #ifndef debugging /*#pragma unused(gs) */ #endif if (IS_BAD_POINT(gs, element, gxPoint)) { FatalInterpreterError(gs, interp_range_error); } element->y[gxPoint] += delta; element->f[gxPoint] |= YMOVED; }
/* * Moves the gxPoint in element by delta (measured against the projection vector) * along the freedom vector. */ void fnt_MovePoint(register fnt_LocalGraphicStateType *gs, register fnt_ElementType *element, register ArrayIndex gxPoint, register F26Dot6 delta) { register shortFrac pfProj = gs->pfProj; register shortFrac fx = gs->free.x; register shortFrac fy = gs->free.y; CHECK_PFPROJ( gs ); if (IS_BAD_POINT(gs, element, gxPoint)) { FatalInterpreterError(gs, interp_range_error); } if ( pfProj != shortFrac1 ) { if ( fx ) { element->x[gxPoint] += ShortMulDiv( delta, fx, pfProj ); element->f[gxPoint] |= XMOVED; } if ( fy ) { element->y[gxPoint] += ShortMulDiv( delta, fy, pfProj ); element->f[gxPoint] |= YMOVED; } } else { if ( fx ) { element->x[gxPoint] += ShortFracMul( delta, fx ); element->f[gxPoint] |= XMOVED; } if ( fy ) { element->y[gxPoint] += ShortFracMul( delta, fy ); element->f[gxPoint] |= YMOVED; } } }
/* * Illegal instruction panic */ void fnt_IllegalInstruction(register fnt_LocalGraphicStateType *gs) { FatalInterpreterError(gs, interp_unimplemented_instruction_error); }