apwfreetypelib

Check-in [b53e22d29c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixes and deleted 2 unused files.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b53e22d29c637c3d76d3eecc148456f01155fc5b
User & Date: arnulf 2015-01-25 10:06:52
Context
2015-01-25
10:57
fixes and deleted one file check-in: 8b4190420e user: arnulf tags: trunk
10:06
fixes and deleted 2 unused files. check-in: b53e22d29c user: arnulf tags: trunk
2015-01-24
23:34
fixes. check-in: 7d0f866225 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to afttruetype/TTDefaultGraphicsStateClass.java.

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    projVector.y = 0;
    freeVector = new FTVectorRec();
    freeVector.x = 0x4000;
    freeVector.y = 0;

    loop = 1;
    minimum_distance = 64;
    round_state = TTInterpTags.RoundState.To_Grid;

    auto_flip = true;
    control_value_cutin = 68;
    single_width_cutin = 0;
    single_width_value = 0;
    delta_base = 9;
    delta_shift = 3;







|







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    projVector.y = 0;
    freeVector = new FTVectorRec();
    freeVector.x = 0x4000;
    freeVector.y = 0;

    loop = 1;
    minimum_distance = 64;
    round_state = TTInterpTags.Round.To_Grid;

    auto_flip = true;
    control_value_cutin = 68;
    single_width_cutin = 0;
    single_width_value = 0;
    delta_base = 9;
    delta_shift = 3;

Deleted afttruetype/TTInterpFuncs3.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* =====================================================================
 *  This Java implementation is derived from FreeType code
 *  Portions of this software are copyright (C) 2014 The FreeType
 *  Project (www.freetype.org).  All rights reserved.
 *
 *  Copyright (C) of the Java implementation 2014
 *  Arnulf Wiedemann: arnulf (at) wiedemann-pri (dot) de
 *
 *  See the file "license.terms" for information on usage and
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

package org.apwtcl.apwfreetypelib.afttruetype;

import org.apwtcl.apwfreetypelib.aftttinterpreter.TTExecContextRec;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;

  /* ===================================================================== */
  /*    TTInterpFuncs3                                                        */
  /*                                                                       */
  /* ===================================================================== */

public class TTInterpFuncs3 extends FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "TTInterpFuncs3";
    
    /* ==================== TTInterpFuncs3 ================================== */
    public TTInterpFuncs3() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
      return TAG+"!"+id+"!";
    }
        
    /* ==================== toString ===================================== */
    public String toString() {
      return mySelf()+"!";
    }

    /* ==================== toDebugString ===================================== */
    public String toDebugString() {
      StringBuffer str = new StringBuffer(mySelf()+"\n");
      return str.toString();
    }
 
    /* ==================== _showZp0Zp1OrgCur ================================ */
    public static void _showZp0Zp1OrgCur( String str, TTExecContextRec cur ) {
      Debug(0, DebugTag.DBG_RENDER, TAG, str);
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp0.org: "+(Object)cur.zp0.getOrg());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp1.org: "+(Object)cur.zp1.getOrg());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp2.org: "+(Object)cur.zp2.getOrg());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp0.cur: "+(Object)cur.zp0.getCur());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp1.cur: "+(Object)cur.zp1.getCur());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp2.cur: "+(Object)cur.zp2.getCur());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp0.orus: "+(Object)cur.zp0.getOrus());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp1.orus: "+(Object)cur.zp1.getOrus());
      Debug(0, DebugTag.DBG_RENDER, TAG, "zp2.orus: "+(Object)cur.zp2.getOrus());
      for( int i = 0; i < 6; i++) {
        Debug(0, DebugTag.DBG_RENDER, TAG, String.format("zp0.org: %d x: %d, y: %d\n", i, cur.zp0.getOrgPoint_x(i), cur.zp0.getOrgPoint_y(i)));
        Debug(0, DebugTag.DBG_RENDER, TAG, String.format("zp1.org: %d x: %d, y: %d\n", i, cur.zp1.getOrgPoint_x(i), cur.zp1.getOrgPoint_y(i)));
        Debug(0, DebugTag.DBG_RENDER, TAG, String.format("zp0.cur: %d x: %d, y: %d\n", i, cur.zp0.getCurPoint_x(i), cur.zp0.getCurPoint_y(i)));
        Debug(0, DebugTag.DBG_RENDER, TAG, String.format("zp1.cur: %d x: %d, y: %d\n", i, cur.zp1.getCurPoint_x(i), cur.zp1.getCurPoint_y(i)));
      }
    }



}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















































































































































Deleted afttruetype/TTInterpRun.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* =====================================================================
 *  This Java implementation is derived from FreeType code
 *  Portions of this software are copyright (C) 2014 The FreeType
 *  Project (www.freetype.org).  All rights reserved.
 *
 *  Copyright (C) of the Java implementation 2014
 *  Arnulf Wiedemann: arnulf (at) wiedemann-pri (dot) de
 *
 *  See the file "license.terms" for information on usage and
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

package org.apwtcl.apwfreetypelib.afttruetype;

  /* ===================================================================== */
  /*    TTInterpRun                                                          */
  /*                                                                       */
  /* ===================================================================== */

import org.apwtcl.apwfreetypelib.aftttinterpreter.TTExecContextRec;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTInterpTags;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;
import org.apwtcl.apwfreetypelib.aftutil.FTError;

public class TTInterpRun extends FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "TTInterpRun";

    public static int numInstructions = 0;
    public static boolean doInterpDebug = false;

    /* ==================== TTInterpRun ================================== */
    public TTInterpRun() {
      super();
      oid++;
      id = oid;
      String class_name = "org.apwtcl.gles20.truetype.TTInterpFuncs3";
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
      return TAG+"!"+id+"!";
    }
        
    /* ==================== toString ===================================== */
    public String toString() {
      return mySelf()+"!";
    }

    /* ==================== toDebugString ===================================== */
    public String toDebugString() {
      StringBuffer str = new StringBuffer(mySelf()+"\n");
      return str.toString();
    }

    /* =====================================================================
     * TTRunContext
     * =====================================================================
     */

    public static FTError.ErrorTag TTRunContext(TTExecContextRec exec, boolean debug) {
      FTError.ErrorTag error = FTError.ErrorTag.ERR_OK;
Debug(0, FTDebug.DebugTag.DBG_INTERP, TAG, String.format("TT_Run_Context %d", TTInterpTags.CodeRange.GLYPH)+" zp0.cur: "+(Object)exec.zp0.getCur()+"\n zp1.cur: "+(Object)exec.zp1.getCur());

      if ((error = exec.TTGotoCodeRange(TTInterpTags.CodeRange.GLYPH, 0)) != FTError.ErrorTag.ERR_OK) {
        return error;
      }
      exec.zp0 = exec.pts;
      exec.zp1 = exec.pts;
      exec.zp2 = exec.pts;
Debug(0, DebugTag.DBG_INTERP, TAG, "TT_Run_Context2 zp0.cur: "+exec.zp0.getCur()+" \nzp1.cur: "+(Object)exec.zp1.getCur());
for( int i = 0; i < 6; i++) {
//  Debug(0, DebugTag.DBG_INTERP, TAG, String.format("zp1.org: %d x: %d, y: %d\n", i, cur.zp1.org[i].x, cur.zp1.org[i].y));
//  Debug(0, DebugTag.DBG_INTERP, TAG, String.format("zp0.org: %d x: %d, y: %d\n", i, cur.zp0.org[i].x, cur.zp0.org[i].y));
}
      exec.graphics_state.setGep0(1);
      exec.graphics_state.setGep1(1);
      exec.graphics_state.setGep2(1);
      exec.graphics_state.getProjVector().x = 0x4000;
      exec.graphics_state.getProjVector().y = 0x0000;
      exec.graphics_state.getFreeVector().x = exec.graphics_state.getProjVector().x;
      exec.graphics_state.getFreeVector().y = exec.graphics_state.getProjVector().y;
      exec.graphics_state.getDualVector().x = exec.graphics_state.getProjVector().x;
      exec.graphics_state.getDualVector().y = exec.graphics_state.getProjVector().y;
      exec.graphics_state.setRound_state(TTInterpTags.RoundState.To_Grid);
      exec.graphics_state.setLoop(1);
      /* some glyphs leave something on the stack. so we clean it */
      /* before a new execution.                                  */
      exec.top = 0;
      exec.callTop = 0;
/* NEEDED !!!
      return exec.face.getInterpreter().run(exec);
 NEEDED !!! */
      return FTError.ErrorTag.ERR_OK;
    }
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































































































































































Changes to afttruetype/TTLoaderRec.java.

710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
        return error;
      }
      exec.is_composite = is_composite;
      exec.pts.copy(zone);
      debug = ((load_flags.getVal() & Flags.Load.NO_SCALE.getVal()) == 0 && ((TTSizeRec)size).isDebug());
      Debug(0, DebugTag.DBG_LOAD_GLYPH, TAG, "call TTRunContext");
//_showLoaderZone("before call TTRunContext");
      error = TTInterpRun.TTRunContext(exec, debug);
      if (error != FTError.ErrorTag.ERR_OK && exec.pedantic_hinting) {
        return error;
      }
        /* store drop-out mode in bits 5-7; set bit 2 also as a marker */
      current_outline.getTags()[0] = Flags.Curve.getTableTag(current_outline.getTags()[0].getVal() |
          (exec.graphics_state.getScan_type() << 5) | Flags.Curve.HAS_SCANMODE.getVal());
    }







|







710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
        return error;
      }
      exec.is_composite = is_composite;
      exec.pts.copy(zone);
      debug = ((load_flags.getVal() & Flags.Load.NO_SCALE.getVal()) == 0 && ((TTSizeRec)size).isDebug());
      Debug(0, DebugTag.DBG_LOAD_GLYPH, TAG, "call TTRunContext");
//_showLoaderZone("before call TTRunContext");
      error = exec.TTRunContext(debug);
      if (error != FTError.ErrorTag.ERR_OK && exec.pedantic_hinting) {
        return error;
      }
        /* store drop-out mode in bits 5-7; set bit 2 also as a marker */
      current_outline.getTags()[0] = Flags.Curve.getTableTag(current_outline.getTags()[0].getVal() |
          (exec.graphics_state.getScan_type() << 5) | Flags.Curve.HAS_SCANMODE.getVal());
    }

Changes to afttruetype/TTSizeRec.java.

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
import org.apwtcl.apwfreetypelib.aftbase.FTSizeMetricsRec;
import org.apwtcl.apwfreetypelib.aftbase.FTSizeRec;
import org.apwtcl.apwfreetypelib.aftbase.FTSizeRequestRec;
import org.apwtcl.apwfreetypelib.aftbase.Flags;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTExecContextRec;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTGraphicsStateRec;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTInterpTags;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTOpCode;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTRunInstructions;
import org.apwtcl.apwfreetypelib.aftutil.*;

public class TTSizeRec extends FTSizeRec {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTSizeRec";
................................................................................
    instruction_defs = new TTDefRec[1];
    codeRangeTable = new TTCodeRange[TT_MAX_CODE_RANGES];
    for (int i = 0; i < TT_MAX_CODE_RANGES; i++) {
      codeRangeTable[i] = new TTCodeRange();
    }
    graphics_state = new TTDefaultGraphicsStateClass();
    twilight = new TTGlyphZoneRec();
//    context = new TTRunInstructions();
Debug(0, DebugTag.DBG_INIT, TAG, "exec1 ttsize: "+context+"!");
  }
    
  /* ==================== mySelf ================================== */
  public String mySelf() {
      return TAG+"!"+id+"!";
    }
................................................................................
      return error;
    }
    twilight.setN_points(n_twilight);
    graphics_state = new TTDefaultGraphicsStateClass();
      /* set `ttface.interpreter' according to the debug hook present */
    {
//        FTLibraryRec library = ttface.driver.library;
//        ttface.interpreter = (TTInterpRun) library.debug_hooks[FT_DEBUG_HOOK_TRUETYPE];
    }
      /* Fine, now run the font program! */
    error = tt_size_run_fpgm(pedantic);
    if (error != FTError.ErrorTag.ERR_OK) {
      tt_size_done_bytecode();
    }
    return error;







<
<







 







<







 







|







23
24
25
26
27
28
29


30
31
32
33
34
35
36
..
76
77
78
79
80
81
82

83
84
85
86
87
88
89
...
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
import org.apwtcl.apwfreetypelib.aftbase.FTSizeMetricsRec;
import org.apwtcl.apwfreetypelib.aftbase.FTSizeRec;
import org.apwtcl.apwfreetypelib.aftbase.FTSizeRequestRec;
import org.apwtcl.apwfreetypelib.aftbase.Flags;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTExecContextRec;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTGraphicsStateRec;
import org.apwtcl.apwfreetypelib.aftttinterpreter.TTInterpTags;


import org.apwtcl.apwfreetypelib.aftutil.*;

public class TTSizeRec extends FTSizeRec {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTSizeRec";
................................................................................
    instruction_defs = new TTDefRec[1];
    codeRangeTable = new TTCodeRange[TT_MAX_CODE_RANGES];
    for (int i = 0; i < TT_MAX_CODE_RANGES; i++) {
      codeRangeTable[i] = new TTCodeRange();
    }
    graphics_state = new TTDefaultGraphicsStateClass();
    twilight = new TTGlyphZoneRec();

Debug(0, DebugTag.DBG_INIT, TAG, "exec1 ttsize: "+context+"!");
  }
    
  /* ==================== mySelf ================================== */
  public String mySelf() {
      return TAG+"!"+id+"!";
    }
................................................................................
      return error;
    }
    twilight.setN_points(n_twilight);
    graphics_state = new TTDefaultGraphicsStateClass();
      /* set `ttface.interpreter' according to the debug hook present */
    {
//        FTLibraryRec library = ttface.driver.library;
//        ttface.interpreter = library.debug_hooks[FT_DEBUG_HOOK_TRUETYPE];
    }
      /* Fine, now run the font program! */
    error = tt_size_run_fpgm(pedantic);
    if (error != FTError.ErrorTag.ERR_OK) {
      tt_size_done_bytecode();
    }
    return error;

Changes to aftttinterpreter/TTCvtFunc.java.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  /* ===================================================================== */
  /*    TTCvtFunc                                                          */
  /*   set of Cvt functions for interpreter                                */
  /* ===================================================================== */

import android.util.Log;

import org.apwtcl.apwfreetypelib.afttruetype.TTInterpRun;
import org.apwtcl.apwfreetypelib.aftutil.FTError;

public class TTCvtFunc extends TTCvtFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTCvtFunc";







<







16
17
18
19
20
21
22

23
24
25
26
27
28
29
  /* ===================================================================== */
  /*    TTCvtFunc                                                          */
  /*   set of Cvt functions for interpreter                                */
  /* ===================================================================== */

import android.util.Log;


import org.apwtcl.apwfreetypelib.aftutil.FTError;

public class TTCvtFunc extends TTCvtFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTCvtFunc";

Changes to aftttinterpreter/TTExecContextRec.java.

149
150
151
152
153
154
155




















156
157
158
159
160
161
162
...
308
309
310
311
312
313
314






































315
316
317
318
319
320
321
  }

  /* ==================== toDebugString ===================================== */
  public String toDebugString() {
    StringBuffer str = new StringBuffer(mySelf()+"\n");
    return str.toString();
  }





















  /* =====================================================================
   * <Function>
   *    InitContext
   *
   * <Description>
   *    Initializes a context object.
................................................................................
    zp0.copy(pts);
    pts.setN_points(0);
    pts.setN_contours(0);

    instruction_trap = false;
    return error;
  }







































  /* =====================================================================
   * TTSetCodeRange
   *
   * <Description>
   *    Sets a code range.
   *







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
...
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
  }

  /* ==================== toDebugString ===================================== */
  public String toDebugString() {
    StringBuffer str = new StringBuffer(mySelf()+"\n");
    return str.toString();
  }

  /* ==================== SkipCode ========================= */
  public boolean SkipCode() {
    IP += length;
    if (IP < codeSize) {
      opcode = TTOpCode.OpCode.getTableTag(code[IP].getVal() & 0xFF);
      length = opcode.getOpCodeLength();
      if (length < 0) {
        if (IP + 1 >= codeSize) {
          error = FTError.ErrorTag.INTERP_CODE_OVERFLOW;
          return false;
        }
        length = 2 - length * (code[IP + 1].getVal() & 0xFF);
      }
      if (IP + length <= codeSize) {
        return true;
      }
    }
    return false;
  }

  /* =====================================================================
   * <Function>
   *    InitContext
   *
   * <Description>
   *    Initializes a context object.
................................................................................
    zp0.copy(pts);
    pts.setN_points(0);
    pts.setN_contours(0);

    instruction_trap = false;
    return error;
  }

  /* =====================================================================
   * TTRunContext
   * =====================================================================
   */

  public FTError.ErrorTag TTRunContext(boolean debug) {
    FTError.ErrorTag error;
    Debug(0, FTDebug.DebugTag.DBG_INTERP, TAG, String.format("TT_Run_Context %d", TTInterpTags.CodeRange.GLYPH)+" zp0.cur: "+zp0.getCur()+"\n zp1.cur: "+zp1.getCur());

    if ((error = TTGotoCodeRange(TTInterpTags.CodeRange.GLYPH, 0)) != FTError.ErrorTag.ERR_OK) {
      return error;
    }
    zp0 = pts;
    zp1 = pts;
    zp2 = pts;
    Debug(0, DebugTag.DBG_INTERP, TAG, "TT_Run_Context2 zp0.cur: "+zp0.getCur()+" \nzp1.cur: "+(Object)zp1.getCur());
    for( int i = 0; i < 6; i++) {
//  Debug(0, DebugTag.DBG_INTERP, TAG, String.format("zp1.org: %d x: %d, y: %d\n", i, cur.zp1.org[i].x, cur.zp1.org[i].y));
//  Debug(0, DebugTag.DBG_INTERP, TAG, String.format("zp0.org: %d x: %d, y: %d\n", i, cur.zp0.org[i].x, cur.zp0.org[i].y));
    }
    graphics_state.setGep0(1);
    graphics_state.setGep1(1);
    graphics_state.setGep2(1);
    graphics_state.getProjVector().x = 0x4000;
    graphics_state.getProjVector().y = 0x0000;
    graphics_state.getFreeVector().x = graphics_state.getProjVector().x;
    graphics_state.getFreeVector().y = graphics_state.getProjVector().y;
    graphics_state.getDualVector().x = graphics_state.getProjVector().x;
    graphics_state.getDualVector().y = graphics_state.getProjVector().y;
    graphics_state.setRound_state(TTInterpTags.Round.To_Grid);
    graphics_state.setLoop(1);
    /* some glyphs leave something on the stack. so we clean it */
    /* before a new execution.                                  */
    top = 0;
    callTop = 0;
    return face.Interpreter(this);
  }

  /* =====================================================================
   * TTSetCodeRange
   *
   * <Description>
   *    Sets a code range.
   *

Changes to aftttinterpreter/TTGraphicsStateRec.java.

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
  /*    TTGraphicsStateRec                                                    */
  /*                                                                       */
  /* <Description>                                                         */
  /*    The TrueType graphics state used during bytecode interpretation.   */
  /* ===================================================================== */


import org.apwtcl.apwfreetypelib.afttruetype.TTTags;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;
import org.apwtcl.apwfreetypelib.aftutil.FTVectorRec;

public class TTGraphicsStateRec extends FTDebug {
  private static int oid = 0;

  private int id;
................................................................................
  protected int rp1;
  protected int rp2;
  protected FTVectorRec dualVector;
  protected FTVectorRec projVector;
  protected FTVectorRec freeVector;
  protected int loop;
  protected int minimum_distance;
  protected TTInterpTags.RoundState round_state;
  protected boolean auto_flip;
  protected int control_value_cutin;
  protected int single_width_cutin;
  protected int single_width_value;
  protected int delta_base;
  protected int delta_shift;
  protected byte instruct_control;
................................................................................

  /* ==================== setMinimum_distance ================================== */
  public void setMinimum_distance(int minimum_distance) {
    this.minimum_distance = minimum_distance;
  }

  /* ==================== getRound_state ================================== */
  public TTInterpTags.RoundState getRound_state() {
    return round_state;
  }

  /* ==================== setRound_state ================================== */
  public void setRound_state(TTInterpTags.RoundState round_state) {
    this.round_state = round_state;
  }

  /* ==================== isAuto_flip ================================== */
  public boolean isAuto_flip() {
    return auto_flip;
  }







<







 







|







 







|




|







20
21
22
23
24
25
26

27
28
29
30
31
32
33
..
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
  /*    TTGraphicsStateRec                                                    */
  /*                                                                       */
  /* <Description>                                                         */
  /*    The TrueType graphics state used during bytecode interpretation.   */
  /* ===================================================================== */



import org.apwtcl.apwfreetypelib.aftutil.FTDebug;
import org.apwtcl.apwfreetypelib.aftutil.FTVectorRec;

public class TTGraphicsStateRec extends FTDebug {
  private static int oid = 0;

  private int id;
................................................................................
  protected int rp1;
  protected int rp2;
  protected FTVectorRec dualVector;
  protected FTVectorRec projVector;
  protected FTVectorRec freeVector;
  protected int loop;
  protected int minimum_distance;
  protected TTInterpTags.Round round_state;
  protected boolean auto_flip;
  protected int control_value_cutin;
  protected int single_width_cutin;
  protected int single_width_value;
  protected int delta_base;
  protected int delta_shift;
  protected byte instruct_control;
................................................................................

  /* ==================== setMinimum_distance ================================== */
  public void setMinimum_distance(int minimum_distance) {
    this.minimum_distance = minimum_distance;
  }

  /* ==================== getRound_state ================================== */
  public TTInterpTags.Round getRound_state() {
    return round_state;
  }

  /* ==================== setRound_state ================================== */
  public void setRound_state(TTInterpTags.Round round_state) {
    this.round_state = round_state;
  }

  /* ==================== isAuto_flip ================================== */
  public boolean isAuto_flip() {
    return auto_flip;
  }

Changes to aftttinterpreter/TTInstructionFuncGrp1.java.

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
...
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
...
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
...
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
...
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390

  /* ==================== toDebugString ===================================== */
  public String toDebugString() {
    StringBuffer str = new StringBuffer(mySelf()+"\n");
    return str.toString();
  }

  /* =====================================================================
   *
   * MANAGING THE FLOW OF CONTROL
   *
   *   Instructions appear in the specification's order.
   *
   * =====================================================================
   */
  public static boolean SkipCode(TTExecContextRec cur) {
    cur.IP += cur.length;
    if ( cur.IP < cur.codeSize ) {
      cur.opcode = TTOpCode.OpCode.getTableTag(cur.code[cur.IP].getVal() & 0xFF);
      cur.length = cur.opcode.getOpCodeLength();
      if (cur.length < 0) {
        if (cur.IP + 1 >= cur.codeSize) {
          cur.error = FTError.ErrorTag.INTERP_CODE_OVERFLOW;
          return false;
        }
        cur.length = 2 - cur.length * (cur.code[cur.IP + 1].getVal() & 0xFF);
      }
      if (cur.IP + cur.length <= cur.codeSize) {
        return true;
      }
    }
    return false;
  }

  /* =====================================================================
   * SVTCA[a]:     Set (F and P) Vectors to Coordinate Axis
   * Opcode range: 0x00-0x01
   * Stack:        -->
   * =====================================================================
   */
  public void SVTCA() {
    int A;
    int B;

    A = ((cur.opcode.getVal() & 1) << 14);
    B = (A ^ (short)0x4000);
    cur.graphics_state.freeVector.x = A;
    cur.graphics_state.projVector.x = A;
    cur.graphics_state.dualVector.x = A;
    cur.graphics_state.freeVector.y = B;
    cur.graphics_state.projVector.y = B;
    cur.graphics_state.dualVector.y = B;
    cur.render_funcs.ComputeFuncs(cur);
................................................................................
   * Stack:        -->
   * =====================================================================
   */
  public void SPVTCA() {
    int A;
    int B;

    A = ((cur.opcode.getVal() & 1) << 14);
    B = (A ^ (short)0x4000);
    cur.graphics_state.projVector.x = A;
    cur.graphics_state.dualVector.x = A;
    cur.graphics_state.projVector.y = B;
    cur.graphics_state.dualVector.y = B;
    cur.render_funcs.ComputeFuncs(cur);
  }

................................................................................
   * Stack:        -->
   * =====================================================================
   */
  public void SFVTCA() {
    int A;
    int B;

    A = ((cur.opcode.getVal() & 1) << 14);
    B = (A ^ (short)0x4000);
    cur.graphics_state.freeVector.x = A;
    cur.graphics_state.freeVector.y = B;
    cur.render_funcs.ComputeFuncs(cur);
  }

  /* =====================================================================
   * SRP0[]:       Set Reference Point 0
   * Opcode range: 0x10
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void SRP0() {
    cur.graphics_state.rp0 = (short)cur.stack[cur.stack_idx];
Debug(0, DebugTag.DBG_INTERP, TAG, String.format("DO_SRP0: cur.GS.rp0: %d cur.stack_idx: %d", cur.graphics_state.rp0, cur.stack_idx));
  }


  /* =====================================================================
   * SRP1[]:       Set Reference Point 1
   * Opcode range: 0x11
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void SRP1() {
    cur.graphics_state.rp1 = (short)cur.stack[cur.stack_idx];
  }


  /* =====================================================================
   * SRP2[]:       Set Reference Point 2
   * Opcode range: 0x12
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void SRP2() {
    cur.graphics_state.rp2 = (short)cur.stack[cur.stack_idx];
  }


  /* =====================================================================
   * SZP0[]:       Set Zone Pointer 0
   * Opcode range: 0x13
   * Stack:        uint32 -->
................................................................................
        break;
      default:
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.graphics_state.gep0 = (short)cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SZP1[]:       Set Zone Pointer 1
   * Opcode range: 0x14
   * Stack:        uint32 -->
   * =====================================================================
................................................................................
        break;
      default:
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.graphics_state.gep1 = (short)cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SZP2[]:       Set Zone Pointer 2
   * Opcode range: 0x15
   * Stack:        uint32 -->
   * =====================================================================
................................................................................
        break;
      default:
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.graphics_state.gep2 = (short)cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SZPS[]:       Set Zone PointerS
   * Opcode range: 0x16
   * Stack:        uint32 -->
   * =====================================================================
................................................................................
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.zp1 = cur.zp0;
    cur.zp2 = cur.zp0;
    cur.graphics_state.gep0 = (short)cur.stack[cur.stack_idx + 0];
    cur.graphics_state.gep1 = (short)cur.stack[cur.stack_idx + 0];
    cur.graphics_state.gep2 = (short)cur.stack[cur.stack_idx + 0];
  }

  /* =====================================================================
   * SLOOP[]:      Set LOOP variable
   * Opcode range: 0x17
   * Stack:        int32? -->
   * =====================================================================
   */
  public void SLOOP() {
    if (cur.stack[cur.stack_idx + 0] < 0) {
      cur.error = FTError.ErrorTag.INTERP_BAD_ARGUMENT;
    } else {
      cur.graphics_state.loop = cur.stack[cur.stack_idx + 0];
    }
  }

  /* =====================================================================
   * RTG[]:        Round To Grid
   * Opcode range: 0x18
   * Stack:        -->
   * =====================================================================
   */
  public void RTG() {
    cur.graphics_state.round_state = TTInterpTags.RoundState.To_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_to_grid;
  }

  /* =====================================================================
   * RTHG[]:       Round To Half Grid
   * Opcode range: 0x19
   * Stack:        -->
   * =====================================================================
   */
  public void RTHG() {
    cur.graphics_state.round_state = TTInterpTags.RoundState.To_Half_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_to_half_grid;
  }

  /* =====================================================================
   * SMD[]:        Set Minimum Distance
   * Opcode range: 0x1A
   * Stack:        f26.6 -->
   * =====================================================================
   */
  public void SMD() {
    cur.graphics_state.minimum_distance = cur.stack[cur.stack_idx + 0];
  }

  /* =====================================================================
   * ELSE[]:       ELSE
   * Opcode range: 0x1B
   * Stack:        -->
   * =====================================================================
   */
  public void ELSE() {
    int nIfs;

    nIfs = 1;
    do {
      if (SkipCode(cur) == false) {
        return;
      }
      switch (cur.opcode) {
        case IF:    /* IF */
          nIfs++;
          break;
        case EIF:    /* EIF */
          nIfs--;
          break;
      }
    } while (nIfs != 0);
  }

  /* =====================================================================
   * JMPR[]:       JuMP Relative
   * Opcode range: 0x1C
   * Stack:        int32 -->
   * =====================================================================
................................................................................
  /* =====================================================================
   * SCVTCI[]:     Set Control Value Table Cut In
   * Opcode range: 0x1D
   * Stack:        f26.6 -->
   * =====================================================================
   */
  public void SCVTCI() {
    cur.graphics_state.control_value_cutin = (int)cur.stack[cur.stack_idx + 0];
  }

  /* =====================================================================
   * SSWCI[]:      Set Single Width Cut In
   * Opcode range: 0x1E
   * Stack:        f26.6 -->
   * =====================================================================
   */
  public void SSWCI() {
    cur.graphics_state.single_width_cutin = (int)cur.stack[cur.stack_idx + 0];
  }

  /* =====================================================================
   * SSW[]:        Set Single Width
   * Opcode range: 0x1F
   * Stack:        int32? -->
   * =====================================================================
   */
  public void SSW() {
    cur.graphics_state.single_width_value = FTCalc.FTMulFix(cur.stack[cur.stack_idx + 0], cur.tt_metrics.getScale());
  }

}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










|
|







 







|
|







 







|
|












|











|










|







 







|







 







|







 







|







 







|
|
|












|










|










|










|









|

|

|




|


|


|







 







|









|









|



50
51
52
53
54
55
56



























57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
...
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363

  /* ==================== toDebugString ===================================== */
  public String toDebugString() {
    StringBuffer str = new StringBuffer(mySelf()+"\n");
    return str.toString();
  }




























  /* =====================================================================
   * SVTCA[a]:     Set (F and P) Vectors to Coordinate Axis
   * Opcode range: 0x00-0x01
   * Stack:        -->
   * =====================================================================
   */
  public void SVTCA() {
    int A;
    int B;

    A = (cur.opcode.getVal() & 1) << 14;
    B = A ^ 0x4000;
    cur.graphics_state.freeVector.x = A;
    cur.graphics_state.projVector.x = A;
    cur.graphics_state.dualVector.x = A;
    cur.graphics_state.freeVector.y = B;
    cur.graphics_state.projVector.y = B;
    cur.graphics_state.dualVector.y = B;
    cur.render_funcs.ComputeFuncs(cur);
................................................................................
   * Stack:        -->
   * =====================================================================
   */
  public void SPVTCA() {
    int A;
    int B;

    A = (cur.opcode.getVal() & 1) << 14;
    B = A ^ 0x4000;
    cur.graphics_state.projVector.x = A;
    cur.graphics_state.dualVector.x = A;
    cur.graphics_state.projVector.y = B;
    cur.graphics_state.dualVector.y = B;
    cur.render_funcs.ComputeFuncs(cur);
  }

................................................................................
   * Stack:        -->
   * =====================================================================
   */
  public void SFVTCA() {
    int A;
    int B;

    A = (cur.opcode.getVal() & 1) << 14;
    B = A ^ 0x4000;
    cur.graphics_state.freeVector.x = A;
    cur.graphics_state.freeVector.y = B;
    cur.render_funcs.ComputeFuncs(cur);
  }

  /* =====================================================================
   * SRP0[]:       Set Reference Point 0
   * Opcode range: 0x10
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void SRP0() {
    cur.graphics_state.rp0 = cur.stack[cur.stack_idx];
Debug(0, DebugTag.DBG_INTERP, TAG, String.format("DO_SRP0: cur.GS.rp0: %d cur.stack_idx: %d", cur.graphics_state.rp0, cur.stack_idx));
  }


  /* =====================================================================
   * SRP1[]:       Set Reference Point 1
   * Opcode range: 0x11
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void SRP1() {
    cur.graphics_state.rp1 = cur.stack[cur.stack_idx];
  }


  /* =====================================================================
   * SRP2[]:       Set Reference Point 2
   * Opcode range: 0x12
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void SRP2() {
    cur.graphics_state.rp2 = cur.stack[cur.stack_idx];
  }


  /* =====================================================================
   * SZP0[]:       Set Zone Pointer 0
   * Opcode range: 0x13
   * Stack:        uint32 -->
................................................................................
        break;
      default:
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.graphics_state.gep0 = cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SZP1[]:       Set Zone Pointer 1
   * Opcode range: 0x14
   * Stack:        uint32 -->
   * =====================================================================
................................................................................
        break;
      default:
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.graphics_state.gep1 = cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SZP2[]:       Set Zone Pointer 2
   * Opcode range: 0x15
   * Stack:        uint32 -->
   * =====================================================================
................................................................................
        break;
      default:
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.graphics_state.gep2 = cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SZPS[]:       Set Zone PointerS
   * Opcode range: 0x16
   * Stack:        uint32 -->
   * =====================================================================
................................................................................
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
        }
        return;
    }
    cur.zp1 = cur.zp0;
    cur.zp2 = cur.zp0;
    cur.graphics_state.gep0 = cur.stack[cur.stack_idx];
    cur.graphics_state.gep1 = cur.stack[cur.stack_idx];
    cur.graphics_state.gep2 = cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SLOOP[]:      Set LOOP variable
   * Opcode range: 0x17
   * Stack:        int32? -->
   * =====================================================================
   */
  public void SLOOP() {
    if (cur.stack[cur.stack_idx + 0] < 0) {
      cur.error = FTError.ErrorTag.INTERP_BAD_ARGUMENT;
    } else {
      cur.graphics_state.loop = cur.stack[cur.stack_idx];
    }
  }

  /* =====================================================================
   * RTG[]:        Round To Grid
   * Opcode range: 0x18
   * Stack:        -->
   * =====================================================================
   */
  public void RTG() {
    cur.graphics_state.round_state = TTInterpTags.Round.To_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_to_grid;
  }

  /* =====================================================================
   * RTHG[]:       Round To Half Grid
   * Opcode range: 0x19
   * Stack:        -->
   * =====================================================================
   */
  public void RTHG() {
    cur.graphics_state.round_state = TTInterpTags.Round.To_Half_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_to_half_grid;
  }

  /* =====================================================================
   * SMD[]:        Set Minimum Distance
   * Opcode range: 0x1A
   * Stack:        f26.6 -->
   * =====================================================================
   */
  public void SMD() {
    cur.graphics_state.minimum_distance = cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * ELSE[]:       ELSE
   * Opcode range: 0x1B
   * Stack:        -->
   * =====================================================================
   */
  public void ELSE() {
    int num_ifs;

    num_ifs = 1;
    do {
      if (cur.SkipCode() == false) {
        return;
      }
      switch (cur.opcode) {
        case IF:    /* IF */
          num_ifs++;
          break;
        case EIF:    /* EIF */
          num_ifs--;
          break;
      }
    } while (num_ifs != 0);
  }

  /* =====================================================================
   * JMPR[]:       JuMP Relative
   * Opcode range: 0x1C
   * Stack:        int32 -->
   * =====================================================================
................................................................................
  /* =====================================================================
   * SCVTCI[]:     Set Control Value Table Cut In
   * Opcode range: 0x1D
   * Stack:        f26.6 -->
   * =====================================================================
   */
  public void SCVTCI() {
    cur.graphics_state.control_value_cutin = cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SSWCI[]:      Set Single Width Cut In
   * Opcode range: 0x1E
   * Stack:        f26.6 -->
   * =====================================================================
   */
  public void SSWCI() {
    cur.graphics_state.single_width_cutin = cur.stack[cur.stack_idx];
  }

  /* =====================================================================
   * SSW[]:        Set Single Width
   * Opcode range: 0x1F
   * Stack:        int32? -->
   * =====================================================================
   */
  public void SSW() {
    cur.graphics_state.single_width_value = FTCalc.FTMulFix(cur.stack[cur.stack_idx], cur.tt_metrics.getScale());
  }

}

Changes to aftttinterpreter/TTInstructionFuncGrp2.java.

435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
      Debug(0, DebugTag.DBG_INTERP, TAG, "stack: "+cur.stack[j]+"!");
    }
    if (n > cur.maxFunc) {
      cur.maxFunc = n;
    }
      /* Now skip the whole function definition. */
      /* We don't allow nested IDEFS & FDEFs.    */
    while (TTInstructionFuncGrp1.SkipCode(cur) == true) {
      switch (cur.opcode) {
        case IDEF:    /* IDEF */
        case FDEF:    /* FDEF */
          cur.error = FTError.ErrorTag.INTERP_NESTED_DEFS;
          return;
        case ENDF:   /* ENDF */
          rec.setEnd(cur.IP);







|







435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
      Debug(0, DebugTag.DBG_INTERP, TAG, "stack: "+cur.stack[j]+"!");
    }
    if (n > cur.maxFunc) {
      cur.maxFunc = n;
    }
      /* Now skip the whole function definition. */
      /* We don't allow nested IDEFS & FDEFs.    */
    while (cur.SkipCode() == true) {
      switch (cur.opcode) {
        case IDEF:    /* IDEF */
        case FDEF:    /* FDEF */
          cur.error = FTError.ErrorTag.INTERP_NESTED_DEFS;
          return;
        case ENDF:   /* ENDF */
          rec.setEnd(cur.IP);

Changes to aftttinterpreter/TTInstructionFuncGrp3.java.

279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
...
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
...
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
...
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
...
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
...
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
    FTReference<TTIUPWorkerRec> worker_ref;
    Flags.Curve mask;
    int first_point;   /* first point of contour        */
    int end_point;     /* end point (last+1) of contour */
    int first_touched; /* first touched point in contour   */
    int cur_touched;   /* current touched point in contour */
    int point;         /* current point   */
    int contour;     /* current contour */
    boolean useX = true;

    Debug(0, DebugTag.DBG_INTERP, TAG, "insIUP");
      /* ignore empty outlines */
    if (cur.pts.getN_contours() == 0) {
      return;
    }
//FTGlyphLoaderRec._showLoaderZone("insIUP");
................................................................................
      V.curs = cur.pts.getCur();
//        V.cur_idx = cur.pts.cur_idx + 1;
      V.cur_idx = cur.pts.getCur_idx();
      V.orus = cur.pts.getOrus();
//        V.orus_idx = cur.pts.orus_idx + 1;
      V.orus_idx = cur.pts.getOrus_idx();
    }
    V.max_points = (int)cur.pts.getN_points();
    contour = 0;
    point = 0;
    do {
      end_point = cur.pts.getContours()[contour] - cur.pts.getFirst_point();
      first_point = point;
      if (TTUtil.BOUNDS(end_point, cur.pts.getN_points())) {
        end_point = cur.pts.getN_points() - 1;
      }
      while (point <= end_point && (cur.pts.getTags()[point].getVal() & mask.getVal()) == 0) {
        point++;
      }
      worker_ref = new FTReference<TTIUPWorkerRec>();
      worker_ref.Set(V);
      if (point <= end_point) {
        first_touched = point;
        cur_touched   = point;
        point++;
        while (point <= end_point) {
          if ((cur.pts.getTags()[point].getVal() & mask.getVal()) != 0) {
................................................................................
  /* =====================================================================
   * SHP[a]:       SHift Point by the last point
   * Opcode range: 0x32-0x33
   * Stack:        uint32... -->
   * =====================================================================
   */
  public void SHP() {
    TTGlyphZoneRec zp;
    int ref;
    int dx;
    int dy;
    int point;
    FTReference<Integer> dx_ref = new FTReference<>();
    FTReference<Integer> dy_ref = new FTReference<>();
    FTReference<TTGlyphZoneRec> zp_ref = new FTReference<TTGlyphZoneRec>();
    FTReference<Integer> int_ref = new FTReference<>();

    if (cur.top < cur.graphics_state.loop) {
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
      }
      cur.graphics_state.loop = 1;
................................................................................
    int contour;
    int bounds;
    int start;
    int limit;
    int i;
    FTReference<Integer> dx_ref = new FTReference<>();
    FTReference<Integer> dy_ref = new FTReference<>();
    FTReference<TTGlyphZoneRec> zp_ref = new FTReference<TTGlyphZoneRec>();
    FTReference<Integer> int_ref = new FTReference<>();

    contour = cur.stack[cur.stack_idx];
    bounds  = (cur.graphics_state.gep2 == 0) ? 1 : cur.zp2.getN_contours();
    if (TTUtil.BOUNDS(contour, bounds)) {
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
................................................................................
    int ref;
    int dx;
    int dy;
    int limit;
    int i;
    FTReference<Integer> dx_ref = new FTReference<>();
    FTReference<Integer> dy_ref = new FTReference<>();
    FTReference<TTGlyphZoneRec> zp_ref = new FTReference<TTGlyphZoneRec>();
    FTReference<Integer> int_ref = new FTReference<>();

    if (TTUtil.BOUNDS(cur.stack[cur.stack_idx + 0], 2)) {
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
      }
      return;
    }
    if (ComputePointDisplacement(dx_ref, dy_ref, zp_ref, int_ref)) {
      return;
................................................................................
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
      }
      cur.graphics_state.loop = 1;
      cur.new_top = cur.stack_idx;
      return;
    }
    dx = TTUtil.TTMulFix14(cur.stack[cur.stack_idx + 0], cur.graphics_state.freeVector.x);
    dy = TTUtil.TTMulFix14(cur.stack[cur.stack_idx + 0], cur.graphics_state.freeVector.y);
    while (cur.graphics_state.loop > 0) {
      cur.stack_idx--;
      point = cur.stack[cur.stack_idx];
      if (TTUtil.BOUNDS(point, cur.zp2.getN_points())) {
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
          return;
................................................................................
   * RTDG[]:       Round To Double Grid
   * Opcode range: 0x3D
   * Stack:        -->
   *
   * =====================================================================
   */
  public void RTDG() {
    cur.graphics_state.round_state = TTInterpTags.RoundState.To_Double_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_to_double_grid;
  }

  /* =====================================================================
   * MIAP[a]:      Move Indirect Absolute Point
   * Opcode range: 0x3E-0x3F
   * Stack:        uint32 uint32 -->
................................................................................
    }
    org_dist = cur.funcProject(cur.zp0.getCurPoint_x(point) - cur.zp0.getCurPoint_x(point),
        cur.zp0.getCurPoint_y(point) - cur.zp0.getCurPoint_y(point));
    if ((cur.opcode.getVal() & 1) != 0) {  /* rounding and control cut-in flag */
      if (FTCalc.FT_ABS(distance - org_dist) > control_value_cutin) {
        distance = org_dist;
      }
      distance = (int)cur.funcRound(distance, cur.tt_metrics.getCompensations()[0]);
    }
    cur.funcMove(cur.zp0, point, distance - org_dist);
    cur.graphics_state.rp0 = point;
    cur.graphics_state.rp1 = point;
  }

}







|
|







 







|











|







 







<
<





|







 







|







 







|


|







 







|
|







 







|







 







|







279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
359
360
361
362
363
364
365


366
367
368
369
370
371
372
373
374
375
376
377
378
...
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
...
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
...
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
...
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
...
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
    FTReference<TTIUPWorkerRec> worker_ref;
    Flags.Curve mask;
    int first_point;   /* first point of contour        */
    int end_point;     /* end point (last+1) of contour */
    int first_touched; /* first touched point in contour   */
    int cur_touched;   /* current touched point in contour */
    int point;         /* current point   */
    int contour;       /* current contour */
    boolean useX;

    Debug(0, DebugTag.DBG_INTERP, TAG, "insIUP");
      /* ignore empty outlines */
    if (cur.pts.getN_contours() == 0) {
      return;
    }
//FTGlyphLoaderRec._showLoaderZone("insIUP");
................................................................................
      V.curs = cur.pts.getCur();
//        V.cur_idx = cur.pts.cur_idx + 1;
      V.cur_idx = cur.pts.getCur_idx();
      V.orus = cur.pts.getOrus();
//        V.orus_idx = cur.pts.orus_idx + 1;
      V.orus_idx = cur.pts.getOrus_idx();
    }
    V.max_points = cur.pts.getN_points();
    contour = 0;
    point = 0;
    do {
      end_point = cur.pts.getContours()[contour] - cur.pts.getFirst_point();
      first_point = point;
      if (TTUtil.BOUNDS(end_point, cur.pts.getN_points())) {
        end_point = cur.pts.getN_points() - 1;
      }
      while (point <= end_point && (cur.pts.getTags()[point].getVal() & mask.getVal()) == 0) {
        point++;
      }
      worker_ref = new FTReference<>();
      worker_ref.Set(V);
      if (point <= end_point) {
        first_touched = point;
        cur_touched   = point;
        point++;
        while (point <= end_point) {
          if ((cur.pts.getTags()[point].getVal() & mask.getVal()) != 0) {
................................................................................
  /* =====================================================================
   * SHP[a]:       SHift Point by the last point
   * Opcode range: 0x32-0x33
   * Stack:        uint32... -->
   * =====================================================================
   */
  public void SHP() {


    int dx;
    int dy;
    int point;
    FTReference<Integer> dx_ref = new FTReference<>();
    FTReference<Integer> dy_ref = new FTReference<>();
    FTReference<TTGlyphZoneRec> zp_ref = new FTReference<>();
    FTReference<Integer> int_ref = new FTReference<>();

    if (cur.top < cur.graphics_state.loop) {
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
      }
      cur.graphics_state.loop = 1;
................................................................................
    int contour;
    int bounds;
    int start;
    int limit;
    int i;
    FTReference<Integer> dx_ref = new FTReference<>();
    FTReference<Integer> dy_ref = new FTReference<>();
    FTReference<TTGlyphZoneRec> zp_ref = new FTReference<>();
    FTReference<Integer> int_ref = new FTReference<>();

    contour = cur.stack[cur.stack_idx];
    bounds  = (cur.graphics_state.gep2 == 0) ? 1 : cur.zp2.getN_contours();
    if (TTUtil.BOUNDS(contour, bounds)) {
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
................................................................................
    int ref;
    int dx;
    int dy;
    int limit;
    int i;
    FTReference<Integer> dx_ref = new FTReference<>();
    FTReference<Integer> dy_ref = new FTReference<>();
    FTReference<TTGlyphZoneRec> zp_ref = new FTReference<>();
    FTReference<Integer> int_ref = new FTReference<>();

    if (TTUtil.BOUNDS(cur.stack[cur.stack_idx], 2)) {
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
      }
      return;
    }
    if (ComputePointDisplacement(dx_ref, dy_ref, zp_ref, int_ref)) {
      return;
................................................................................
      if (cur.pedantic_hinting) {
        cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
      }
      cur.graphics_state.loop = 1;
      cur.new_top = cur.stack_idx;
      return;
    }
    dx = TTUtil.TTMulFix14(cur.stack[cur.stack_idx], cur.graphics_state.freeVector.x);
    dy = TTUtil.TTMulFix14(cur.stack[cur.stack_idx], cur.graphics_state.freeVector.y);
    while (cur.graphics_state.loop > 0) {
      cur.stack_idx--;
      point = cur.stack[cur.stack_idx];
      if (TTUtil.BOUNDS(point, cur.zp2.getN_points())) {
        if (cur.pedantic_hinting) {
          cur.error = FTError.ErrorTag.INTERP_INVALID_REFERENCE;
          return;
................................................................................
   * RTDG[]:       Round To Double Grid
   * Opcode range: 0x3D
   * Stack:        -->
   *
   * =====================================================================
   */
  public void RTDG() {
    cur.graphics_state.round_state = TTInterpTags.Round.To_Double_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_to_double_grid;
  }

  /* =====================================================================
   * MIAP[a]:      Move Indirect Absolute Point
   * Opcode range: 0x3E-0x3F
   * Stack:        uint32 uint32 -->
................................................................................
    }
    org_dist = cur.funcProject(cur.zp0.getCurPoint_x(point) - cur.zp0.getCurPoint_x(point),
        cur.zp0.getCurPoint_y(point) - cur.zp0.getCurPoint_y(point));
    if ((cur.opcode.getVal() & 1) != 0) {  /* rounding and control cut-in flag */
      if (FTCalc.FT_ABS(distance - org_dist) > control_value_cutin) {
        distance = org_dist;
      }
      distance = cur.funcRound(distance, cur.tt_metrics.getCompensations()[0]);
    }
    cur.funcMove(cur.zp0, point, distance - org_dist);
    cur.graphics_state.rp0 = point;
    cur.graphics_state.rp1 = point;
  }

}

Changes to aftttinterpreter/TTInstructionFuncGrp5.java.

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
    Debug(0, DebugTag.DBG_INTERP, TAG, String.format("insIF: %d\n", cur.stack[cur.stack_idx + 0]));
    if (cur.stack[cur.stack_idx + 0] != 0) {
      return;
    }
    nIfs = 1;
    Out = false;
    do {
      if (TTInstructionFuncGrp1.SkipCode(cur) == false) {
        return;
      }
      switch (cur.opcode) {
        case IF:      /* IF */
          nIfs++;
          break;
        case ELSE:      /* ELSE */







|







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
    Debug(0, DebugTag.DBG_INTERP, TAG, String.format("insIF: %d\n", cur.stack[cur.stack_idx + 0]));
    if (cur.stack[cur.stack_idx + 0] != 0) {
      return;
    }
    nIfs = 1;
    Out = false;
    do {
      if (cur.SkipCode() == false) {
        return;
      }
      switch (cur.opcode) {
        case IF:      /* IF */
          nIfs++;
          break;
        case ELSE:      /* ELSE */

Changes to aftttinterpreter/TTInstructionFuncGrp7.java.

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
...
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
   * SROUND[]:     Super ROUND
   * Opcode range: 0x76
   * Stack:        Eint8 -->
   * =====================================================================
   */
  public void SROUND() {
    cur.render_funcs.round_super.SetSuperRound(0x4000, cur.stack[cur.stack_idx + 0]);
    cur.graphics_state.round_state = TTInterpTags.RoundState.Super;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_super;
  }

  /* =====================================================================
   * S45ROUND[]:   Super ROUND 45 degrees
   * Opcode range: 0x77
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void S45ROUND() {
    cur.render_funcs.round_super.SetSuperRound(0x2D41, cur.stack[cur.stack_idx + 0]);
    cur.graphics_state.round_state = TTInterpTags.RoundState.Super_45;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_super45;
  }

  /* =====================================================================
   * JROT[]:       Jump Relative On True
   * Opcode range: 0x78
   * Stack:        StkElt int32 -->
................................................................................
  /* =====================================================================
   * ROFF[]:       Round OFF
   * Opcode range: 0x7A
   * Stack:        -->
   * =====================================================================
   */
  public void ROFF() {
    cur.graphics_state.round_state = TTInterpTags.RoundState.Off;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_none;
  }

  /* =====================================================================
   * RUTG[]:       Round Up To Grid
   * Opcode range: 0x7C
   * Stack:        -->
   * =====================================================================
   */
  public void RUTG() {
    cur.graphics_state.round_state = TTInterpTags.RoundState.Up_To_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_up_to_grid;
  }

  /* =====================================================================
   * RDTG[]:       Round Down To Grid
   * Opcode range: 0x7D
   * Stack:        -->
   * =====================================================================
   */
  public void RDTG() {
    cur.graphics_state.round_state = TTInterpTags.RoundState.Down_To_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_down_to_grid;
  }

}







|











|







 







|










|










|




134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
...
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
   * SROUND[]:     Super ROUND
   * Opcode range: 0x76
   * Stack:        Eint8 -->
   * =====================================================================
   */
  public void SROUND() {
    cur.render_funcs.round_super.SetSuperRound(0x4000, cur.stack[cur.stack_idx + 0]);
    cur.graphics_state.round_state = TTInterpTags.Round.Super;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_super;
  }

  /* =====================================================================
   * S45ROUND[]:   Super ROUND 45 degrees
   * Opcode range: 0x77
   * Stack:        uint32 -->
   * =====================================================================
   */
  public void S45ROUND() {
    cur.render_funcs.round_super.SetSuperRound(0x2D41, cur.stack[cur.stack_idx + 0]);
    cur.graphics_state.round_state = TTInterpTags.Round.Super_45;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_super45;
  }

  /* =====================================================================
   * JROT[]:       Jump Relative On True
   * Opcode range: 0x78
   * Stack:        StkElt int32 -->
................................................................................
  /* =====================================================================
   * ROFF[]:       Round OFF
   * Opcode range: 0x7A
   * Stack:        -->
   * =====================================================================
   */
  public void ROFF() {
    cur.graphics_state.round_state = TTInterpTags.Round.Off;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_none;
  }

  /* =====================================================================
   * RUTG[]:       Round Up To Grid
   * Opcode range: 0x7C
   * Stack:        -->
   * =====================================================================
   */
  public void RUTG() {
    cur.graphics_state.round_state = TTInterpTags.Round.Up_To_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_up_to_grid;
  }

  /* =====================================================================
   * RDTG[]:       Round Down To Grid
   * Opcode range: 0x7D
   * Stack:        -->
   * =====================================================================
   */
  public void RDTG() {
    cur.graphics_state.round_state = TTInterpTags.Round.Down_To_Grid;
    cur.render_funcs.curr_round_func = cur.render_funcs.round_down_to_grid;
  }

}

Changes to aftttinterpreter/TTInstructionFuncGrp8.java.

329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
    def.setRange(cur.curRange.getVal());
    def.setActive(true);
    if (cur.stack[cur.stack_idx + 0] > cur.maxIns) {
      cur.maxIns = (byte)cur.stack[cur.stack_idx + 0];
    }
      /* Now skip the whole function definition. */
      /* We don't allow nested IDEFs & FDEFs.    */
    while (TTInstructionFuncGrp1.SkipCode(cur) == true) {
      switch (cur.opcode) {
        case IDEF:   /* IDEF */
        case FDEF:   /* FDEF */
          cur.error = FTError.ErrorTag.INTERP_NESTED_DEFS;
          return;
        case ENDF:   /* ENDF */
          return;







|







329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
    def.setRange(cur.curRange.getVal());
    def.setActive(true);
    if (cur.stack[cur.stack_idx + 0] > cur.maxIns) {
      cur.maxIns = (byte)cur.stack[cur.stack_idx + 0];
    }
      /* Now skip the whole function definition. */
      /* We don't allow nested IDEFs & FDEFs.    */
    while (cur.SkipCode() == true) {
      switch (cur.opcode) {
        case IDEF:   /* IDEF */
        case FDEF:   /* FDEF */
          cur.error = FTError.ErrorTag.INTERP_NESTED_DEFS;
          return;
        case ENDF:   /* ENDF */
          return;

Changes to aftttinterpreter/TTInterpTags.java.

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
public class TTInterpTags {
  /* =====================================================================
   *
   * Rounding mode enum.
   *
   * =====================================================================
   */
  public enum RoundState {
    To_Half_Grid(0, "TT_Round_To_Half_Grid"),
    To_Grid(1, "TT_Round_To_Grid"),
    To_Double_Grid(2, "TT_Round_To_Double_Grid"),
    Down_To_Grid(3, "TT_Round_Down_To_Grid"),
    Up_To_Grid(4, "TT_Round_Up_To_Grid"),
    Off(5, "TT_Round_Off"),
    Super(6, "TT_Round_Super"),
    Super_45(7, "TT_Round_Super_45");
    private int val;
    private String str;
    private static SparseArray<RoundState> tagToRoundStateMapping;
    public static RoundState getTableTag(int i) {
      if (tagToRoundStateMapping == null) {
        initMapping();
      }
      return tagToRoundStateMapping.get(i);
    }
    private static void initMapping() {
      tagToRoundStateMapping = new SparseArray<RoundState>();
      for (RoundState t : values()) {
        tagToRoundStateMapping.put(t.val, t);
      }
    }
    private RoundState(int val, String str) {
      this.val = val;
      this.str = str;
    }
    public int getVal() {
      return val;
    }
  }







|










|
|






|
|



|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
public class TTInterpTags {
  /* =====================================================================
   *
   * Rounding mode enum.
   *
   * =====================================================================
   */
  public enum Round {
    To_Half_Grid(0, "TT_Round_To_Half_Grid"),
    To_Grid(1, "TT_Round_To_Grid"),
    To_Double_Grid(2, "TT_Round_To_Double_Grid"),
    Down_To_Grid(3, "TT_Round_Down_To_Grid"),
    Up_To_Grid(4, "TT_Round_Up_To_Grid"),
    Off(5, "TT_Round_Off"),
    Super(6, "TT_Round_Super"),
    Super_45(7, "TT_Round_Super_45");
    private int val;
    private String str;
    private static SparseArray<Round> tagToRoundStateMapping;
    public static Round getTableTag(int i) {
      if (tagToRoundStateMapping == null) {
        initMapping();
      }
      return tagToRoundStateMapping.get(i);
    }
    private static void initMapping() {
      tagToRoundStateMapping = new SparseArray<Round>();
      for (Round t : values()) {
        tagToRoundStateMapping.put(t.val, t);
      }
    }
    private Round(int val, String str) {
      this.val = val;
      this.str = str;
    }
    public int getVal() {
      return val;
    }
  }

Changes to aftttinterpreter/TTMoveFunc.java.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  /* ===================================================================== */
  /*    TTMoveFunc                                                         */
  /*    set of Move functions for interpreter                              */
  /* ===================================================================== */

import android.util.Log;

import org.apwtcl.apwfreetypelib.aftbase.FTOutlineRec;
import org.apwtcl.apwfreetypelib.aftbase.Flags;
import org.apwtcl.apwfreetypelib.afttruetype.TTGlyphZoneRec;
import org.apwtcl.apwfreetypelib.afttruetype.TTInterpRun;
import org.apwtcl.apwfreetypelib.aftutil.FTCalc;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;
import org.apwtcl.apwfreetypelib.aftutil.FTError;

public class TTMoveFunc extends TTMoveFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTMoveFunc";








<


<

<
<







16
17
18
19
20
21
22

23
24

25


26
27
28
29
30
31
32
  /* ===================================================================== */
  /*    TTMoveFunc                                                         */
  /*    set of Move functions for interpreter                              */
  /* ===================================================================== */

import android.util.Log;


import org.apwtcl.apwfreetypelib.aftbase.Flags;
import org.apwtcl.apwfreetypelib.afttruetype.TTGlyphZoneRec;

import org.apwtcl.apwfreetypelib.aftutil.FTCalc;



public class TTMoveFunc extends TTMoveFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTMoveFunc";

Changes to aftttinterpreter/TTMoveYFunc.java.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 */

  /* ===================================================================== */
  /*    TTMoveYFunc                                                        */
  /*    et of Move functions for interpreter                               */
  /* ===================================================================== */

import android.util.Log;

import org.apwtcl.apwfreetypelib.aftbase.FTOutlineRec;
import org.apwtcl.apwfreetypelib.aftbase.Flags;
import org.apwtcl.apwfreetypelib.afttruetype.TTGlyphZoneRec;
import org.apwtcl.apwfreetypelib.afttruetype.TTInterpRun;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;
import org.apwtcl.apwfreetypelib.aftutil.FTError;

public class TTMoveYFunc extends TTMoveFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTMoveYFunc";








<
<
<


<
<
<







14
15
16
17
18
19
20



21
22



23
24
25
26
27
28
29
 */

  /* ===================================================================== */
  /*    TTMoveYFunc                                                        */
  /*    et of Move functions for interpreter                               */
  /* ===================================================================== */




import org.apwtcl.apwfreetypelib.aftbase.Flags;
import org.apwtcl.apwfreetypelib.afttruetype.TTGlyphZoneRec;




public class TTMoveYFunc extends TTMoveFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTMoveYFunc";

Changes to aftttinterpreter/TTProjectFunc.java.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 */

  /* ===================================================================== */
  /*    TTProjectFunc                                                      */
  /*    set of Project functions for interpreter                           */
  /* ===================================================================== */

import android.util.Log;

import org.apwtcl.apwfreetypelib.afttruetype.TTInterpRun;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;
import org.apwtcl.apwfreetypelib.aftutil.FTError;

public class TTProjectFunc extends TTProjectFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTProjectFunc";








<
<
<
<
<







14
15
16
17
18
19
20





21
22
23
24
25
26
27
 */

  /* ===================================================================== */
  /*    TTProjectFunc                                                      */
  /*    set of Project functions for interpreter                           */
  /* ===================================================================== */







public class TTProjectFunc extends TTProjectFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTProjectFunc";

Changes to aftttinterpreter/TTProjectXFunc.java.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 */

  /* ===================================================================== */
  /*    TTProjectXFunc                                                     */
  /*    set of Project functions for interpreter                           */
  /* ===================================================================== */

import android.util.Log;

import org.apwtcl.apwfreetypelib.afttruetype.TTInterpRun;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;
import org.apwtcl.apwfreetypelib.aftutil.FTError;

public class TTProjectXFunc extends TTProjectFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTProjectXFunc";

  /* ==================== TTProjectXFunc ================================== */







<
<
<
<
<
<







14
15
16
17
18
19
20






21
22
23
24
25
26
27
 */

  /* ===================================================================== */
  /*    TTProjectXFunc                                                     */
  /*    set of Project functions for interpreter                           */
  /* ===================================================================== */







public class TTProjectXFunc extends TTProjectFuncBase {
  private static int oid = 0;

  private int id;
  private static String TAG = "TTProjectXFunc";

  /* ==================== TTProjectXFunc ================================== */

Changes to aftttinterpreter/TTRenderFunc.java.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
 */

  /* ===================================================================== */
  /*    TTRenderFunc                                                       */
  /*    references to render functions for interpreter                     */
  /* ===================================================================== */

import android.util.Log;

import org.apwtcl.apwfreetypelib.afttruetype.TTInterpRun;
import org.apwtcl.apwfreetypelib.afttruetype.TTTags;
import org.apwtcl.apwfreetypelib.aftutil.FTCalc;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;

public class TTRenderFunc extends FTDebug {
  private static int oid = 0;

  private int id;
................................................................................
   *    Sets the rounding mode.
   *
   * <Input>
   *    round_mode :: The rounding mode to be used.
   *
   * =====================================================================
   */
  public void ComputeRound(TTInterpTags.RoundState round_mode) {
    Debug(0, DebugTag.DBG_INTERP, TAG, "ComputeRound");
    switch (round_mode) {
      case Off:
        curr_round_func = round_none;
        Debug(0, DebugTag.DBG_INTERP, TAG, "RoundNone");
        break;
      case To_Grid:







<
<
<
<







 







|







14
15
16
17
18
19
20




21
22
23
24
25
26
27
...
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
 */

  /* ===================================================================== */
  /*    TTRenderFunc                                                       */
  /*    references to render functions for interpreter                     */
  /* ===================================================================== */





import org.apwtcl.apwfreetypelib.aftutil.FTCalc;
import org.apwtcl.apwfreetypelib.aftutil.FTDebug;

public class TTRenderFunc extends FTDebug {
  private static int oid = 0;

  private int id;
................................................................................
   *    Sets the rounding mode.
   *
   * <Input>
   *    round_mode :: The rounding mode to be used.
   *
   * =====================================================================
   */
  public void ComputeRound(TTInterpTags.Round round_mode) {
    Debug(0, DebugTag.DBG_INTERP, TAG, "ComputeRound");
    switch (round_mode) {
      case Off:
        curr_round_func = round_none;
        Debug(0, DebugTag.DBG_INTERP, TAG, "RoundNone");
        break;
      case To_Grid: