ApwFreetypeLibrary

Check-in [7db930fc07]
Login

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

Overview
Comment:fixes and renaming
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7db930fc07aba2dffbe2b5815ad8577164979e0d
User & Date: arnulf 2014-12-30 13:28:44
Context
2014-12-30
15:18
fixes. check-in: 7f48ba72a1 user: arnulf tags: trunk
13:28
fixes and renaming check-in: 7db930fc07 user: arnulf tags: trunk
13:02
initial version. check-in: 20edf1a0f3 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ftbase/FTDriverRec.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
..
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
103
104
105
106
107
108
109
110
111
112
// ----------------------------------------------------------------
// FTDriverRec.java --
//
// Copyright (c) 2014 by Arnulf P. Wiedemann
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//------------------------------------------------------------------------

package ftbase;

//import android.util.Log;

/* ======================================================================= */
/*  This Java implementation is derived from the Freetype code             */
/*  and has been implemented to work together with the Apache batik code   */
/*  for reading .ttf ont files                                             */
/*                                                                         */



/*  Copyright (C) of the Java implementation 2014                          */
/*  Arnulf Wiedemann                                                       */
/*                                                                         */


/*  See the file "license.terms" for information on usage and              */
/*  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.   */
/*                                                                         */
/*  in this directory the truetype opcode interpreter is ported to Java    */
/*                                                                         */
/*  the next blocks are taken from the original source code                */
/*                                                                         */
/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
/*            2010 by                                                      */
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
/*                                                                         */
/*  This file is part of the FreeType project, and may only be used,       */
/*  modified, and distributed under the terms of the FreeType project      */
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
/*  this file you indicate that you have read the license and              */
/*  understand and accept it fully.                                        */
/*                                                                         */
/* ======================================================================= */




  /* ===================================================================== */
  /*    FTDriverRec                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDriverRec extends FTModuleRec {
    private static int oid = 0;
................................................................................
    /* ==================== FTDriverRec ================================== */
    public FTDriverRec() {
      super();
      oid++;
      id = oid;
      
      faces_list = new FTListRec("FTDriverRec.faces_list 1");
      FT_Trace.Trace(7, TAG, "faces_list 1 new FTListRec: "+ faces_list.mySelf());
    }
    
    /* ==================== FTDriverRec ================================== */
    public FTDriverRec(FTModuleRec module) {
      oid++;
      id = oid;
      
if (FTInit.initDebug > 2) {
System.out.println("FTDriverRec module: "+module.library);      
}
      this.module_clazz = module.module_clazz;
      this.library = module.library;
      driver_clazz = (FTDriverClassRec)module.module_clazz;
      faces_list = new FTListRec("FTDriverRec.faces_list 2");
      FT_Trace.Trace(7, TAG, "faces_list 2 new FTListRec: "+ faces_list.mySelf());
    }
    
    /* ==================== FTDriverRec ================================== */
    public FTDriverRec(FTDriverClassRec driver_clazz) {
      super();
      oid++;
      id = oid;
      
      this.module_clazz = new FTModuleClassRec();
      this.driver_clazz = driver_clazz;
      faces_list = new FTListRec("FTDriverRec.faces_list 3");
      FT_Trace.Trace(7, TAG, "faces_list 3 new FTListRec: "+ faces_list.mySelf());
      glyph_loader = new FTGlyphLoaderRec();
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
      String str = TAG+"!"+id+"!";
      return str;
    } 
        
    /* ==================== toString ===================================== */
    public String toString() {
      StringBuffer str = new StringBuffer(mySelf()+"!");
      return str.toString();
    }

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

>
>







 







|







<
|
<




|











|





|
<
|



|
<






















1
2



3
4
5
6


7
8
9
10















11
12
13
14
15
16
17
18
19
20
21
22
..
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













/* =====================================================================
 *  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.de
 *
 *  See the file "license.terms" for information on usage and
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.















 * =====================================================================
 */

package ftbase;

  /* ===================================================================== */
  /*    FTDriverRec                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDriverRec extends FTModuleRec {
    private static int oid = 0;
................................................................................
    /* ==================== FTDriverRec ================================== */
    public FTDriverRec() {
      super();
      oid++;
      id = oid;
      
      faces_list = new FTListRec("FTDriverRec.faces_list 1");
      FTTrace.Trace(7, TAG, "faces_list 1 new FTListRec: "+ faces_list.mySelf());
    }
    
    /* ==================== FTDriverRec ================================== */
    public FTDriverRec(FTModuleRec module) {
      oid++;
      id = oid;
      

Debug(0, DBG_INIT, TAG, "FTDriverRec module: "+module.library);

      this.module_clazz = module.module_clazz;
      this.library = module.library;
      driver_clazz = (FTDriverClassRec)module.module_clazz;
      faces_list = new FTListRec("FTDriverRec.faces_list 2");
      FTTrace.Trace(7, TAG, "faces_list 2 new FTListRec: "+ faces_list.mySelf());
    }
    
    /* ==================== FTDriverRec ================================== */
    public FTDriverRec(FTDriverClassRec driver_clazz) {
      super();
      oid++;
      id = oid;
      
      this.module_clazz = new FTModuleClassRec();
      this.driver_clazz = driver_clazz;
      faces_list = new FTListRec("FTDriverRec.faces_list 3");
      FTTrace.Trace(7, TAG, "faces_list 3 new FTListRec: "+ faces_list.mySelf());
      glyph_loader = new FTGlyphLoaderRec();
    }
    
    /* ==================== 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();
    }
 
}

Changes to ftdemo/FTDemoBitmapUtil.java.

1
2
3
4
5
6
7
8
..
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
...
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
...
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
/* =====================================================================
 *  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.de
 *
................................................................................
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

import android.util.Log;

  /* ===================================================================== */
  /*    FTDemoBitmapUtil                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDemoBitmapUtil extends ftbase.FTDebug {
    private static int oid = 0;

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

    /* ==================== FTDemoBitmapUtil ================================== */
    public FTDemoBitmapUtil() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
................................................................................
      blit.source = glyph;
      blit.target = target;
      mode = target.mode;
      if (compute_clips(blit, x, y)) {
        return 0;
      }
      switch (glyph.mode) {
      case grBitmap.GR_PIXEL_MODE_MONO:     // handle monochrome bitmap blitting
        if (mode <= grBitmap.GR_PIXEL_MODE_NONE || mode >= grBitmap.GR_PIXEL_MODE_MAX) {
          grError = gr_err_bad_source_depth;
          return -1;
        }
        gr_mono_blitters[mode](blit, color);
        break;
      case grBitmap.GR_PIXEL_MODE_GRAY:
        if (glyph.grays > 1) {
          int target_grays = target.grays;
          int source_grays = glyph.grays;
          byte[] saturation;

          if (mode == grBitmap.GR_PIXEL_MODE_GRAY && target_grays > 1) {
            // rendering into a gray target - use special composition 
            // routines..                                             
            if (gr_last_saturation.count == target_grays) {
              saturation = gr_last_saturation.table;
            } else {
              saturation = grGetSaturation(target_grays);
              if (saturation == 0) {
................................................................................
                  return -3;
                }
              }
              blit_gray_to_gray(&blit, saturation, conversion);
            }
          } else {
            // rendering into a color target
            if (mode <= grBitmap.GR_PIXEL_MODE_GRAY ||
                 mode >= grBitmap.GR_PIXEL_MODE_MAX) {
              grError = gr_err_bad_target_depth;
              return -1;
            }
            if (source_grays == 256) {
              gr_gray8_blitters[mode](&blit, color);
            } else {
              gr_color_blitters[mode](&blit, color, source_grays - 1);
            }
          }
        }
        break;
      case grBitmap.GR_PIXEL_MODE_LCD:
        if (mode == grBitmap.GR_PIXEL_MODE_RGB24) {
          if (glyph.grays == 256) {
            blit_lcd8_to_24(&blit, color);
          } else {
            if (glyph.grays > 1) {
              blit_lcd_to_24(&blit, color, glyph.grays-1);
            }
          }
        }
        break;
      case grBitmap.GR_PIXEL_MODE_LCDV:
        if (glyph.grays > 1 && mode == grBitmap.GR_PIXEL_MODE_RGB24) {
          blit_lcdv_to_24(&blit, color, glyph.grays-1);
          break;
        }
      case grBitmap.GR_PIXEL_MODE_LCD2:
        if (mode == grBitmap.GR_PIXEL_MODE_RGB24) {
          if (glyph.grays == 256) {
            blit_lcd28_to_24(blit, color);
          } else {
            if (glyph.grays > 1) {
              blit_lcd2_to_24(blit, color, glyph.grays-1);
            }
          }
        }
        break;
      case grBitmap.GR_PIXEL_MODE_LCDV2:
        if (mode == grBitmap.GR_PIXEL_MODE_RGB24) {
          if (glyph.grays > 1) {
            blit_lcdv2_to_24(blit, color, glyph.grays-1);
          }
        }
        break;
      default:
        // we don't support the blitting of bitmaps of the following  
|







 







|







|

|







 







|
|





|





|







 







|
|











|
|









|
|



|
|









|
|







1
2
3
4
5
6
7
8
..
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
...
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
...
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

import android.util.Log;

  /* ===================================================================== */
  /*    ftdemo.FTDemoBitmapUtil                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDemoBitmapUtil extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.FTDemoBitmapUtil";

    /* ==================== ftdemo.FTDemoBitmapUtil ================================== */
    public FTDemoBitmapUtil() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
................................................................................
      blit.source = glyph;
      blit.target = target;
      mode = target.mode;
      if (compute_clips(blit, x, y)) {
        return 0;
      }
      switch (glyph.mode) {
      case ftdemo.grBitmap.GR_PIXEL_MODE_MONO:     // handle monochrome bitmap blitting
        if (mode <= ftdemo.grBitmap.GR_PIXEL_MODE_NONE || mode >= ftdemo.grBitmap.GR_PIXEL_MODE_MAX) {
          grError = gr_err_bad_source_depth;
          return -1;
        }
        gr_mono_blitters[mode](blit, color);
        break;
      case ftdemo.grBitmap.GR_PIXEL_MODE_GRAY:
        if (glyph.grays > 1) {
          int target_grays = target.grays;
          int source_grays = glyph.grays;
          byte[] saturation;

          if (mode == ftdemo.grBitmap.GR_PIXEL_MODE_GRAY && target_grays > 1) {
            // rendering into a gray target - use special composition 
            // routines..                                             
            if (gr_last_saturation.count == target_grays) {
              saturation = gr_last_saturation.table;
            } else {
              saturation = grGetSaturation(target_grays);
              if (saturation == 0) {
................................................................................
                  return -3;
                }
              }
              blit_gray_to_gray(&blit, saturation, conversion);
            }
          } else {
            // rendering into a color target
            if (mode <= ftdemo.grBitmap.GR_PIXEL_MODE_GRAY ||
                 mode >= ftdemo.grBitmap.GR_PIXEL_MODE_MAX) {
              grError = gr_err_bad_target_depth;
              return -1;
            }
            if (source_grays == 256) {
              gr_gray8_blitters[mode](&blit, color);
            } else {
              gr_color_blitters[mode](&blit, color, source_grays - 1);
            }
          }
        }
        break;
      case ftdemo.grBitmap.GR_PIXEL_MODE_LCD:
        if (mode == ftdemo.grBitmap.GR_PIXEL_MODE_RGB24) {
          if (glyph.grays == 256) {
            blit_lcd8_to_24(&blit, color);
          } else {
            if (glyph.grays > 1) {
              blit_lcd_to_24(&blit, color, glyph.grays-1);
            }
          }
        }
        break;
      case ftdemo.grBitmap.GR_PIXEL_MODE_LCDV:
        if (glyph.grays > 1 && mode == ftdemo.grBitmap.GR_PIXEL_MODE_RGB24) {
          blit_lcdv_to_24(&blit, color, glyph.grays-1);
          break;
        }
      case ftdemo.grBitmap.GR_PIXEL_MODE_LCD2:
        if (mode == ftdemo.grBitmap.GR_PIXEL_MODE_RGB24) {
          if (glyph.grays == 256) {
            blit_lcd28_to_24(blit, color);
          } else {
            if (glyph.grays > 1) {
              blit_lcd2_to_24(blit, color, glyph.grays-1);
            }
          }
        }
        break;
      case ftdemo.grBitmap.GR_PIXEL_MODE_LCDV2:
        if (mode == ftdemo.grBitmap.GR_PIXEL_MODE_RGB24) {
          if (glyph.grays > 1) {
            blit_lcdv2_to_24(blit, color, glyph.grays-1);
          }
        }
        break;
      default:
        // we don't support the blitting of bitmaps of the following  

Changes to ftdemo/FTDemoDisplay.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class FTDemoDisplay extends Object {
    private static int oid = 0;

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

    public grBitmap bitmap;
    public GBlenderCell fore_color;
    public GBlenderCell back_color;        
    public GBlenderCell warn_color;

    /* ==================== FTDemoDisplay ================================== */
    public FTDemoDisplay() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
................................................................................
 
    /* =====================================================================
     * FTDemoDisplayClear
     * =====================================================================
     */
    public static void FTDemoDisplayClear(FTDemoDisplay display) {
/*
      grBitmap bit = display.bitmap;
      int pitch = bit.pitch;


      if (pitch < 0) {
        pitch = -pitch;
      }
      if (bit.mode == grBitmap.GR_PIXEL_MODE_GRAY) {
//        memset(bit.buffer, display.back_color.value, pitch * bit.rows);
      } else {
//         p = bit.buffer;
        int i;
        int j;

        for( i = 0; i < bit.rows; i++) {
|







 







|






|







 







|






|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class FTDemoDisplay extends Object {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.FTDemoDisplay";

    public grBitmap bitmap;
    public GBlenderCell fore_color;
    public GBlenderCell back_color;        
    public GBlenderCell warn_color;

    /* ==================== ftdemo.FTDemoDisplay ================================== */
    public FTDemoDisplay() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
................................................................................
 
    /* =====================================================================
     * FTDemoDisplayClear
     * =====================================================================
     */
    public static void FTDemoDisplayClear(FTDemoDisplay display) {
/*
      ftdemo.grBitmap bit = display.bitmap;
      int pitch = bit.pitch;


      if (pitch < 0) {
        pitch = -pitch;
      }
      if (bit.mode == ftdemo.grBitmap.GR_PIXEL_MODE_GRAY) {
//        memset(bit.buffer, display.back_color.value, pitch * bit.rows);
      } else {
//         p = bit.buffer;
        int i;
        int j;

        for( i = 0; i < bit.rows; i++) {

Changes to ftdemo/FTDemoHandle.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class FTDemoHandle extends Object {
    private static int oid = 0;

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

    public static char currCharacter = 0;
    public static int currGIndex = -1;
    
    private final static int MAX_GLYPHS = 512;

    public ftbase.FTLibraryRec library = null;           /* the FreeType library          */
................................................................................
    public boolean string_reload = true;
    public long encoding = ftbase.FTEncoding.FT_ENCODING_NONE;
    public ftbase.FTStrokerRec stroker = null;
    public ftbase.FTBitmapRec bitmap = null;            /* used as bitmap conversion buffer */
    public FTDemoDisplay display;
    public grBitmap grBitmap = null;
    
    /* ==================== FTDemoHandle ================================== */
    public FTDemoHandle() {
      oid++;
      id = oid;
      scaler = new ftcache.FTCScalerRec();
      stroker = new ftbase.FTStrokerRec();
      bitmap = new ftbase.FTBitmapRec();
      grBitmap = new grBitmap();
|







 







|







 







|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class FTDemoHandle extends Object {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.FTDemoHandle";

    public static char currCharacter = 0;
    public static int currGIndex = -1;
    
    private final static int MAX_GLYPHS = 512;

    public ftbase.FTLibraryRec library = null;           /* the FreeType library          */
................................................................................
    public boolean string_reload = true;
    public long encoding = ftbase.FTEncoding.FT_ENCODING_NONE;
    public ftbase.FTStrokerRec stroker = null;
    public ftbase.FTBitmapRec bitmap = null;            /* used as bitmap conversion buffer */
    public FTDemoDisplay display;
    public grBitmap grBitmap = null;
    
    /* ==================== ftdemo.FTDemoHandle ================================== */
    public FTDemoHandle() {
      oid++;
      id = oid;
      scaler = new ftcache.FTCScalerRec();
      stroker = new ftbase.FTStrokerRec();
      bitmap = new ftbase.FTBitmapRec();
      grBitmap = new grBitmap();

Changes to ftdemo/FTDemoStatusRec.java.

1
2
3
4
5
6
7
8
9
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// ----------------------------------------------------------------
// FTDemoStatusRec.java --
//
// Copyright (c) 2014 by Arnulf P. Wiedemann
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//------------------------------------------------------------------------

................................................................................
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
/*  this file you indicate that you have read the license and              */
/*  understand and accept it fully.                                        */
/*                                                                         */
/* ======================================================================= */

  /* ===================================================================== */
  /*    FTDemoStatusRec                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDemoStatusRec extends Object {
    private static int oid = 0;

    private int id;
    private static String TAG = "FTDemoStatusRec";
    private final static int DIM_X = 640;
    private final static int DIM_Y = 480;
    private final static int RENDER_MODE_ALL = 0;
    private final static int RENDER_MODE_EMBOLDEN = 1;
    private final static int RENDER_MODE_SLANTED = 2;
    private final static int RENDER_MODE_STROKE = 3;
    private final static int RENDER_MODE_TEXT = 4;
................................................................................
    int topleft = 0;           /* as displayed by ftview  */
    int num_fails = 0;
    int preload = 0;
    int use_custom_lcd_filter = 0;
    byte[] filter_weights = new byte[5];
    int fw_idx = 2;

    /* ==================== FTDemoStatusRec ================================== */
    public FTDemoStatusRec() {
      oid++;
      id = oid;
      filter_weights[0] = 0x10;
      filter_weights[1] = 0x40;
      filter_weights[2] = 0x70;
      filter_weights[3] = 0x40;
|
|







 







|







|







 







|







1
2
3
4
5
6
7
8
9
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package ftdemo;// ----------------------------------------------------------------
// ftdemo.FTDemoStatusRec.java --
//
// Copyright (c) 2014 by Arnulf P. Wiedemann
//
// See the file "license.terms" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//------------------------------------------------------------------------

................................................................................
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
/*  this file you indicate that you have read the license and              */
/*  understand and accept it fully.                                        */
/*                                                                         */
/* ======================================================================= */

  /* ===================================================================== */
  /*    ftdemo.FTDemoStatusRec                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDemoStatusRec extends Object {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.FTDemoStatusRec";
    private final static int DIM_X = 640;
    private final static int DIM_Y = 480;
    private final static int RENDER_MODE_ALL = 0;
    private final static int RENDER_MODE_EMBOLDEN = 1;
    private final static int RENDER_MODE_SLANTED = 2;
    private final static int RENDER_MODE_STROKE = 3;
    private final static int RENDER_MODE_TEXT = 4;
................................................................................
    int topleft = 0;           /* as displayed by ftview  */
    int num_fails = 0;
    int preload = 0;
    int use_custom_lcd_filter = 0;
    byte[] filter_weights = new byte[5];
    int fw_idx = 2;

    /* ==================== ftdemo.FTDemoStatusRec ================================== */
    public FTDemoStatusRec() {
      oid++;
      id = oid;
      filter_weights[0] = 0x10;
      filter_weights[1] = 0x40;
      filter_weights[2] = 0x70;
      filter_weights[3] = 0x40;

Changes to ftdemo/FTDemoUtil.java.

1
2
3
4
5
6
7
8
..
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* =====================================================================
 *  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.de
 *
................................................................................

import android.util.Log;

import ftbase.FTError;
import ftbase.FTReference;

  /* ===================================================================== */
  /*    FTDemoUtil                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDemoUtil extends ftbase.FTDebug {
    private static int oid = 0;

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

    private final static int FT_LOAD_TARGET_NORMAL = (ftbase.FTRendererRec.FT_RENDER_MODE_NORMAL & 15) << 16;
    private final static int FT_LOAD_TARGET_LIGHT = (ftbase.FTRendererRec.FT_RENDER_MODE_LIGHT & 15) << 16;
    private final static int FT_LOAD_TARGET_MONO = (ftbase.FTRendererRec.FT_RENDER_MODE_MONO & 15) << 16;
    private final static int FT_LOAD_TARGET_LCD = (ftbase.FTRendererRec.FT_RENDER_MODE_LCD & 15) << 16;
    private final static int FT_LOAD_TARGET_LCD_V = (ftbase.FTRendererRec.FT_RENDER_MODE_LCD_V  & 15) << 16;

................................................................................
    protected static int start_x;
    protected static int start_y;
    protected static int step_y;
    protected static int x;
    protected static int y;
    protected static FTDemoStatusRec status = new FTDemoStatusRec();

    /* ==================== FTDemoUtil ================================== */
    public FTDemoUtil() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
................................................................................
      ftbase.FTReference<ftcache.FTCGCacheRec> sbits_cache_ref = new ftbase.FTReference<ftcache.FTCGCacheRec>();
      ftbase.FTReference<ftcache.FTCGCacheRec> cmap_cache_ref = new ftbase.FTReference<ftcache.FTCGCacheRec>();
      ftbase.FTReference<ftbase.FTBitmapRec> bitmap_ref = new ftbase.FTReference<ftbase.FTBitmapRec>();
      ftbase.FTReference<ftcache.FTCGCacheRec> image_cache_ref = new ftbase.FTReference<ftcache.FTCGCacheRec>();
      ftbase.  FTReference<ftbase.FTStrokerRec> stroker_ref = new ftbase.FTReference<ftbase.FTStrokerRec>();
      ftbase.FTInit ft_init = new ftbase.FTInit();
      ftbase.FTInstanceMethod requester;
      String class_name = "org.apwtcl.gles20.truetype.FTDemoUtil";
      int error = 0;
      
Debug(0, DBG_INIT, TAG, "FTDemoNew\n");
// Test1Rec t1 = new Test1Rec();
// Test2Rec t2 = new Test2Rec();
// FTReference<Test1Rec> ref = new FTReference<Test1Rec>();
// ref.Set(t1);
|







 







|







|







 







|







 







|







1
2
3
4
5
6
7
8
..
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................

import android.util.Log;

import ftbase.FTError;
import ftbase.FTReference;

  /* ===================================================================== */
  /*    ftdemo.FTDemoUtil                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class FTDemoUtil extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.FTDemoUtil";

    private final static int FT_LOAD_TARGET_NORMAL = (ftbase.FTRendererRec.FT_RENDER_MODE_NORMAL & 15) << 16;
    private final static int FT_LOAD_TARGET_LIGHT = (ftbase.FTRendererRec.FT_RENDER_MODE_LIGHT & 15) << 16;
    private final static int FT_LOAD_TARGET_MONO = (ftbase.FTRendererRec.FT_RENDER_MODE_MONO & 15) << 16;
    private final static int FT_LOAD_TARGET_LCD = (ftbase.FTRendererRec.FT_RENDER_MODE_LCD & 15) << 16;
    private final static int FT_LOAD_TARGET_LCD_V = (ftbase.FTRendererRec.FT_RENDER_MODE_LCD_V  & 15) << 16;

................................................................................
    protected static int start_x;
    protected static int start_y;
    protected static int step_y;
    protected static int x;
    protected static int y;
    protected static FTDemoStatusRec status = new FTDemoStatusRec();

    /* ==================== ftdemo.FTDemoUtil ================================== */
    public FTDemoUtil() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
................................................................................
      ftbase.FTReference<ftcache.FTCGCacheRec> sbits_cache_ref = new ftbase.FTReference<ftcache.FTCGCacheRec>();
      ftbase.FTReference<ftcache.FTCGCacheRec> cmap_cache_ref = new ftbase.FTReference<ftcache.FTCGCacheRec>();
      ftbase.FTReference<ftbase.FTBitmapRec> bitmap_ref = new ftbase.FTReference<ftbase.FTBitmapRec>();
      ftbase.FTReference<ftcache.FTCGCacheRec> image_cache_ref = new ftbase.FTReference<ftcache.FTCGCacheRec>();
      ftbase.  FTReference<ftbase.FTStrokerRec> stroker_ref = new ftbase.FTReference<ftbase.FTStrokerRec>();
      ftbase.FTInit ft_init = new ftbase.FTInit();
      ftbase.FTInstanceMethod requester;
      String class_name = "org.apwtcl.gles20.truetype.ftdemo.FTDemoUtil";
      int error = 0;
      
Debug(0, DBG_INIT, TAG, "FTDemoNew\n");
// Test1Rec t1 = new Test1Rec();
// Test2Rec t2 = new Test2Rec();
// FTReference<Test1Rec> ref = new FTReference<Test1Rec>();
// ref.Set(t1);

Changes to ftdemo/GBlenderBlitFuncs.java.

1
2
3
4
5
6
7
8
..
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
/* =====================================================================
 *  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.de
 *
................................................................................
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

import android.util.Log;

  /* ===================================================================== */
  /*    GBlenderBlitFuncs                                                  */
  /*                                                                       */
  /* ===================================================================== */

public class GBlenderBlitFuncs extends ftbase.FTDebug {
    private static int oid = 0;

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

    /* ==================== GBlenderBlitFuncs ================================== */
    public GBlenderBlitFuncs() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|







|

|







1
2
3
4
5
6
7
8
..
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
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

import android.util.Log;

  /* ===================================================================== */
  /*    ftdemo.GBlenderBlitFuncs                                                  */
  /*                                                                       */
  /* ===================================================================== */

public class GBlenderBlitFuncs extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.GBlenderBlitFuncs";

    /* ==================== ftdemo.GBlenderBlitFuncs ================================== */
    public GBlenderBlitFuncs() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/GBlenderBlitRec.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderBlitRec extends Object {
    private static int oid = 0;

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

    public static final int GBLENDER_SOURCE_GRAY8 = 0;
    public static final int GBLENDER_SOURCE_HRGB = 1;
    public static final int GBLENDER_SOURCE_HBGR = 2;
    public static final int GBLENDER_SOURCE_VRGB = 3;
    public static final int GBLENDER_SOURCE_VBGR = 4;
    public static final int GBLENDER_SOURCE_BGRA = 5;
................................................................................
    public static ftbase.FTInstanceMethod gblender_blit_bgra_bgr565 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_rgb32 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_rgb24 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_rgb565 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_bgr565 = null;
    public static ftbase.FTInstanceMethod gblender_blit_dummy = null;

    /* ==================== GBlenderBlitRec ================================== */
    public GBlenderBlitRec() {
      oid++;
      id = oid;
      String class_name = "org.apwtcl.gles20.truetype.GBlenderBlitFuncs";
      gblender_blit_gray8_rgb32 =
              new ftbase.FTInstanceMethod(class_name, "gblender_blit_gray8_rgb32", 1);
      gblender_blit_gray8_rgb24 =
              new ftbase.FTInstanceMethod(class_name, "gblender_blit_gray8_rgb24", 1);
      gblender_blit_gray8_rgb565 =
              new ftbase.FTInstanceMethod(class_name, "gblender_blit_gray8_rgb565", 1);
      gblender_blit_gray8_bgr565 =
|







 







|







 







|



|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderBlitRec extends Object {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.GBlenderBlitRec";

    public static final int GBLENDER_SOURCE_GRAY8 = 0;
    public static final int GBLENDER_SOURCE_HRGB = 1;
    public static final int GBLENDER_SOURCE_HBGR = 2;
    public static final int GBLENDER_SOURCE_VRGB = 3;
    public static final int GBLENDER_SOURCE_VBGR = 4;
    public static final int GBLENDER_SOURCE_BGRA = 5;
................................................................................
    public static ftbase.FTInstanceMethod gblender_blit_bgra_bgr565 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_rgb32 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_rgb24 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_rgb565 = null;
    public static ftbase.FTInstanceMethod gblender_blit_vrgb_bgr565 = null;
    public static ftbase.FTInstanceMethod gblender_blit_dummy = null;

    /* ==================== ftdemo.GBlenderBlitRec ================================== */
    public GBlenderBlitRec() {
      oid++;
      id = oid;
      String class_name = "org.apwtcl.gles20.truetype.ftdemo.GBlenderBlitFuncs";
      gblender_blit_gray8_rgb32 =
              new ftbase.FTInstanceMethod(class_name, "gblender_blit_gray8_rgb32", 1);
      gblender_blit_gray8_rgb24 =
              new ftbase.FTInstanceMethod(class_name, "gblender_blit_gray8_rgb24", 1);
      gblender_blit_gray8_rgb565 =
              new ftbase.FTInstanceMethod(class_name, "gblender_blit_gray8_rgb565", 1);
      gblender_blit_gray8_bgr565 =

Changes to ftdemo/GBlenderCell.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderCell extends ftbase.FTDebug {
    private static int oid = 0;

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

    public byte red;
    public byte green;
    public byte blue;
    public byte alpha;
    public int color;

    /* ==================== GBlenderCell ================================== */
    public GBlenderCell() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|







|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderCell extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.GBlenderCell";

    public byte red;
    public byte green;
    public byte blue;
    public byte alpha;
    public int color;

    /* ==================== ftdemo.GBlenderCell ================================== */
    public GBlenderCell() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/GBlenderChanKeyRec.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderChanKeyRec extends ftbase.FTDebug {
    private static int oid = 0;

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

    public int backfore; /* (fore << 8) | back               */
    public short index;  /* offset in (unsigned char*)cells  */

    /* ==================== GBlenderChanKeyRec =============================== */
    public GBlenderChanKeyRec() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|




|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderChanKeyRec extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.GBlenderChanKeyRec";

    public int backfore; /* (fore << 8) | back               */
    public short index;  /* offset in (unsigned char*)cells  */

    /* ==================== ftdemo.GBlenderChanKeyRec =============================== */
    public GBlenderChanKeyRec() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/GBlenderKeyRec.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderKeyRec extends ftbase.FTDebug {
    private static int oid = 0;

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

    public int background;
    public int foreground;
    public GBlenderCell[] cells;
    public int cells_idx = 0;

    /* ==================== GBlenderKeyRec ================================== */
    public GBlenderKeyRec() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|






|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class GBlenderKeyRec extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.GBlenderKeyRec";

    public int background;
    public int foreground;
    public GBlenderCell[] cells;
    public int cells_idx = 0;

    /* ==================== ftdemo.GBlenderKeyRec ================================== */
    public GBlenderKeyRec() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/GBlenderRec.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
...
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
...
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

import java.util.ArrayList;
import static java.lang.Math.pow;

  /* ===================================================================== */
  /*    GBlenderRec                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class GBlenderRec extends ftbase.FTDebug {
    private static int oid = 0;

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

    public static int GBLENDER_SHADE_BITS = 4;   /* must be <= 7 !! */
    public static int GBLENDER_SHADE_COUNT = ( 1 << GBLENDER_SHADE_BITS );
    public static int GBLENDER_KEY_COUNT = 256;  /* must be a power of 2 */
    public static int GBLENDER_GAMMA_SHIFT = 2;

    public GBlenderKeyRec[] keys = new GBlenderKeyRec[GBLENDER_KEY_COUNT];
................................................................................
    public int cache_b_cells_idx;
   /* are we in color or channel mode ? */
    public int       channels;
   /* the gamma table */
    public short[] gamma_ramp = new short[256];  /* voltage to linear */
    public byte[] gamma_ramp_inv = new byte[256 << GBLENDER_GAMMA_SHIFT]; /* linear to voltage */

    /* ==================== GBlenderRec ================================== */
    public GBlenderRec() {
      int i;
      
      oid++;
      id = oid;
      for (i = 0; i < GBLENDER_KEY_COUNT*GBLENDER_SHADE_COUNT*3; i++) {
        cells[i] = new GBlenderCell();
................................................................................
      int idx0;
      long backfore = (long)((foreground << 8) | background);
      GBlenderChanKeyRec key = new GBlenderChanKeyRec();

      idx0 = (int)((background + foreground * 17 ) % (GBLENDER_KEY_COUNT));
      idx = idx0;
      do {
//FIXME!!!        key = (GBlenderChanKeyRec)blender.keys[idx];
        if (key.index < 0) {
          key.backfore = (int)backfore;
          key.index = (short)(idx * GBLENDER_SHADE_COUNT);
          gblender_reset_channel_key(blender, key);
          return key.index;
        }
        if (key.backfore == backfore) {
................................................................................
     * =====================================================================
     */
    public static void gblender_clear(GBlenderRec blender) {
      int nn;
      GBlenderKeyRec keys = blender.keys[0];

      if (blender.channels != 0) {
//FIXME!!        GBlenderChanKeyRec[] chan_keys = (GBlenderChanKeyRec[]) blender.keys;

//        for (nn = 0; nn < GBLENDER_KEY_COUNT; nn++) {
//          chan_keys[nn].index = -1;
//        }
        blender.cache_r_back = -1;
        blender.cache_r_fore = -1;
        blender.cache_r_cells_idx = 0;
|







 







|







|







 







|







 







|







 







|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
...
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
...
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

import java.util.ArrayList;
import static java.lang.Math.pow;

  /* ===================================================================== */
  /*    ftdemo.GBlenderRec                                                          */
  /*                                                                       */
  /* ===================================================================== */

public class GBlenderRec extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.GBlenderRec";

    public static int GBLENDER_SHADE_BITS = 4;   /* must be <= 7 !! */
    public static int GBLENDER_SHADE_COUNT = ( 1 << GBLENDER_SHADE_BITS );
    public static int GBLENDER_KEY_COUNT = 256;  /* must be a power of 2 */
    public static int GBLENDER_GAMMA_SHIFT = 2;

    public GBlenderKeyRec[] keys = new GBlenderKeyRec[GBLENDER_KEY_COUNT];
................................................................................
    public int cache_b_cells_idx;
   /* are we in color or channel mode ? */
    public int       channels;
   /* the gamma table */
    public short[] gamma_ramp = new short[256];  /* voltage to linear */
    public byte[] gamma_ramp_inv = new byte[256 << GBLENDER_GAMMA_SHIFT]; /* linear to voltage */

    /* ==================== ftdemo.GBlenderRec ================================== */
    public GBlenderRec() {
      int i;
      
      oid++;
      id = oid;
      for (i = 0; i < GBLENDER_KEY_COUNT*GBLENDER_SHADE_COUNT*3; i++) {
        cells[i] = new GBlenderCell();
................................................................................
      int idx0;
      long backfore = (long)((foreground << 8) | background);
      GBlenderChanKeyRec key = new GBlenderChanKeyRec();

      idx0 = (int)((background + foreground * 17 ) % (GBLENDER_KEY_COUNT));
      idx = idx0;
      do {
//FIXME!!!        key = (ftdemo.GBlenderChanKeyRec)blender.keys[idx];
        if (key.index < 0) {
          key.backfore = (int)backfore;
          key.index = (short)(idx * GBLENDER_SHADE_COUNT);
          gblender_reset_channel_key(blender, key);
          return key.index;
        }
        if (key.backfore == backfore) {
................................................................................
     * =====================================================================
     */
    public static void gblender_clear(GBlenderRec blender) {
      int nn;
      GBlenderKeyRec keys = blender.keys[0];

      if (blender.channels != 0) {
//FIXME!!        ftdemo.GBlenderChanKeyRec[] chan_keys = (ftdemo.GBlenderChanKeyRec[]) blender.keys;

//        for (nn = 0; nn < GBLENDER_KEY_COUNT; nn++) {
//          chan_keys[nn].index = -1;
//        }
        blender.cache_r_back = -1;
        blender.cache_r_fore = -1;
        blender.cache_r_cells_idx = 0;

Changes to ftdemo/TFont.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TFont extends ftbase.FTDebug {
    private static int oid = 0;

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

    public String filepathname = null;
    public int face_index = 0;
    public int cmap_index = 0;
    public long num_indices = 0;
    public Object file_address = null;  /* for preloaded files */
    public Long file_size = 0L;

    /* ==================== TFont ================================== */
    public TFont() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|








|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TFont extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.TFont";

    public String filepathname = null;
    public int face_index = 0;
    public int cmap_index = 0;
    public long num_indices = 0;
    public Object file_address = null;  /* for preloaded files */
    public Long file_size = 0L;

    /* ==================== ftdemo.TFont ================================== */
    public TFont() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/TGlyph.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TGlyph extends ftbase.FTDebug {
    private static int oid = 0;

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

    public int glyph_index = 0;
    public ftbase.FTGlyphRec image = null;     /* the glyph image */
    public long delta = 0L;             /* delta caused by hinting */
    public ftbase.FTVectorRec vvector = null;  /* vert. origin => hori. origin */
    public ftbase.FTVectorRec vadvance = null; /* vertical advance */

    /* ==================== TGlyph ================================== */
    public TGlyph() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|







|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TGlyph extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.TGlyph";

    public int glyph_index = 0;
    public ftbase.FTGlyphRec image = null;     /* the glyph image */
    public long delta = 0L;             /* delta caused by hinting */
    public ftbase.FTVectorRec vvector = null;  /* vert. origin => hori. origin */
    public ftbase.FTVectorRec vadvance = null; /* vertical advance */

    /* ==================== ftdemo.TGlyph ================================== */
    public TGlyph() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/TPoint.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TPoint extends ftbase.FTDebug {
    private static int oid = 0;

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

    public long x = 0L;
    public long y = 0L;

    /* ==================== TPoint ================================== */
    public TPoint() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|




|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TPoint extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.TPoint";

    public long x = 0L;
    public long y = 0L;

    /* ==================== ftdemo.TPoint ================================== */
    public TPoint() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/TProfile.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TProfile extends ftbase.FTDebug {
    private static int oid = 0;

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

    public Long X = 0L;           /* current coordinate during sweep          */
    public int link = -1;         /* link to next profile (various purposes)  */
    public int offset = 0;        /* start of profile's data in render pool   */
    public int flags = 0;         /* Bit 0-2: drop-out mode                   */
                                  /* Bit 3: profile orientation (up/down)     */
                                  /* Bit 4: is top profile?                   */
................................................................................
    public long height = 0L;      /* profile's height in scanlines            */
    public long start = 0L;       /* profile's starting scanline              */
    public Integer countL = 0;    /* number of lines to step before this      */
                                  /* profile becomes drawable                 */
    public int next = -1;         /* next profile in same contour, used       */
                                  /* during drop-out control                  */

    /* ==================== TProfile ================================== */
    public TProfile() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|







 







|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TProfile extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.TProfile";

    public Long X = 0L;           /* current coordinate during sweep          */
    public int link = -1;         /* link to next profile (various purposes)  */
    public int offset = 0;        /* start of profile's data in render pool   */
    public int flags = 0;         /* Bit 0-2: drop-out mode                   */
                                  /* Bit 3: profile orientation (up/down)     */
                                  /* Bit 4: is top profile?                   */
................................................................................
    public long height = 0L;      /* profile's height in scanlines            */
    public long start = 0L;       /* profile's starting scanline              */
    public Integer countL = 0;    /* number of lines to step before this      */
                                  /* profile becomes drawable                 */
    public int next = -1;         /* next profile in same contour, used       */
                                  /* during drop-out control                  */

    /* ==================== ftdemo.TProfile ================================== */
    public TProfile() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/TStates.java.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TStates extends ftbase.FTDebug {
    private static int oid = 0;

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

    public final static int Unknown_State = 1;
    public final static int Ascending_State = 2;
    public final static int Descending_State = 3;
    public final static int Flat_State = 4;

    /* ==================== TStates ================================== */
    public TStates() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|







 







|






|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package ftdemo;/* =====================================================================
 *  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.de
 *
................................................................................
 * =====================================================================
 */

public class TStates extends ftbase.FTDebug {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.TStates";

    public final static int Unknown_State = 1;
    public final static int Ascending_State = 2;
    public final static int Descending_State = 3;
    public final static int Flat_State = 4;

    /* ==================== ftdemo.TStates ================================== */
    public TStates() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Changes to ftdemo/grBitmap.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
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.de
 *
 *  See the file "license.terms" for information on usage and
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

  /* =====================================================================
   *    grBitmap
   * <Description>                         
   *   a simple bitmap descriptor          
   *                                       
   * <Fields>                              
   *   rows   :: height in pixels          
   *   width  :: width in pixels
   *   pitch  :: + or - the number of bytes per row
................................................................................
   * =====================================================================
   */

public class grBitmap extends Object {
    private static int oid = 0;

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

    public static final int GR_PIXEL_MODE_NONE = 0;
    public static final int GR_PIXEL_MODE_MONO = 1; /* monochrome bitmaps               */
    public static final int GR_PIXEL_MODE_PAL4 = 2; /* 4-bit paletted - 16 colors */
    public static final int GR_PIXEL_MODE_PAL8 = 3; /* 8-bit paletted - 256 colors      */
    public static final int GR_PIXEL_MODE_GRAY = 4; /* 8-bit gray levels                */
    public static final int GR_PIXEL_MODE_RGB555 = 5; /* 15-bits mode - 32768 colors      */
................................................................................
    public int rows;
    public int width;
    public int pitch;
    public short mode;
    public int grays;
    public int[] buffer;

    /* ==================== grBitmap ================================== */
    public grBitmap() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {
|













|







 







|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package ftdemo;/* =====================================================================
 *  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.de
 *
 *  See the file "license.terms" for information on usage and
 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * =====================================================================
 */

  /* =====================================================================
   *    ftdemo.grBitmap
   * <Description>                         
   *   a simple bitmap descriptor          
   *                                       
   * <Fields>                              
   *   rows   :: height in pixels          
   *   width  :: width in pixels
   *   pitch  :: + or - the number of bytes per row
................................................................................
   * =====================================================================
   */

public class grBitmap extends Object {
    private static int oid = 0;

    private int id;
    private static String TAG = "ftdemo.grBitmap";

    public static final int GR_PIXEL_MODE_NONE = 0;
    public static final int GR_PIXEL_MODE_MONO = 1; /* monochrome bitmaps               */
    public static final int GR_PIXEL_MODE_PAL4 = 2; /* 4-bit paletted - 16 colors */
    public static final int GR_PIXEL_MODE_PAL8 = 3; /* 8-bit paletted - 256 colors      */
    public static final int GR_PIXEL_MODE_GRAY = 4; /* 8-bit gray levels                */
    public static final int GR_PIXEL_MODE_RGB555 = 5; /* 15-bits mode - 32768 colors      */
................................................................................
    public int rows;
    public int width;
    public int pitch;
    public short mode;
    public int grays;
    public int[] buffer;

    /* ==================== ftdemo.grBitmap ================================== */
    public grBitmap() {
      oid++;
      id = oid;
    }
    
    /* ==================== mySelf ================================== */
    public String mySelf() {

Name change from fttruetype/TTSfntLoad.java to ftsfnt/TTSfntLoad.java.