Home | History | Annotate | Download | only in truetype

Lines Matching refs:CUR

64   /*    context is named `cur'.                                            */
95 #define CUR (*exc) /* see ttobjs.h */
106 #define CUR cur
111 TT_ExecContextRec cur; /* static exec. context variable */
114 /* the static `cur', which makes the code bigger (due to all the */
136 ( ((TT_Driver)FT_FACE_DRIVER( CUR.face ))->interpreter_version == \
167 CUR.func_move( EXEC_ARG_ z, p, d )
170 CUR.func_move_orig( EXEC_ARG_ z, p, d )
173 CUR.func_round( EXEC_ARG_ d, c )
176 CUR.func_read_cvt( EXEC_ARG_ index )
179 CUR.func_write_cvt( EXEC_ARG_ index, val )
182 CUR.func_move_cvt( EXEC_ARG_ index, val )
210 CUR.func_project( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
213 CUR.func_dualproj( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
216 CUR.func_project( EXEC_ARG_ (v)->x, (v)->y )
219 CUR.func_dualproj( EXEC_ARG_ (v)->x, (v)->y )
252 if ( CUR.face->unpatented_hinting ) \
254 CUR.GS.V.x = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0x4000 : 0 ); \
255 CUR.GS.V.y = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0 : 0x4000 ); \
1673 if ( !CUR.tt_metrics.ratio )
1676 if ( CUR.face->unpatented_hinting )
1678 if ( CUR.GS.both_x_axis )
1679 CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;
1681 CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;
1686 if ( CUR.GS.projVector.y == 0 )
1687 CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;
1689 else if ( CUR.GS.projVector.x == 0 )
1690 CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;
1697 x = TT_MulFix14( CUR.tt_metrics.x_ratio,
1698 CUR.GS.projVector.x );
1699 y = TT_MulFix14( CUR.tt_metrics.y_ratio,
1700 CUR.GS.projVector.y );
1701 CUR.tt_metrics.ratio = FT_Hypot( x, y );
1705 return CUR.tt_metrics.ratio;
1712 return FT_MulFix( CUR.tt_metrics.ppem, CURRENT_Ratio() );
1726 return CUR.cvt[idx];
1733 return FT_MulFix( CUR.cvt[idx], CURRENT_Ratio() );
1741 CUR.cvt[idx] = value;
1749 CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() );
1757 CUR.cvt[idx] += value;
1765 CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() );
1788 CUR.IP += 2;
1789 return (FT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) +
1790 CUR.code[CUR.IP - 1] );
1819 CUR.error = FT_THROW( Bad_Argument );
1823 range = &CUR.codeRangeTable[aRange - 1];
1827 CUR.error = FT_THROW( Invalid_CodeRange );
1837 CUR.error = FT_THROW( Code_Overflow );
1841 CUR.code = range->base;
1842 CUR.codeSize = range->size;
1843 CUR.IP = aIP;
1844 CUR.curRange = aRange;
1876 CUR.face->unpatented_hinting );
1879 v = CUR.GS.freeVector.x;
1885 ( !CUR.ignore_x_mode ||
1886 ( CUR.sph_tweak_flags & SPH_TWEAK_ALLOW_X_DMOVE ) ) )
1888 zone->cur[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );
1893 v = CUR.GS.freeVector.y;
1897 zone->cur[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );
1930 FT_ASSERT( !CUR.face->unpatented_hinting );
1933 v = CUR.GS.freeVector.x;
1936 zone->org[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );
1938 v = CUR.GS.freeVector.y;
1941 zone->org[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );
1964 !CUR.ignore_x_mode )
1966 zone->cur[point].x += distance;
1979 zone->cur[point].y += distance;
2312 val = ( distance - CUR.phase + CUR.threshold + compensation ) &
2313 -CUR.period;
2316 val += CUR.phase;
2320 val = -( ( CUR.threshold - CUR.phase - distance + compensation ) &
2321 -CUR.period );
2324 val -= CUR.phase;
2360 val = ( ( distance - CUR.phase + CUR.threshold + compensation ) /
2361 CUR.period ) * CUR.period;
2364 val += CUR.phase;
2368 val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) /
2369 CUR.period ) * CUR.period );
2372 val -= CUR.phase;
2396 CUR.func_round = (TT_Round_Func)Round_None;
2400 CUR.func_round = (TT_Round_Func)Round_To_Grid;
2404 CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;
2408 CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;
2412 CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;
2416 CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;
2420 CUR.func_round = (TT_Round_Func)Round_Super;
2424 CUR.func_round = (TT_Round_Func)Round_Super_45;
2450 CUR.period = GridPeriod / 2;
2454 CUR.period = GridPeriod;
2458 CUR.period = GridPeriod * 2;
2464 CUR.period = GridPeriod;
2471 CUR.phase = 0;
2475 CUR.phase = CUR.period / 4;
2479 CUR.phase = CUR.period / 2;
2483 CUR.phase = CUR.period * 3 / 4;
2488 CUR.threshold = CUR.period - 1;
2490 CUR.threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8;
2492 CUR.period /= 256;
2493 CUR.phase /= 256;
2494 CUR.threshold /= 256;
2519 FT_ASSERT( !CUR.face->unpatented_hinting );
2523 CUR.GS.projVector.x,
2524 CUR.GS.projVector.y );
2549 CUR.GS.dualVector.x,
2550 CUR.GS.dualVector.y );
2621 if ( CUR.face->unpatented_hinting )
2627 CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 &&
2628 CUR.GS.freeVector.x == 0x4000 );
2633 CUR.GS.projVector.x = 0;
2634 CUR.GS.projVector.y = 0;
2635 CUR.GS.freeVector.x = 0;
2636 CUR.GS.freeVector.y = 0;
2638 if ( CUR.GS.both_x_axis )
2640 CUR.func_project = Project_x;
2641 CUR.func_move = Direct_Move_X;
2642 CUR.func_move_orig = Direct_Move_Orig_X;
2646 CUR.func_project = Project_y;
2647 CUR.func_move = Direct_Move_Y;
2648 CUR.func_move_orig = Direct_Move_Orig_Y;
2651 if ( CUR.GS.dualVector.x == 0x4000 )
2652 CUR.func_dualproj = Project_x;
2653 else if ( CUR.GS.dualVector.y == 0x4000 )
2654 CUR.func_dualproj = Project_y;
2656 CUR.func_dualproj = Dual_Project;
2659 CUR.tt_metrics.ratio = 0;
2665 if ( CUR.GS.freeVector.x == 0x4000 )
2666 CUR.F_dot_P = CUR.GS.projVector.x;
2667 else if ( CUR.GS.freeVector.y == 0x4000 )
2668 CUR.F_dot_P = CUR.GS.projVector.y;
2670 CUR.F_dot_P = ( (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x +
2671 (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y ) >>
2674 if ( CUR.GS.projVector.x == 0x4000 )
2675 CUR.func_project = (TT_Project_Func)Project_x;
2676 else if ( CUR.GS.projVector.y == 0x4000 )
2677 CUR.func_project = (TT_Project_Func)Project_y;
2679 CUR.func_project = (TT_Project_Func)Project;
2681 CUR.GS.dualVector.x == 0x4000 )
2682 CUR.func_dualproj = (TT_Project_Func)Project_x;
2683 else if ( CUR.GS.dualVector.y == 0x4000 )
2684 CUR.func_dualproj = (TT_Project_Func)Project_y;
2686 CUR.func_dualproj = (TT_Project_Func)Dual_Project;
2688 CUR.func_move = (TT_Move_Func)Direct_Move;
2689 CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig;
2691 if ( CUR.F_dot_P == 0x4000L )
2693 if ( CUR.GS.freeVector.x == 0x4000 )
2695 CUR.func_move = (TT_Move_Func)Direct_Move_X;
2696 CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
2698 else if ( CUR.GS.freeVector.y == 0x4000 )
2700 CUR.func_move = (TT_Move_Func)Direct_Move_Y;
2701 CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
2708 if ( FT_ABS( CUR.F_dot_P ) < 0x400L )
2709 CUR.F_dot_P = 0x4000L;
2712 CUR.tt_metrics.ratio = 0;
2788 if ( BOUNDS( aIdx1, CUR.zp2.n_points ) ||
2789 BOUNDS( aIdx2, CUR.zp1.n_points ) )
2791 if ( CUR.pedantic_hinting )
2792 CUR.error = FT_THROW( Invalid_Reference );
2796 p1 = CUR.zp1.cur + aIdx2;
2797 p2 = CUR.zp2.cur + aIdx1;
2837 A = (FT_Short)( CUR.opcode & 1 ) << 14; \
2840 CUR.GS.freeVector.x = A; \
2841 CUR.GS.projVector.x = A; \
2842 CUR.GS.dualVector.x = A; \
2844 CUR.GS.freeVector.y = B; \
2845 CUR.GS.projVector.y = B; \
2846 CUR.GS.dualVector.y = B; \
2857 A = (FT_Short)( CUR.opcode & 1 ) << 14; \
2860 CUR.GS.projVector.x = A; \
2861 CUR.GS.dualVector.x = A; \
2863 CUR.GS.projVector.y = B; \
2864 CUR.GS.dualVector.y = B; \
2877 A = (FT_Short)( CUR.opcode & 1 ) << 14; \
2880 CUR.GS.freeVector.x = A; \
2881 CUR.GS.freeVector.y = B; \
2892 CUR.opcode, \
2893 &CUR.GS.projVector ) == SUCCESS ) \
2895 CUR.GS.dualVector = CUR.GS.projVector; \
2904 CUR.opcode, \
2905 &CUR.GS.freeVector ) == SUCCESS ) \
2914 CUR.GS.freeVector = CUR.GS.projVector; \
2930 NORMalize( X, Y, &CUR.GS.projVector ); \
2932 CUR.GS.dualVector = CUR.GS.projVector; \
2950 NORMalize( X, Y, &CUR.GS.freeVector ); \
2958 if ( CUR.face->unpatented_hinting ) \
2960 args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \
2961 args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \
2965 args[0] = CUR.GS.projVector.x; \
2966 args[1] = CUR.GS.projVector.y; \
2970 args[0] = CUR.GS.projVector.x; \
2971 args[1] = CUR.GS.projVector.y;
2977 if ( CUR.face->unpatented_hinting ) \
2979 args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \
2980 args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \
2984 args[0] = CUR.GS.freeVector.x; \
2985 args[1] = CUR.GS.freeVector.y; \
2989 args[0] = CUR.GS.freeVector.x; \
2990 args[1] = CUR.GS.freeVector.y;
2995 CUR.GS.rp0 = (FT_UShort)args[0];
2999 CUR.GS.rp1 = (FT_UShort)args[0];
3003 CUR.GS.rp2 = (FT_UShort)args[0];
3007 CUR.GS.round_state = TT_Round_To_Half_Grid; \
3008 CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;
3012 CUR.GS.round_state = TT_Round_To_Grid; \
3013 CUR.func_round = (TT_Round_Func)Round_To_Grid;
3017 CUR.GS.round_state = TT_Round_To_Double_Grid; \
3018 CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;
3022 CUR.GS.round_state = TT_Round_Up_To_Grid; \
3023 CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;
3027 CUR.GS.round_state = TT_Round_Down_To_Grid; \
3028 CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;
3032 CUR.GS.round_state = TT_Round_Off; \
3033 CUR.func_round = (TT_Round_Func)Round_None;
3038 CUR.GS.round_state = TT_Round_Super; \
3039 CUR.func_round = (TT_Round_Func)Round_Super;
3044 CUR.GS.round_state = TT_Round_Super_45; \
3045 CUR.func_round = (TT_Round_Func)Round_Super_45;
3050 CUR.error = FT_THROW( Bad_Argument ); \
3052 CUR.GS.loop = args[0];
3056 CUR.GS.minimum_distance = args[0];
3060 CUR.GS.control_value_cutin = (FT_F26Dot6)args[0];
3064 CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
3068 CUR.GS.single_width_value = FT_MulFix( args[0], \
3069 CUR.tt_metrics.scale );
3073 CUR.GS.auto_flip = TRUE;
3077 CUR.GS.auto_flip = FALSE;
3081 CUR.GS.delta_base = (FT_Short)args[0];
3085 CUR.GS.delta_shift = (FT_Short)args[0];
3100 args[0] = CUR.metrics.pointSize;
3115 CUR.new_top = 0;
3130 args[0] = CUR.top;
3140 if ( L <= 0 || L > CUR.args ) \
3142 if ( CUR.pedantic_hinting ) \
3143 CUR.error = FT_THROW( Invalid_Reference ); \
3147 args[0] = CUR.stack[CUR.args - L]; \
3154 if ( args[0] == 0 && CUR.args == 0 ) \
3155 CUR.error = FT_THROW( Bad_Argument ); \
3156 CUR.IP += args[0]; \
3157 if ( CUR
3158 ( CUR.callTop > 0 && \
3159 CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \
3160 CUR.error = FT_THROW( Bad_Argument ); \
3161 CUR.step_ins = FALSE; \
3166 if ( args[0] == 0 && CUR.args == 0 ) \
3167 CUR.error = FT_THROW( Bad_Argument ); \
3168 CUR.IP += args[0]; \
3169 if ( CUR.IP < 0 || \
3170 ( CUR.callTop > 0 && \
3171 CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \
3172 CUR.error = FT_THROW( Bad_Argument ); \
3173 CUR.step_ins = FALSE;
3179 if ( args[0] == 0 && CUR.args == 0 ) \
3180 CUR.error = FT_THROW( Bad_Argument ); \
3181 CUR.IP += args[0]; \
3182 if ( CUR.IP < 0 || \
3183 ( CUR.callTop > 0 && \
3184 CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \
3185 CUR.error = FT_THROW( Bad_Argument ); \
3186 CUR.step_ins = FALSE; \
3244 CUR.error = FT_THROW( Divide_By_Zero ); \
3275 if ( BOUNDSL( I, CUR.storeSize ) ) \
3277 if ( CUR.pedantic_hinting ) \
3288 CUR.ignore_x_mode && \
3290 ( CUR.face->sph_found_func_flags & \
3294 ( CUR.sph_in_func_flags & \
3297 ( CUR.face->sph_found_func_flags & \
3299 CUR.iup_called ) ) ) \
3302 args[0] = CUR.storage[I]; \
3313 if ( BOUNDSL( I, CUR.storeSize ) ) \
3315 if ( CUR.pedantic_hinting ) \
3323 args[0] = CUR.storage[I]; \
3334 if ( BOUNDSL( I, CUR.storeSize ) ) \
3336 if ( CUR.pedantic_hinting ) \
3342 CUR.storage[I] = args[1]; \
3351 if ( BOUNDSL( I, CUR.cvtSize ) ) \
3353 if ( CUR.pedantic_hinting ) \
3370 if ( BOUNDSL( I, CUR.cvtSize ) ) \
3372 if ( CUR.pedantic_hinting ) \
3387 if ( BOUNDSL( I, CUR.cvtSize ) ) \
3389 if ( CUR.pedantic_hinting ) \
3395 CUR.cvt[I] = FT_MulFix( args[1], CUR.tt_metrics.scale ); \
3400 CUR.error = FT_THROW( Debug_OpCode );
3406 CUR.tt_metrics.compensations[CUR.opcode - 0x68] );
3411 CUR.tt_metrics.compensations[CUR.opcode - 0x6C] );
3430 CUR.error = FT_THROW( Invalid_Reference ); \
4407 if ( L <= 0 || L > CUR.args )
4409 if ( CUR.pedantic_hinting )
4410 CUR.error = FT_THROW( Invalid_Reference );
4414 K = CUR.stack[CUR.args - L];
4416 FT_ARRAY_MOVE( &CUR.stack[CUR.args - L ],
4417 &CUR.stack[CUR.args - L + 1],
4420 CUR.stack[CUR.args - 1] = K;
4461 CUR.IP += CUR.length;
4463 if ( CUR.IP < CUR.codeSize )
4465 CUR.opcode = CUR.code[CUR.IP];
4467 CUR.length = opcode_length[CUR.opcode];
4468 if ( CUR.length < 0 )
4470 if ( CUR.IP + 1 >= CUR.codeSize )
4472 CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
4475 if ( CUR.IP + CUR.length <= CUR.codeSize )
4480 CUR.error = FT_THROW( Code_Overflow );
4509 switch ( CUR.opcode )
4549 switch ( CUR.opcode )
4689 rec = CUR.FDefs;
4690 limit = rec + CUR.numFDefs;
4702 if ( CUR.numFDefs >= CUR.maxFDefs )
4704 CUR.error = FT_THROW( Too_Many_Function_Defs );
4707 CUR.numFDefs++;
4714 CUR.error = FT_THROW( Too_Many_Function_Defs );
4718 rec->range = CUR.curRange;
4720 rec->start = CUR.IP + 1;
4725 if ( n > CUR.maxFunc )
4726 CUR.maxFunc = (FT_UInt16)n;
4748 CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )
4756 CUR.face->root.family_name,
4757 CUR.face->root.style_name ));
4763 CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_1;
4768 CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_2;
4777 CUR.face->sph_found_func_flags |= SPH_FDEF_DIAGONAL_STROKE;
4786 CUR.face->sph_found_func_flags |= SPH_FDEF_VACUFORM_ROUND_1;
4793 CUR.face->sph_found_func_flags |= SPH_FDEF_TTFAUTOHINT_1;
4806 CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_1;
4820 CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_2;
4826 CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
4832 CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
4845 CUR.face->sph_compatibility_mode =
4846 ( ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) |
4847 ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) );
4852 switch ( CUR.opcode )
4856 CUR.error = FT_THROW( Nested_DEFS );
4860 rec->end = CUR.IP;
4882 CUR.sph_in_func_flags = 0x0000;
4885 if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */
4887 CUR.error = FT_THROW( ENDF_In_Exec_Stream );
4891 CUR.callTop--;
4893 pRec = &CUR.callStack[CUR.callTop];
4897 CUR.step_ins = FALSE;
4901 CUR.callTop++;
4902 CUR.IP = pRec->Def->start;
4936 if ( BOUNDSL( F, CUR.maxFunc + 1 ) )
4943 /* CUR.maxFunc+1 == CUR.numFDefs */
4944 /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */
4948 def = CUR.FDefs + F;
4949 if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )
4955 def = CUR.FDefs;
4956 limit = def + CUR.numFDefs;
4971 CUR.ignore_x_mode &&
4972 ( ( CUR.iup_called &&
4973 ( CUR.sph_tweak_flags & SPH_TWEAK_NO_CALL_AFTER_IUP ) ) ||
4977 CUR.sph_in_func_flags = def->sph_fdef_flags;
4981 if ( CUR.callTop >= CUR.callSize )
4983 CUR.error = FT_THROW( Stack_Overflow );
4987 pCrec = CUR.callStack + CUR.callTop;
4989 pCrec->Caller_Range = CUR.curRange;
4990 pCrec->Caller_IP = CUR.IP + 1;
4994 CUR.callTop++;
4999 CUR.step_ins = FALSE;
5004 CUR.error = FT_THROW( Invalid_Reference );
5024 if ( BOUNDSL( F, CUR.maxFunc + 1 ) )
5031 /* CUR.maxFunc+1 == CUR.numFDefs */
5032 /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */
5036 def = CUR.FDefs + F;
5037 if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )
5043 def = CUR.FDefs;
5044 limit = def + CUR.numFDefs;
5059 CUR.ignore_x_mode &&
5063 CUR.sph_in_func_flags = def->sph_fdef_flags;
5067 if ( CUR.callTop >= CUR.callSize )
5069 CUR.error = FT_THROW( Stack_Overflow );
5075 pCrec = CUR.callStack + CUR.callTop;
5077 pCrec->Caller_Range = CUR.curRange;
5078 pCrec->Caller_IP = CUR.IP + 1;
5082 CUR.callTop++;
5086 CUR.step_ins = FALSE;
5092 CUR.error = FT_THROW( Invalid_Reference );
5111 def = CUR.IDefs;
5112 limit = def + CUR.numIDefs;
5121 if ( CUR.numIDefs >= CUR.maxIDefs )
5123 CUR.error = FT_THROW( Too_Many_Instruction_Defs );
5126 CUR.numIDefs++;
5132 CUR.error = FT_THROW( Too_Many_Instruction_Defs );
5137 def->start = CUR.IP + 1;
5138 def->range = CUR.curRange;
5141 if ( (FT_ULong)args[0] > CUR.maxIns )
5142 CUR.maxIns = (FT_Byte)args[0];
5149 switch ( CUR.opcode )
5153 CUR.error = FT_THROW( Nested_DEFS );
5183 L = (FT_UShort)CUR.code[CUR.IP + 1];
5185 if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
5187 CUR.error = FT_THROW( Stack_Overflow );
5192 args[K - 1] = CUR.code[CUR.IP + K + 1];
5194 CUR.new_top += L;
5210 L = (FT_UShort)CUR.code[CUR.IP + 1];
5212 if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
5214 CUR.error = FT_THROW( Stack_Overflow );
5218 CUR.IP += 2;
5223 CUR.step_ins = FALSE;
5224 CUR.new_top += L;
5240 L = (FT_UShort)( CUR.opcode - 0xB0 + 1 );
5242 if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
5244 CUR.error = FT_THROW( Stack_Overflow );
5249 args[K - 1] = CUR.code[CUR.IP + K];
5265 L = (FT_UShort)( CUR.opcode - 0xB8 + 1 );
5267 if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )
5269 CUR.error = FT_THROW( Stack_Overflow );
5273 CUR.IP++;
5278 CUR.step_ins = FALSE;
5309 if ( BOUNDSL( L, CUR.zp2.n_points ) )
5311 if ( CUR.pedantic_hinting )
5312 CUR.error = FT_THROW( Invalid_Reference );
5317 if ( CUR.opcode & 1 )
5318 R = CUR_fast_dualproj( &CUR.zp2.org[L] );
5320 R = CUR_fast_project( &CUR.zp2.cur[L] );
5346 if ( BOUNDS( L, CUR.zp2.n_points ) )
5348 if ( CUR.pedantic_hinting )
5349 CUR.error = FT_THROW( Invalid_Reference );
5353 K = CUR_fast_project( &CUR.zp2.cur[L] );
5355 CUR_Func_move( &CUR.zp2, L, args[1] - K );
5359 if ( CUR.GS.gep2 == 0 )
5360 CUR.zp2.org[L] = CUR.zp2.cur[L];
5389 if ( BOUNDS( L, CUR.zp0.n_points ) ||
5390 BOUNDS( K, CUR.zp1.n_points ) )
5392 if ( CUR.pedantic_hinting )
5393 CUR.error = FT_THROW( Invalid_Reference );
5398 if ( CUR.opcode & 1 )
5399 D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );
5404 if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
5406 FT_Vector* vec1 = CUR.zp0.org + L;
5407 FT_Vector* vec2 = CUR.zp1.org + K;
5414 FT_Vector* vec1 = CUR.zp0.orus + L;
5415 FT_Vector* vec2 = CUR.zp1.orus + K;
5418 if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
5422 D = FT_MulFix( D, CUR.metrics.x_scale );
5429 vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );
5430 vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );
5441 CUR.ignore_x_mode && FT_ABS( D ) == 64 )
5460 FT_Int aOpc = CUR.opcode;
5466 if ( BOUNDS( p2, CUR.zp1.n_points ) ||
5467 BOUNDS( p1, CUR.zp2.n_points ) )
5469 if ( CUR.pedantic_hinting )
5470 CUR.error = FT_THROW( Invalid_Reference );
5475 FT_Vector* v1 = CUR.zp1.org + p2;
5476 FT_Vector* v2 = CUR.zp2.org + p1;
5501 NORMalize( A, B, &CUR.GS.dualVector );
5504 FT_Vector* v1 = CUR.zp1.cur + p2;
5505 FT_Vector* v2 = CUR.zp2.cur + p1;
5525 NORMalize( A, B, &CUR.GS.projVector );
5545 CUR.zp0 = CUR.twilight;
5549 CUR.zp0 = CUR.pts;
5553 if ( CUR.pedantic_hinting )
5554 CUR.error = FT_THROW( Invalid_Reference );
5558 CUR.GS.gep0 = (FT_UShort)args[0];
5574 CUR.zp1 = CUR.twilight;
5578 CUR.zp1 = CUR.pts;
5582 if ( CUR.pedantic_hinting )
5583 CUR.error = FT_THROW( Invalid_Reference );
5587 CUR.GS.gep1 = (FT_UShort)args[0];
5603 CUR.zp2 = CUR.twilight;
5607 CUR.zp2 = CUR.pts;
5611 if ( CUR.pedantic_hinting )
5612 CUR.error = FT_THROW( Invalid_Reference );
5616 CUR.GS.gep2 = (FT_UShort)args[0];
5632 CUR.zp0 = CUR.twilight;
5636 CUR.zp0 = CUR.pts;
5640 if ( CUR.pedantic_hinting )
5641 CUR.error = FT_THROW( Invalid_Reference );
5645 CUR.zp1 = CUR.zp0;
5646 CUR.zp2 = CUR.zp0;
5648 CUR.GS.gep0 = (FT_UShort)args[0];
5649 CUR.GS.gep1 = (FT_UShort)args[0];
5650 CUR.GS.gep2 = (FT_UShort)args[0];
5671 if ( CUR.pedantic_hinting )
5672 CUR.error = FT_THROW( Invalid_Reference );
5679 CUR.GS.instruct_control = FT_BOOL(
5680 ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L );
5701 CUR.GS.scan_control = TRUE;
5706 CUR.GS.scan_control = FALSE;
5710 if ( ( args[0] & 0x100 ) != 0 && CUR.tt_metrics.ppem <= A )
5711 CUR.GS.scan_control = TRUE;
5713 if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated )
5714 CUR.GS.scan_control = TRUE;
5716 if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched )
5717 CUR.GS.scan_control = TRUE;
5719 if ( ( args[0] & 0x800 ) != 0 && CUR.tt_metrics.ppem > A )
5720 CUR.GS.scan_control = FALSE;
5722 if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated )
5723 CUR.GS.scan_control = FALSE;
5725 if ( ( args[0] & 0x2000 ) != 0 && CUR.tt_metrics.stretched )
5726 CUR.GS.scan_control = FALSE;
5740 CUR.GS.scan_type = (FT_Int)args[0];
5767 if ( CUR.top < CUR.GS.loop )
5769 if ( CUR.pedantic_hinting )
5770 CUR.error = FT_THROW( Too_Few_Arguments );
5774 while ( CUR.GS.loop > 0 )
5776 CUR.args--;
5778 point = (FT_UShort)CUR.stack[CUR.args];
5780 if ( BOUNDS( point, CUR.pts.n_points ) )
5782 if ( CUR.pedantic_hinting )
5784 CUR.error = FT_THROW( Invalid_Reference );
5789 CUR.pts.tags[point] ^= FT_CURVE_TAG_ON;
5791 CUR.GS.loop--;
5795 CUR.GS.loop = 1;
5796 CUR.new_top = CUR.args;
5815 if ( BOUNDS( K, CUR.pts.n_points ) ||
5816 BOUNDS( L, CUR.pts.n_points ) )
5818 if ( CUR.pedantic_hinting )
5819 CUR.error = FT_THROW( Invalid_Reference );
5824 CUR.pts.tags[I] |= FT_CURVE_TAG_ON;
5843 if ( BOUNDS( K, CUR.pts.n_points ) ||
5844 BOUNDS( L, CUR.pts.n_points ) )
5846 if ( CUR.pedantic_hinting )
5847 CUR.error = FT_THROW( Invalid_Reference );
5852 CUR.pts.tags[I] &= ~FT_CURVE_TAG_ON;
5867 if ( CUR.opcode & 1 )
5869 zp = CUR.zp0;
5870 p = CUR.GS.rp1;
5874 zp = CUR.zp1;
5875 p = CUR.GS.rp2;
5880 if ( CUR.pedantic_hinting )
5881 CUR.error = FT_THROW( Invalid_Reference );
5889 d = CUR_Func_project( zp.cur + p, zp.org + p );
5892 if ( CUR.face->unpatented_hinting )
5894 if ( CUR.GS.both_x_axis )
5908 *x = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.x, CUR.F_dot_P );
5909 *y = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.y, CUR.F_dot_P );
5923 if ( CUR.face->unpatented_hinting )
5925 if ( CUR.GS.both_x_axis )
5927 CUR.zp2.cur[point].x += dx;
5929 CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
5933 CUR.zp2.cur[point].y += dy;
5935 CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
5941 if ( CUR.GS.freeVector.x != 0 )
5943 CUR.zp2.cur[point].x += dx;
5945 CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;
5948 if ( CUR.GS.freeVector.y != 0 )
5950 CUR.zp2.cur[point].y += dy;
5952 CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;
5976 if ( CUR.top < CUR.GS.loop )
5978 if ( CUR.pedantic_hinting )
5979 CUR.error = FT_THROW( Invalid_Reference );
5986 while ( CUR.GS.loop > 0 )
5988 CUR.args--;
5989 point = (FT_UShort)CUR.stack[CUR.args];
5991 if ( BOUNDS( point, CUR.zp2.n_points ) )
5993 if ( CUR.pedantic_hinting )
5995 CUR.error = FT_THROW( Invalid_Reference );
6003 CUR.ignore_x_mode )
6009 CUR.GS.loop--;
6013 CUR.GS.loop = 1;
6014 CUR.new_top = CUR.args;
6040 bounds = ( CUR.GS.gep2 == 0 ) ? 1 : CUR.zp2.n_contours;
6044 if ( CUR.pedantic_hinting )
6045 CUR.error = FT_THROW( Invalid_Reference );
6055 start = (FT_UShort)( CUR.zp2.contours[contour - 1] + 1 -
6056 CUR.zp2.first_point );
6059 if ( CUR.GS.gep2 == 0 )
6060 limit = CUR.zp2.n_points;
6062 limit = (FT_UShort)( CUR.zp2.contours[contour] -
6063 CUR.zp2.first_point + 1 );
6067 if ( zp.cur != CUR.zp2.cur || refp != i )
6092 if ( CUR.pedantic_hinting )
6093 CUR.error = FT_THROW( Invalid_Reference );
6104 if ( CUR.GS.gep2 == 0 )
6105 limit = (FT_UShort)CUR.zp2.n_points;
6106 else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 )
6107 limit = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] + 1 );
6114 if ( zp.cur != CUR.zp2.cur || refp != i )
6136 if ( CUR.top < CUR.GS.loop + 1 )
6138 if ( CUR.pedantic_hinting )
6139 CUR.error = FT_THROW( Invalid_Reference );
6144 if ( CUR.face->unpatented_hinting )
6146 if ( CUR.GS.both_x_axis )
6160 dx = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.x );
6161 dy = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.y );
6164 while ( CUR.GS.loop > 0 )
6166 CUR.args--;
6168 point = (FT_UShort)CUR.stack[CUR.args];
6170 if ( BOUNDS( point, CUR.zp2.n_points ) )
6172 if ( CUR.pedantic_hinting )
6174 CUR.error = FT_THROW( Invalid_Reference );
6190 CUR.ignore_x_mode )
6193 if ( CUR.GS.freeVector.y != 0 )
6194 B1 = CUR.zp2.cur[point].y;
6196 B1 = CUR.zp2.cur[point].x;
6198 if ( !CUR.face->sph_compatibility_mode &&
6199 CUR.GS.freeVector.y != 0 )
6204 if ( CUR.GS.freeVector.y != 0 )
6206 B2 = CUR.zp2.cur[point].y;
6209 if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
6216 else if ( CUR.face->sph_compatibility_mode )
6218 if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
6225 if ( CUR.iup_called &&
6226 ( ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) ||
6227 ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) )
6230 if ( !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) &&
6231 ( ( CUR.is_composite && CUR.GS.freeVector.y != 0 ) ||
6232 ( CUR.zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) ||
6233 ( CUR.sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) )
6237 if ( CUR.GS.freeVector.y != 0 )
6239 B2 = CUR.zp2.cur[point].y;
6248 else if ( CUR.sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )
6263 CUR.GS.loop--;
6267 CUR.GS.loop = 1;
6268 CUR.new_top = CUR.args;
6290 control_value_cutin = CUR.GS.control_value_cutin;
6292 if ( CUR.ignore_x_mode &&
6293 CUR.GS.freeVector.x != 0 &&
6294 !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
6302 if ( BOUNDS( point, CUR.zp1.n_points ) ||
6303 BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
6305 if ( CUR.pedantic_hinting )
6306 CUR.error = FT_THROW( Invalid_Reference );
6312 if ( CUR.GS.gep1 == 0 )
6314 CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0];
6315 CUR_Func_move_orig( &CUR.zp1, point, args[1] );
6316 CUR.zp1.cur[point] = CUR.zp1.org[point];
6319 distance = CUR_Func_project( CUR.zp1.cur + point,
6320 CUR.zp0.cur + CUR.GS.rp0 );
6325 CUR.ignore_x_mode &&
6326 CUR.GS.freeVector.x != 0 &&
6331 CUR_Func_move( &CUR.zp1, point, args[1] - distance );
6333 CUR.GS.rp1 = CUR.GS.rp0;
6334 CUR.GS.rp2 = point;
6336 if ( ( CUR.opcode & 1 ) != 0 )
6337 CUR.GS.rp0 = point;
6357 if ( BOUNDS( point, CUR.zp0.n_points ) )
6359 if ( CUR.pedantic_hinting )
6360 CUR.error = FT_THROW( Invalid_Reference );
6364 if ( ( CUR.opcode & 1 ) != 0 )
6366 cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );
6369 CUR.ignore_x_mode &&
6370 CUR.GS.freeVector.x != 0 )
6373 CUR.tt_metrics.compensations[0] ) - cur_dist;
6378 CUR.tt_metrics.compensations[0] ) - cur_dist;
6383 CUR_Func_move( &CUR.zp0, point, distance );
6385 CUR.GS.rp0 = point;
6386 CUR.GS.rp1 = point;
6406 control_value_cutin = CUR.GS.control_value_cutin;
6412 CUR.ignore_x_mode &&
6413 CUR.GS.freeVector.x != 0 &&
6414 CUR.GS.freeVector.y == 0 &&
6415 !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
6419 if ( BOUNDS( point, CUR.zp0.n_points ) ||
6420 BOUNDSL( cvtEntry, CUR.cvtSize ) )
6422 if ( CUR.pedantic_hinting )
6423 CUR.error = FT_THROW( Invalid_Reference );
6449 if ( CUR.GS.gep0 == 0 ) /* If in twilight zone */
6455 ( !CUR.ignore_x_mode ||
6456 !CUR.face->sph_compatibility_mode ) )
6458 CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance,
6459 CUR.GS.freeVector.x );
6460 CUR.zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance,
6461 CUR.GS.freeVector.y ),
6462 CUR.zp0.cur[point] = CUR.zp0.org[point];
6466 CUR.ignore_x_mode &&
6467 ( CUR.sph_tweak_flags & SPH_TWEAK_MIAP_HACK ) &&
6469 CUR.GS.freeVector.y != 0 )
6473 org_dist = CUR_fast_project( &CUR.zp0.cur[point] );
6475 if ( ( CUR.opcode & 1 ) != 0 ) /* rounding and control cut-in flag */
6482 CUR.ignore_x_mode &&
6483 CUR.GS.freeVector.x != 0 )
6485 CUR.tt_metrics.compensations[0] );
6489 CUR.tt_metrics.compensations[0] );
6492 CUR_Func_move( &CUR.zp0, point, distance - org_dist );
6495 CUR.GS.rp0 = point;
6496 CUR.GS.rp1 = point;
6513 CUR.GS.minimum_distance;
6517 CUR.ignore_x_mode &&
6518 CUR.GS.freeVector.x != 0 &&
6519 !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
6525 if ( BOUNDS( point, CUR.zp1.n_points ) ||
6526 BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
6528 if ( CUR.pedantic_hinting )
6529 CUR.error = FT_THROW( Invalid_Reference );
6538 if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
6540 FT_Vector* vec1 = &CUR.zp1.org[point];
6541 FT_Vector* vec2 = &CUR.zp0.org[CUR.GS.rp0];
6548 FT_Vector* vec1 = &CUR.zp1.orus[point];
6549 FT_Vector* vec2 = &CUR.zp0.orus[CUR.GS.rp0];
6552 if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
6556 org_dist = FT_MulFix( org_dist, CUR.metrics.x_scale );
6563 vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );
6564 vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );
6572 if ( FT_ABS( org_dist - CUR.GS.single_width_value ) <
6573 CUR.GS.single_width_cutin )
6576 org_dist = CUR.GS.single_width_value;
6578 org_dist = -CUR.GS.single_width_value;
6583 if ( ( CUR.opcode & 4 ) != 0 )
6587 CUR.ignore_x_mode &&
6588 CUR.GS.freeVector.x != 0 )
6591 CUR.tt_metrics.compensations[CUR.opcode & 3] );
6596 CUR.tt_metrics.compensations[CUR.opcode & 3] );
6601 CUR.tt_metrics.compensations[CUR.opcode & 3] );
6605 if ( ( CUR.opcode & 8 ) != 0 )
6621 org_dist = CUR_Func_project( CUR.zp1.cur + point,
6622 CUR.zp0.cur + CUR.GS.rp0 );
6624 CUR_Func_move( &CUR.zp1, point, distance - org_dist );
6627 CUR.GS.rp1 = CUR.GS.rp0;
6628 CUR.GS.rp2 = point;
6630 if ( ( CUR.opcode & 16 ) != 0 )
6631 CUR.GS.rp0 = point;
6660 minimum_distance = CUR.GS.minimum_distance;
6661 control_value_cutin = CUR.GS.control_value_cutin;
6667 CUR.ignore_x_mode &&
6668 CUR.GS.freeVector.x != 0 &&
6669 !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
6675 if ( BOUNDS( point, CUR.zp1.n_points ) ||
6676 BOUNDSL( cvtEntry, CUR.cvtSize + 1 ) ||
6677 BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
6679 if ( CUR.pedantic_hinting )
6680 CUR.error = FT_THROW( Invalid_Reference );
6691 if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) <
6692 CUR.GS.single_width_cutin )
6695 cvt_dist = CUR.GS.single_width_value;
6697 cvt_dist = -CUR.GS.single_width_value;
6702 if ( CUR.GS.gep1 == 0 )
6704 CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x +
6706 CUR.GS.freeVector.x );
6707 CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y +
6709 CUR.GS.freeVector.y );
6710 CUR.zp1.cur[point] = CUR.zp1.org[point];
6713 org_dist = CUR_Func_dualproj( &CUR.zp1.org[point],
6714 &CUR.zp0.org[CUR.GS.rp0] );
6715 cur_dist = CUR_Func_project ( &CUR.zp1.cur[point],
6716 &CUR.zp0.cur[CUR.GS.rp0] );
6720 if ( CUR.GS.auto_flip )
6728 CUR.ignore_x_mode &&
6729 CUR.GS.freeVector.y != 0 &&
6730 ( CUR.sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) )
6741 if ( ( CUR.opcode & 4 ) != 0 )
6746 if ( CUR.GS.gep0 == CUR.GS.gep1 )
6766 CUR.tt_metrics.compensations[CUR.opcode & 3] );
6774 CUR.ignore_x_mode &&
6775 CUR.GS.gep0 == CUR.GS.gep1 )
6784 CUR.tt_metrics.compensations[CUR.opcode & 3] );
6789 if ( ( CUR.opcode & 8 ) != 0 )
6806 B1 = CUR.zp1.cur[point].y;
6809 if ( CUR.ignore_x_mode &&
6810 CUR.GS.freeVector.y != 0 &&
6811 ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) )
6814 if ( CUR.ignore_x_mode &&
6815 CUR.GS.freeVector.y != 0 &&
6816 ( CUR.opcode & 16 ) == 0 &&
6817 ( CUR.opcode & 8 ) == 0 &&
6818 ( CUR.sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) )
6823 CUR_Func_move( &CUR.zp1, point, distance - cur_dist );
6828 B2 = CUR.zp1.cur[point].y;
6831 if ( CUR.ignore_x_mode )
6833 if ( CUR.face->sph_compatibility_mode &&
6834 CUR.GS.freeVector.y != 0 &&
6839 if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
6840 CUR.GS.freeVector.y != 0 &&
6847 CUR_Func_move( &CUR.zp1, point, -( distance - cur_dist ) );
6853 CUR.GS.rp1 = CUR.GS.rp0;
6855 if ( ( CUR.opcode & 16 ) != 0 )
6856 CUR.GS.rp0 = point;
6858 CUR.GS.rp2 = point;
6879 CUR.ignore_x_mode &&
6880 CUR.iup_called &&
6881 ( CUR.sph_tweak_flags & SPH_TWEAK_NO_ALIGNRP_AFTER_IUP ) )
6883 CUR.error = FT_THROW( Invalid_Reference );
6888 if ( CUR.top < CUR.GS.loop ||
6889 BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )
6891 if ( CUR.pedantic_hinting )
6892 CUR.error = FT_THROW( Invalid_Reference );
6896 while ( CUR.GS.loop > 0 )
6898 CUR.args--;
6900 point = (FT_UShort)CUR.stack[CUR.args];
6902 if ( BOUNDS( point, CUR.zp1.n_points ) )
6904 if ( CUR.pedantic_hinting )
6906 CUR.error = FT_THROW( Invalid_Reference );
6912 distance = CUR_Func_project( CUR.zp1.cur + point,
6913 CUR.zp0.cur + CUR.GS.rp0 );
6915 CUR_Func_move( &CUR.zp1, point, -distance );
6918 CUR.GS.loop--;
6922 CUR.GS.loop = 1;
6923 CUR.new_top = CUR.args;
6958 if ( BOUNDS( b0, CUR.zp0.n_points ) ||
6959 BOUNDS( b1, CUR.zp0.n_points ) ||
6960 BOUNDS( a0, CUR.zp1.n_points ) ||
6961 BOUNDS( a1, CUR.zp1.n_points ) ||
6962 BOUNDS( point, CUR.zp2.n_points ) )
6964 if ( CUR.pedantic_hinting )
6965 CUR.error = FT_THROW( Invalid_Reference );
6971 dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x;
6972 dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y;
6974 dax = CUR.zp1.cur[a1].x - CUR.zp1.cur[a0].x;
6975 day = CUR.zp1.cur[a1].y - CUR.zp1.cur[a0].y;
6977 dx = CUR.zp0.cur[b0].x - CUR.zp1.cur[a0].x;
6978 dy = CUR.zp0.cur[b0].y - CUR.zp1.cur[a0].y;
6980 CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH;
7002 CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x;
7003 CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y;
7009 CUR.zp2.cur[point].x = ( CUR.zp1.cur[a0].x +
7010 CUR.zp1.cur[a1].x +
7011 CUR.zp0.cur[b0].x +
7012 CUR.zp0.cur[b1].x ) / 4;
7013 CUR.zp2.cur[point].y = ( CUR.zp1.cur[a0].y +
7014 CUR.zp1.cur[a1].y +
7015 CUR.zp0.cur[b0].y +
7016 CUR.zp0.cur[b1].y ) / 4;
7037 if ( BOUNDS( p1, CUR.zp1.n_points ) ||
7038 BOUNDS( p2, CUR.zp0.n_points ) )
7040 if ( CUR.pedantic_hinting )
7041 CUR.error = FT_THROW( Invalid_Reference );
7045 distance = CUR_Func_project( CUR.zp0.cur + p2,
7046 CUR.zp1.cur + p1 ) / 2;
7048 CUR_Func_move( &CUR.zp1, p1, distance );
7049 CUR_Func_move( &CUR.zp0, p2, -distance );
7073 if ( CUR.top < CUR.GS.loop )
7075 if ( CUR.pedantic_hinting )
7076 CUR.error = FT_THROW( Invalid_Reference );
7082 * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0),
7085 twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0;
7087 if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) )
7089 if ( CUR.pedantic_hinting )
7090 CUR.error = FT_THROW( Invalid_Reference );
7095 orus_base = &CUR.zp0.org[CUR.GS.rp1];
7097 orus_base = &CUR.zp0.orus[CUR.GS.rp1];
7099 cur_base = &CUR.zp0.cur[CUR.GS.rp1];
7105 if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ||
7106 BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) )
7114 old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2],
7116 else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
7117 old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2],
7124 vec.x = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].x - orus_base->x,
7125 CUR.metrics.x_scale );
7126 vec.y = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].y - orus_base->y,
7127 CUR.metrics.y_scale );
7132 cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base );
7135 for ( ; CUR.GS.loop > 0; --CUR.GS.loop )
7137 FT_UInt point = (FT_UInt)CUR.stack[--CUR.args];
7142 if ( BOUNDS( point, CUR.zp2.n_points ) )
7144 if ( CUR.pedantic_hinting )
7146 CUR.error = FT_THROW( Invalid_Reference );
7153 org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base );
7154 else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
7155 org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );
7161 vec.x = FT_MulFix( CUR.zp2.orus[point].x - orus_base->x,
7162 CUR.metrics.x_scale );
7163 vec.y = FT_MulFix( CUR.zp2.orus[point].y - orus_base->y,
7164 CUR.metrics.y_scale );
7169 cur_dist = CUR_Func_project( &CUR.zp2.cur[point], cur_base );
7199 CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );
7203 CUR.GS.loop = 1;
7204 CUR.new_top = CUR.args;
7223 if ( BOUNDS( point, CUR.zp0.n_points ) )
7225 if ( CUR.pedantic_hinting )
7226 CUR.error = FT_THROW( Invalid_Reference );
7232 if ( CUR.GS.freeVector.x != 0 )
7235 if ( CUR.GS.freeVector.y != 0 )
7238 CUR.zp0.tags[point] &= mask;
7393 if ( CUR.pts.n_contours == 0 )
7396 if ( CUR.opcode & 1 )
7399 V.orgs = CUR.pts.org;
7400 V.curs = CUR.pts.cur;
7401 V.orus = CUR.pts.orus;
7406 V.orgs = (FT_Vector*)( (FT_Pos*)CUR.pts.org + 1 );
7407 V.curs = (FT_Vector*)( (FT_Pos*)CUR.pts.cur + 1 );
7408 V.orus = (FT_Vector*)( (FT_Pos*)CUR.pts.orus + 1 );
7410 V.max_points = CUR.pts.n_points;
7417 CUR.ignore_x_mode )
7419 CUR.iup_called = TRUE;
7420 if ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_IUP )
7427 end_point = CUR.pts.contours[contour] - CUR.pts.first_point;
7430 if ( BOUNDS ( end_point, CUR.pts.n_points ) )
7431 end_point = CUR.pts.n_points - 1;
7433 while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 )
7445 if ( ( CUR.pts.tags[point] & mask ) != 0 )
7477 } while ( contour < CUR.pts.n_contours );
7499 CUR.ignore_x_mode &&
7500 CUR.iup_called &&
7501 ( CUR.sph_tweak_flags & SPH_TWEAK_NO_DELTAP_AFTER_IUP ) )
7508 if ( CUR.face->unpatented_hinting )
7513 if ( CUR.args < n )
7515 if ( CUR.pedantic_hinting )
7516 CUR.error = FT_THROW( Too_Few_Arguments );
7517 n = CUR.args;
7520 CUR.args -= n;
7521 CUR.new_top = CUR.args;
7531 if ( CUR.args < 2 )
7533 if ( CUR.pedantic_hinting )
7534 CUR.error = FT_THROW( Too_Few_Arguments );
7535 CUR.args = 0;
7539 CUR.args -= 2;
7541 A = (FT_UShort)CUR.stack[CUR.args + 1];
7542 B = CUR.stack[CUR.args];
7550 if ( !BOUNDS( A, CUR.zp0.n_points ) )
7554 switch ( CUR.opcode )
7568 C += CUR.GS.delta_base;
7575 B = B * 64 / ( 1L << CUR.GS.delta_shift );
7589 if ( !CUR.ignore_x_mode ||
7590 ( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||
7591 ( CUR.is_composite && CUR.GS.freeVector.y != 0 ) )
7592 CUR_Func_move( &CUR.zp0, A, B );
7596 else if ( CUR.ignore_x_mode )
7598 if ( CUR
7599 B1 = (FT_UShort)CUR.zp0.cur[A].y;
7601 B1 = (FT_UShort)CUR.zp0.cur[A].x;
7606 if ( !CUR.face->sph_compatibility_mode &&
7607 CUR.GS.freeVector.y != 0 )
7608 CUR_Func_move( &CUR.zp0, A, B );
7614 if ( CUR.face->sph_compatibility_mode &&
7615 !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) )
7618 B1 = (FT_UShort)CUR.zp0.cur[A].y;
7620 if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
7625 if ( !CUR.iup_called &&
7626 ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
7627 CUR_Func_move( &CUR.zp0, A, B );
7630 B2 = (FT_UShort)CUR.zp0.cur[A].y;
7633 if ( CUR.GS.freeVector.y != 0 &&
7634 ( ( CUR.face->sph_compatibility_mode &&
7637 ( ( CUR.sph_tweak_flags &
7641 CUR_Func_move( &CUR.zp0, A, -B );
7647 CUR_Func_move( &CUR.zp0, A, B );
7651 if ( CUR.pedantic_hinting )
7652 CUR.error = FT_THROW( Invalid_Reference );
7656 CUR.new_top = CUR.args;
7676 if ( CUR.face->unpatented_hinting )
7681 if ( CUR.args < n )
7683 if ( CUR.pedantic_hinting )
7684 CUR.error = FT_THROW( Too_Few_Arguments );
7685 n = CUR.args;
7688 CUR.args -= n;
7689 CUR.new_top = CUR.args;
7698 if ( CUR.args < 2 )
7700 if ( CUR.pedantic_hinting )
7701 CUR.error = FT_THROW( Too_Few_Arguments );
7702 CUR.args = 0;
7706 CUR.args -= 2;
7708 A = (FT_ULong)CUR.stack[CUR.args + 1];
7709 B = CUR.stack[CUR.args];
7711 if ( BOUNDSL( A, CUR.cvtSize ) )
7713 if ( CUR.pedantic_hinting )
7715 CUR.error = FT_THROW( Invalid_Reference );
7723 switch ( CUR.opcode )
7737 C += CUR.GS.delta_base;
7744 B = B * 64 / ( 1L << CUR.GS.delta_shift );
7752 CUR.new_top = CUR.args;
7785 CUR.ignore_x_mode )
7787 K = CUR.rasterizer_version;
7789 CUR.rasterizer_version ));
7801 if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated )
7809 if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched )
7817 if ( ( args[0] & 32 ) != 0 && CUR.grayscale )
7823 CUR.ignore_x_mode &&
7824 CUR.rasterizer_version >= TT_INTERPRETER_VERSION_35 )
7827 if ( CUR.rasterizer_version >= 37 )
7834 if ( ( args[0] & 64 ) != 0 && CUR.subpixel )
7843 if ( ( args[0] & 128 ) != 0 && CUR.compatible_widths )
7852 if ( ( args[0] & 256 ) != 0 && CUR.symmetrical_smoothing )
7861 if ( ( args[0] & 512 ) != 0 && CUR.bgr )
7864 if ( CUR.rasterizer_version >= 38 )
7872 if ( ( args[0] & 1024 ) != 0 && CUR.subpixel_positioned )
7887 TT_DefRecord* def = CUR.IDefs;
7888 TT_DefRecord* limit = def + CUR.numIDefs;
7895 if ( (FT_Byte)def->opc == CUR.opcode && def->active )
7900 if ( CUR.callTop >= CUR.callSize )
7902 CUR.error = FT_THROW( Stack_Overflow );
7906 call = CUR.callStack + CUR.callTop++;
7908 call->Caller_Range = CUR.curRange;
7909 call->Caller_IP = CUR.IP + 1;
7915 CUR.step_ins = FALSE;
7920 CUR.error = FT_THROW( Invalid_Opcode );
8265 cur = *exc;
8269 CUR.iup_called = FALSE;
8273 CUR.tt_metrics.ratio = 0;
8274 if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem )
8277 CUR.func_read_cvt = Read_CVT_Stretched;
8278 CUR.func_write_cvt = Write_CVT_Stretched;
8279 CUR.func_move_cvt = Move_CVT_Stretched;
8284 CUR.func_read_cvt = Read_CVT;
8285 CUR.func_write_cvt = Write_CVT;
8286 CUR.func_move_cvt = Move_CVT;
8294 CUR.opcode = CUR.code[CUR.IP];
8297 FT_TRACE7(( opcode_name[CUR.opcode] ));
8300 if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 )
8302 if ( CUR.IP + 1 >= CUR.codeSize )
8305 CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];
8308 if ( CUR.IP + CUR.length > CUR.codeSize )
8312 CUR.args = CUR.top - ( Pop_Push_Count[CUR.opcode] >> 4 );
8316 if ( CUR.args < 0 )
8318 if ( CUR.pedantic_hinting )
8320 CUR.error = FT_THROW( Too_Few_Arguments );
8325 for ( i = 0; i < Pop_Push_Count[CUR.opcode] >> 4; i++ )
8326 CUR.stack[i] = 0;
8327 CUR.args = 0;
8330 CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 );
8335 if ( CUR.new_top > CUR.stackSize )
8337 CUR.error = FT_THROW( Stack_Overflow );
8341 CUR.step_ins = TRUE;
8342 CUR.error = FT_Err_Ok;
8351 CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )
8359 CUR.face->root.family_name,
8360 CUR.face->root.style_name ));
8380 FT_Long* args = CUR.stack + CUR.args;
8381 FT_Byte opcode = CUR.opcode;
8405 CUR.GS.projVector.x = AA;
8406 CUR.GS.projVector.y = BB;
8408 CUR.GS.dualVector.x = AA;
8409 CUR.GS.dualVector.y = BB;
8418 CUR.GS.freeVector.x = AA;
8419 CUR.GS.freeVector.y = BB;
8648 CUR.error = FT_THROW( Invalid_Reference );
8934 Instruct_Dispatch[CUR.opcode]( EXEC_ARG_ &CUR.stack[CUR.args] );
8938 if ( CUR.error )
8940 switch ( CUR.error )
8945 TT_DefRecord* def = CUR.IDefs;
8946 TT_DefRecord* limit = def + CUR.numIDefs;
8951 if ( def->active && CUR.opcode == (FT_Byte)def->opc )
8956 if ( CUR.callTop >= CUR.callSize )
8958 CUR.error = FT_THROW( Invalid_Reference );
8962 callrec = &CUR.callStack[CUR.callTop];
8964 callrec->Caller_Range = CUR.curRange;
8965 callrec->Caller_IP = CUR.IP + 1;
8977 CUR.error = FT_THROW( Invalid_Opcode );
8995 CUR.top = CUR.new_top;
8997 if ( CUR.step_ins )
8998 CUR.IP += CUR.length;
9006 if ( CUR.IP >= CUR.codeSize )
9008 if ( CUR.callTop > 0 )
9010 CUR.error = FT_THROW( Code_Overflow );
9016 } while ( !CUR.instruction_trap );
9021 *exc = cur;
9027 CUR.error = FT_THROW( Code_Overflow );
9032 *exc = cur;
9038 if ( CUR.error
9039 && !CUR.instruction_trap
9040 && CUR.curRange == tt_coderange_glyph )
9042 FT_TRACE1(( " The interpreter returned error 0x%x\n", CUR.error ));
9047 return CUR.error;