ApwFreetypeLibrary

Check-in [477dcc17ba]
Login

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

Overview
Comment:initial version.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:477dcc17ba613ced69736bce230e95c029b55cad
User & Date: arnulf 2014-12-29 23:20:27
Context
2014-12-29
23:20
initial version. check-in: e9ca502532 user: arnulf tags: trunk
23:20
initial version. check-in: 477dcc17ba user: arnulf tags: trunk
23:19
fixes. check-in: 10229f2a18 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added ftsfnt/TTCHeaderRec.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
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTCHeaderRec                                                       */
  /*                                                                       */
  /* <Description>                                                         */
  /*    TrueType collection header.  This table contains the offsets of    */
  /*    the font headers of each distinct TrueType face in the file.       */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    tag     :: Must be `ttc ' to indicate a TrueType collection.       */
  /*                                                                       */
  /*    version :: The version number.                                     */
  /*                                                                       */
  /*    count   :: The number of faces in the collection.  The             */
  /*               specification says this should be an unsigned long, but */
  /*               we use a signed long since we need the value -1 for     */
  /*               specific purposes.                                      */
  /*                                                                       */
  /*    offsets :: The offsets of the font headers, one per face.          */
  /*                                                                       */
  /* ===================================================================== */

public class TTCHeaderRec extends ftbase.FTDebug {
    private static int oid = 0;
    
    private int id;
    private static String TAG = "TTCHeaderRec";
    
    public long tag = 0L;
    public long version = 0L;
    public int  count = 0;
    public long[] offsets = null;

    /* ==================== TTCHeaderRec ================================== */
    public TTCHeaderRec() {
      oid++;
      id = oid;
      offsets = new long[32];
    }
    
    /* ==================== 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();
    }
 
}

Added ftsfnt/TTGaspRangeRec.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
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTGaspRangeRec                                                     */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A tiny structure used to model a gasp range according to the       */
  /*    TrueType specification.                                            */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    maxPPEM  :: The maximum ppem value to which `gaspFlag' applies.    */
  /*                                                                       */
  /*    gaspFlag :: A flag describing the grid-fitting and anti-aliasing   */
  /*                modes to be used.                                      */
  /*                                                                       */
  /* ===================================================================== */

public class TTGaspRangeRec extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public Short maxPPEM = 0;
    public Short gaspFlag = 0;

    /* ==================== TTGaspRangeRec ================================== */
    public TTGaspRangeRec() {
      super(null);
    }
    
    /* ==================== TTGaspRangeRec ================================== */
    public TTGaspRangeRec(ftbase.FTStreamRec stream) {
      super(stream);
      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.TTGaspRangeRec";
      if (frame_info.size() == 0) {
//        va = new TTInstanceVariable(my_class_name, this, "format_tag", 1);
//        frame_info.add(new FTFrameEntry("format_tag", va, readInt, VAR_IS_INT));
      }
//      fillVariables();
Debug(0, DBG_LOAD_GLYPH, TAG, "TTGaspRangeRec offset: "+String.format("0x%08x", stream.pos()));
      maxPPEM = stream.readShort(stream);
      gaspFlag = stream.readShort(stream);
ftbase.FTTrace.Trace(7, TAG, String.format("gaspRange rangeMaxPPEM %5d, rangeGaspBehavior 0x%04x",
            maxPPEM, gaspFlag));

    }
    
    /* ==================== 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();
    }
 
}

Added ftsfnt/TTGaspRec.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
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTGaspRec                                                          */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A structure modeling the TrueType `gasp' table used to specify     */
  /*    grid-fitting and anti-aliasing behaviour.                          */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    version    :: The version number.                                  */
  /*                                                                       */
  /*    numRanges  :: The number of gasp ranges in table.                  */
  /*                                                                       */
  /*    gaspRanges :: An array of gasp ranges.                             */
  /*                                                                       */
  /* ===================================================================== */

public class TTGaspRec extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public Short version;
    public Short numRanges;
    public TTGaspRangeRec[] gaspRanges = null;

    /* ==================== TTGaspRec ================================== */
    public TTGaspRec() {
      super(null);
    }
    
    /* ==================== TTGaspRec ================================== */
    public TTGaspRec(ftbase.FTStreamRec stream) {
      super(stream);
      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.TTGaspRec";
      if (frame_info.size() == 0) {
//        va = new TTInstanceVariable(my_class_name, this, "format_tag", 1);
//        frame_info.add(new FTFrameEntry("format_tag", va, readInt, VAR_IS_INT));
      }
//      fillVariables();
Debug(0, DBG_LOAD_GLYPH, TAG, "TTGaspRec offset: "+String.format("0x%08x", stream.pos()));
      version = stream.readShort(stream);
      numRanges = stream.readShort(stream);
      gaspRanges = new TTGaspRangeRec[numRanges];
      for (int i = 0; i < numRanges; i++) {
        gaspRanges[i] = new TTGaspRangeRec(stream);
      }
    }
    
    /* ==================== 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();
    }
 
}

Added ftsfnt/TTHeaderRec.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
100
101
102
103
104
105
106
107
108
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTHeaderRec                                                           */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A structure used to model a TrueType font header table.  All       */
  /*    fields follow the TrueType specification.                          */
  /*                                                                       */
  /* ===================================================================== */

public class TTHeaderRec extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public int Table_Version = 0;
    public int Font_Revision = 0;
    public int CheckSum_Adjust = 0;
    public int Magic_Number = 0;
    public short Flags = 0;
    public short Units_Per_EM = 0;
    public int[] Created = new int[2];
    public int[] Modified= new int[2];
    public short xMin = 0;
    public short yMin = 0;
    public short xMax = 0;
    public short yMax = 0;
    public short Mac_Style = 0;
    public short Lowest_Rec_PPEM = 0;
    public short Font_Direction = 0;
    public short Index_To_Loc_Format = 0;
    public short Glyph_Data_Format = 0;

    /* ==================== TTHeaderRec ================================== */
    public TTHeaderRec() {
      super(null);
    }
    
    /* ==================== TTHeaderRec ================================== */
    public TTHeaderRec(ftbase.FTStreamRec stream) {
      super(stream);
      ftbase.FTInstanceVariable va;

      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.TTHeaderRec";
Debug(0, DBG_LOAD_GLYPH, TAG, "TTHeaderRec offset: "+String.format("0x%08x", stream.pos()));
      Table_Version = stream.readInt(stream);
      Font_Revision = stream.readInt(stream);
      CheckSum_Adjust = stream.readInt(stream);
      Magic_Number = stream.readInt(stream);
      Flags = stream.readShort(stream);
      Units_Per_EM = stream.readShort(stream);
      Created[0] = stream.readInt(stream);
      Created[1] = stream.readInt(stream);
      Modified[0] = stream.readInt(stream);
      Modified[1] = stream.readInt(stream);
Debug(0, DBG_LOAD_GLYPH, TAG, "HEADER: "+String.format("0x%08x 0x%08x,  0x%08x, 0x%08x",
		Table_Version, Font_Revision, CheckSum_Adjust, Magic_Number));
Debug(0, DBG_LOAD_GLYPH, TAG, "HEADER: "+String.format("0x%04x 0x%04x,  0x%08x, 0x%08x, 0x%08x, 0x%08x",
		Flags, Units_Per_EM, Created[0], Created[1], Modified[0], Modified[1]));
      xMin = stream.readShort(stream);
      yMin = stream.readShort(stream);
      xMax = stream.readShort(stream);
      yMax = stream.readShort(stream);
      Mac_Style = stream.readShort(stream);
      Lowest_Rec_PPEM = stream.readShort(stream);
Debug(0, DBG_LOAD_GLYPH, TAG, "HEADER: "+String.format("0x%04x 0x%04x,  0x%04x, 0x%04x, 0x%04x, 0x%04x",
       xMin, yMin, xMax, yMax, Mac_Style, Lowest_Rec_PPEM));
      Font_Direction = stream.readShort(stream);
      Index_To_Loc_Format = stream.readShort(stream);
      Glyph_Data_Format = stream.readShort(stream);
Debug(0, DBG_LOAD_GLYPH, TAG, "HEADER: "+String.format("0x%04x 0x%04x,  0x%04x",
        Font_Direction, Index_To_Loc_Format, Glyph_Data_Format));
    }
    
    /* ==================== 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();
    }
 
}

Added ftsfnt/TTHoriHeader.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
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
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
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTHoriHeader                                                          */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A structure used to model a TrueType horizontal header, the `hhea' */
  /*    table, as well as the corresponding horizontal metrics table,      */
  /*    i.e., the `hmtx' table.                                            */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    Version                :: The table version.                       */
  /*                                                                       */
  /*    Ascender               :: The font's ascender, i.e., the distance  */
  /*                              from the baseline to the top-most of all */
  /*                              glyph points found in the font.          */
  /*                                                                       */
  /*                              This value is invalid in many fonts, as  */
  /*                              it is usually set by the font designer,  */
  /*                              and often reflects only a portion of the */
  /*                              glyphs found in the font (maybe ASCII).  */
  /*                                                                       */
  /*                              You should use the `sTypoAscender' field */
  /*                              of the OS/2 table instead if you want    */
  /*                              the correct one.                         */
  /*                                                                       */
  /*    Descender              :: The font's descender, i.e., the distance */
  /*                              from the baseline to the bottom-most of  */
  /*                              all glyph points found in the font.  It  */
  /*                              is negative.                             */
  /*                                                                       */
  /*                              This value is invalid in many fonts, as  */
  /*                              it is usually set by the font designer,  */
  /*                              and often reflects only a portion of the */
  /*                              glyphs found in the font (maybe ASCII).  */
  /*                                                                       */
  /*                              You should use the `sTypoDescender'      */
  /*                              field of the OS/2 table instead if you   */
  /*                              want the correct one.                    */
  /*                                                                       */
  /*    Line_Gap               :: The font's line gap, i.e., the distance  */
  /*                              to add to the ascender and descender to  */
  /*                              get the BTB, i.e., the                   */
  /*                              baseline-to-baseline distance for the    */
  /*                              font.                                    */
  /*                                                                       */
  /*    advance_Width_Max      :: This field is the maximum of all advance */
  /*                              widths found in the font.  It can be     */
  /*                              used to compute the maximum width of an  */
  /*                              arbitrary string of text.                */
  /*                                                                       */
  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */
  /*                              glyphs within the font.                  */
  /*                                                                       */
  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */
  /*                              glyphs within the font.                  */
  /*                                                                       */
  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */
  /*                              `width' of a glyph's bounding box) for   */
  /*                              all glyphs in the font.                  */
  /*                                                                       */
  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */
  /*                              slope of the cursor (slope=rise/run).    */
  /*                                                                       */
  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */
  /*                              slope.                                   */
  /*                                                                       */
  /*    Reserved               :: 8~reserved bytes.                        */
  /*                                                                       */
  /*    metric_Data_Format     :: Always~0.                                */
  /*                                                                       */
  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */
  /*                              table -- this value can be smaller than  */
 /*                              the total number of glyphs in the font.  */
  /*                                                                       */
  /*    long_metrics           :: A pointer into the `hmtx' table.         */
  /*                                                                       */
  /*    short_metrics          :: A pointer into the `hmtx' table.         */
  /*                                                                       */
  /* <Note>                                                                */
  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */
  /*               be identical except for the names of their fields which */
  /*               are different.                                          */
  /*                                                                       */
  /*               This ensures that a single function in the `ttload'     */
  /*               module is able to read both the horizontal and vertical */
  /*               headers.                                                */
  /*                                                                       */
  /* ===================================================================== */

public class TTHoriHeader extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public Long Version = 0L;
    public short Ascender = 0;
    public short Descender = 0;
    public short Line_Gap = 0;
    public Short advance_Width_Max = 0;      /* advance width maximum */
    public short min_Left_Side_Bearing = 0;  /* minimum left-sb       */
    public short min_Right_Side_Bearing = 0; /* minimum right-sb      */
    public short xMax_Extent = 0;            /* xmax extents          */
    public short caret_Slope_Rise = 0;
    public short caret_Slope_Run = 0;
    public short caret_Offset = 0;
    public short[] Reserved = new short[4];
    public short metric_Data_Format = 0;
    public Short number_Of_HMetrics = 0;
    /* The following fields are not defined by the TrueType specification */
    /* but they are used to connect the metrics header to the relevant    */
    /* `HMTX' table.                                                      */
    public Object long_metrics;
    public Object short_metrics;

    /* ==================== TTHoriHeader ================================== */
    public TTHoriHeader() {
      super(null);
    }
    
    /* ==================== TTHoriHeader ================================== */
    public TTHoriHeader(ftbase.FTStreamRec stream) {
      super(stream);
      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.TTHoriHeader";
      if (frame_info.size() == 0) {
//        va = new TTInstanceVariable(my_class_name, this, "format_tag", 1);
//        frame_info.add(new FTFrameEntry("format_tag", va, readInt, VAR_IS_INT));
      }
//      fillVariables();
Debug(0, DBG_LOAD_GLYPH, TAG, "TTHoriHeader offset: "+String.format("0x%08x", stream.pos()));
//      version = stream.readShort(stream);
      Version = (long)stream.readInt(stream);
      Ascender = stream.readShort(stream);
      Descender = stream.readShort(stream);
      Line_Gap = stream.readShort(stream);
      advance_Width_Max = stream.readShort(stream);
      min_Left_Side_Bearing = stream.readShort(stream);
      min_Right_Side_Bearing = stream.readShort(stream);
      xMax_Extent = stream.readShort(stream);
      caret_Slope_Rise = stream.readShort(stream);
      caret_Slope_Run = stream.readShort(stream);
      caret_Offset = stream.readShort(stream);
      for (int i = 0; i < 4; i++) {
        Reserved[i] = stream.readShort(stream);
      }
      metric_Data_Format = stream.readShort(stream);
      number_Of_HMetrics = stream.readShort(stream);
    }
    
    /* ==================== 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();
    }
 
}

Added ftsfnt/TTOS2.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTOS2                                                              */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A structure used to model a TrueType OS/2 table. This is the long  */
  /*    table version.  All fields comply to the TrueType specification.   */
  /*                                                                       */
  /*    Note that we now support old Mac fonts which do not include an     */
  /*    OS/2 table.  In this case, the `version' field is always set to    */
  /*    0xFFFF.                                                            */
  /*                                                                       */
  /* ===================================================================== */

public class TTOS2 extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public Short  version = 0;                /* 0x0001 - more or 0xFFFF */
    public short  xAvgCharWidth = 0;
    public Short usWeightClass = 0;
    public Short usWidthClass = 0;
    public short fsType = 0;
    public short ySubscriptXSize = 0;
    public short ySubscriptYSize = 0;
    public short ySubscriptXOffset = 0;
    public short ySubscriptYOffset = 0;
    public short ySuperscriptXSize = 0;
    public short ySuperscriptYSize = 0;
    public short ySuperscriptXOffset = 0;
    public short ySuperscriptYOffset = 0;
    public short yStrikeoutSize = 0;
    public short yStrikeoutPosition = 0;
    public short sFamilyClass = 0;
    public byte[] panose = new byte[10];
    public Long ulUnicodeRange1 = 0L;        /* Bits 0-31   */
    public Long ulUnicodeRange2 = 0L;        /* Bits 32-63  */
    public Long ulUnicodeRange3 = 0L;        /* Bits 64-95  */
    public Long ulUnicodeRange4 = 0L;        /* Bits 96-127 */
    public char[] achVendID = new char[4];
    public Short fsSelection = 0;
    public Short usFirstCharIndex = 0;
    public Short usLastCharIndex = 0;
    public short sTypoAscender = 0;
    public short sTypoDescender = 0;
    public short sTypoLineGap = 0;
    public Short usWinAscent = 0;
    public Short usWinDescent = 0;
    /* only version 1 tables: */
    public Long ulCodePageRange1 = 0L;       /* Bits 0-31   */
    public Long ulCodePageRange2 = 0L;       /* Bits 32-63  */
    /* only version 2 tables: */
    public short sxHeight = 0;
    public short sCapHeight = 0;
    public Short usDefaultChar = 0;
    public Short usBreakChar = 0;
    public Short usMaxContext = 0;

    /* ==================== TTOS2 ================================== */
    public TTOS2() {
      super(null);
    }
    
    /* ==================== TTOS2 ================================== */
    public TTOS2(ftbase.FTStreamRec stream) {
      super(stream);
      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.FTOS2";
      if (frame_info.size() == 0) {
//        va = new TTInstanceVariable(my_class_name, this, "format_tag", 1);
//        frame_info.add(new FTFrameEntry("format_tag", va, readInt, VAR_IS_INT));
      }
//      fillVariables();
Debug(0, DBG_LOAD_GLYPH, TAG, "FTOS2 offset: "+String.format("0x%08x", stream.pos()));
      version = stream.readShort(stream);
      xAvgCharWidth = stream.readShort(stream);
      usWeightClass = stream.readShort(stream);
      usWidthClass = stream.readShort(stream);
      fsType = stream.readShort(stream);
      ySubscriptXSize = stream.readShort(stream);
      ySubscriptYSize = stream.readShort(stream);
      ySubscriptXOffset = stream.readShort(stream);
      ySubscriptYOffset = stream.readShort(stream);
      ySuperscriptXSize = stream.readShort(stream);
      ySuperscriptYSize = stream.readShort(stream);
      ySuperscriptXOffset = stream.readShort(stream);
      ySuperscriptYOffset = stream.readShort(stream);
      yStrikeoutSize = stream.readShort(stream);
      yStrikeoutPosition = stream.readShort(stream);
      sFamilyClass = stream.readShort(stream);
      for (int i = 0; i < 10; i++) {
        panose[i] = stream.readByte(stream);
      }
      ulUnicodeRange1 = (long)stream.readInt(stream);
      ulUnicodeRange2 = (long)stream.readInt(stream);
      ulUnicodeRange3 = (long)stream.readInt(stream);
      ulUnicodeRange4 = (long)stream.readInt(stream);
      for (int i = 0; i < 4; i++) {
        achVendID[i] = (char)stream.readByte(stream);
      }
      fsSelection = stream.readShort(stream);
      usFirstCharIndex = stream.readShort(stream);
      usLastCharIndex = stream.readShort(stream);
      sTypoAscender = stream.readShort(stream);
      sTypoDescender = stream.readShort(stream);
      sTypoLineGap = stream.readShort(stream);
      usWinAscent = stream.readShort(stream);
      usWinDescent = stream.readShort(stream);
    }
    
    /* ==================== 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();
    }
 
    /* =====================================================================
     * readExtraFields
     * =====================================================================
     */
    public int readExtraFields(ftbase.FTStreamRec stream) {
      ulCodePageRange1 = (long)stream.readInt(stream);
      ulCodePageRange2 = (long)stream.readInt(stream);
      return 0;
    }

    /* =====================================================================
     * readExtraFields2
     * =====================================================================
     */
    public int readExtraFields2(ftbase.FTStreamRec stream) {
      sxHeight = stream.readShort(stream);
      sCapHeight = stream.readShort(stream);
      usDefaultChar = stream.readShort(stream);
      usBreakChar = stream.readShort(stream);
      usMaxContext = stream.readShort(stream);
      return 0;
    }

}

Added ftsfnt/TTPCLT.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
100
101
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTPCLT                                                          */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A structure used to model a TrueType PCLT table.  All fields       */
  /*    comply to the TrueType specification.                              */
  /*                                                                       */
  /* ===================================================================== */

public class TTPCLT extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public Long   Version = 0L;
    public Long   FontNumber = 0L;
    public Short  Pitch = 0;
    public Short  xHeight = 0;
    public Short  Style = 0;
    public Short  TypeFamily = 0;
    public Short  CapHeight = 0;
    public Short  SymbolSet = 0;
    public char[] TypeFace = new char[16];
    public char[] CharacterComplement = new char[8];
    public char[] FileName = new char[6];
    public char StrokeWeight;
    public char WidthType;
    public byte SerifStyle;

    /* ==================== TTPCLT ================================== */
    public TTPCLT() {
      super(null);
    }
    
    /* ==================== TTPCLT ================================== */
    public TTPCLT(ftbase.FTStreamRec stream) {
      super(stream);
      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.FTPCLT";
      if (frame_info.size() == 0) {
//        va = new TTInstanceVariable(my_class_name, this, "format_tag", 1);
//        frame_info.add(new FTFrameEntry("format_tag", va, readInt, VAR_IS_INT));
      }
//      fillVariables();
Debug(0, DBG_LOAD_GLYPH, TAG, "FTPCLT offset: "+String.format("0x%08x", stream.pos()));
      Version = (long)stream.readInt(stream);
      FontNumber = (long)stream.readInt(stream);
      Pitch = stream.readShort(stream);
      xHeight = stream.readShort(stream);
      Style = stream.readShort(stream);
      TypeFamily = stream.readShort(stream);
      CapHeight = stream.readShort(stream);
      SymbolSet = stream.readShort(stream);
      for (int i = 0; i < 16; i++) {
        TypeFace[i] = (char)stream.readByte(stream);
      }
      for (int i = 0; i < 8; i++) {
        CharacterComplement[i] = (char)stream.readByte(stream);
      }
      for (int i = 0; i < 6; i++) {
        FileName[i] = (char)stream.readByte(stream);
      }
      StrokeWeight = (char)stream.readByte(stream);
      WidthType = (char)stream.readByte(stream);
      SerifStyle = stream.readByte(stream);
    }
    
    /* ==================== 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();
    }
 
}

Added ftsfnt/TTPostscript.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
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTPostscript                                                       */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A structure used to model a TrueType PostScript table.  All fields */
  /*    comply to the TrueType specification.  This structure does not     */
  /*    reference the PostScript glyph names, which can be nevertheless    */
  /*    accessed with the `ttpost' module.                                 */
  /*                                                                       */
  /* ===================================================================== */

public class TTPostscript extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public Long FormatType = 0L;
    public Long italicAngle = 0L;
    public short underlinePosition = 0;
    public short underlineThickness = 0;
    public Long isFixedPitch = 0L;
    public Long minMemType42 = 0L;
    public Long maxMemType42 = 0L;
    public Long minMemType1 = 0L;
    public Long maxMemType1 = 0L;
    /* Glyph names follow in the file, but we don't   */
    /* load them by default.  See the ttpost.c file.  */

    /* ==================== TTPostscript ================================== */
    public TTPostscript() {
      super(null);
    }
    
    /* ==================== TTPostscript ================================== */
    public TTPostscript(ftbase.FTStreamRec stream) {
      super(stream);
      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.TTPostscript";
      if (frame_info.size() == 0) {
//        va = new TTInstanceVariable(my_class_name, this, "format_tag", 1);
//        frame_info.add(new FTFrameEntry("format_tag", va, readInt, VAR_IS_INT));
      }
//      fillVariables();
Debug(0, DBG_LOAD_GLYPH, TAG, "TTPostscript offset: "+String.format("0x%08x", stream.pos()));
      FormatType = (long)stream.readInt(stream);
      italicAngle = (long)stream.readInt(stream);
      underlinePosition = stream.readShort(stream);
      underlineThickness = stream.readShort(stream);
      isFixedPitch = (long)stream.readInt(stream);
      minMemType42 = (long)stream.readInt(stream);
      maxMemType42 = (long)stream.readInt(stream);
      minMemType1 = (long)stream.readInt(stream);
      maxMemType1 = (long)stream.readInt(stream);
    }
    
    /* ==================== 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();
    }
 
}

Added ftsfnt/TTTableRec.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
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTTableRec                                                         */
  /*                                                                       */
  /* <Description>                                                         */
  /*    This structure describes a given table of a TrueType font.         */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    Tag      :: A four-bytes tag describing the table.                 */
  /*                                                                       */
  /*    CheckSum :: The table checksum.  This value can be ignored.        */
  /*                                                                       */
  /*    Offset   :: The offset of the table from the start of the TrueType */
  /*                font in its resource.                                  */
  /*                                                                       */
  /*    Length   :: The table length (in bytes).                           */
  /*                                                                       */
  /* ===================================================================== */

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

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

    public int Tag = 0;        /* table type */
    public int CheckSum = 0;   /* table checksum */
    public int Offset = 0;     /* table file offset */
    public int Length = 0;     /* table length */

    /* ==================== TTTableRec ================================== */
    public TTTableRec() {
      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();
    }
 
}

Added ftsfnt/TTVertHeader.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
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
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
/* =====================================================================
 *  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 ftsfnt;

  /* ===================================================================== */
  /*    TTVertHeader                                                          */
  /*                                                                       */
  /* <Description>                                                         */
  /*    A structure used to model a TrueType horizontal header, the `hhea' */
  /*    table, as well as the corresponding horizontal metrics table,      */
  /*    i.e., the `hmtx' table.                                            */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    Version                :: The table version.                       */
  /*                                                                       */
  /*    Ascender               :: The font's ascender, i.e., the distance  */
  /*                              from the baseline to the top-most of all */
  /*                              glyph points found in the font.          */
  /*                                                                       */
  /*                              This value is invalid in many fonts, as  */
  /*                              it is usually set by the font designer,  */
  /*                              and often reflects only a portion of the */
  /*                              glyphs found in the font (maybe ASCII).  */
  /*                                                                       */
  /*                              You should use the `sTypoAscender' field */
  /*                              of the OS/2 table instead if you want    */
  /*                              the correct one.                         */
  /*                                                                       */
  /*    Descender              :: The font's descender, i.e., the distance */
  /*                              from the baseline to the bottom-most of  */
  /*                              all glyph points found in the font.  It  */
  /*                              is negative.                             */
  /*                                                                       */
  /*                              This value is invalid in many fonts, as  */
  /*                              it is usually set by the font designer,  */
  /*                              and often reflects only a portion of the */
  /*                              glyphs found in the font (maybe ASCII).  */
  /*                                                                       */
  /*                              You should use the `sTypoDescender'      */
  /*                              field of the OS/2 table instead if you   */
  /*                              want the correct one.                    */
  /*                                                                       */
  /*    Line_Gap               :: The font's line gap, i.e., the distance  */
  /*                              to add to the ascender and descender to  */
  /*                              get the BTB, i.e., the                   */
  /*                              baseline-to-baseline distance for the    */
  /*                              font.                                    */
  /*                                                                       */
  /*    advance_Width_Max      :: This field is the maximum of all advance */
  /*                              widths found in the font.  It can be     */
  /*                              used to compute the maximum width of an  */
  /*                              arbitrary string of text.                */
  /*                                                                       */
  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */
  /*                              glyphs within the font.                  */
  /*                                                                       */
  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */
  /*                              glyphs within the font.                  */
  /*                                                                       */
  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */
  /*                              `width' of a glyph's bounding box) for   */
  /*                              all glyphs in the font.                  */
  /*                                                                       */
  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */
  /*                              slope of the cursor (slope=rise/run).    */
  /*                                                                       */
  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */
  /*                              slope.                                   */
  /*                                                                       */
  /*    Reserved               :: 8~reserved bytes.                        */
  /*                                                                       */
  /*    metric_Data_Format     :: Always~0.                                */
  /*                                                                       */
  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */
  /*                              table -- this value can be smaller than  */
 /*                              the total number of glyphs in the font.  */
  /*                                                                       */
  /*    long_metrics           :: A pointer into the `hmtx' table.         */
  /*                                                                       */
  /*    short_metrics          :: A pointer into the `hmtx' table.         */
  /*                                                                       */
  /* <Note>                                                                */
  /*    IMPORTANT: The TT_VertHeader and TT_VertHeader structures should   */
  /*               be identical except for the names of their fields which */
  /*               are different.                                          */
  /*                                                                       */
  /*               This ensures that a single function in the `ttload'     */
  /*               module is able to read both the horizontal and vertical */
  /*               headers.                                                */
  /*                                                                       */
  /* ===================================================================== */

public class TTVertHeader extends ftbase.FTFrameRead {
    private static int oid = 0;

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

    public Long Version = 0L;
    public short Ascender = 0;
    public short Descender = 0;
    public short Line_Gap = 0;
    public Short advance_Height_Max = 0;      /* advance width maximum */
    public short min_Top_Side_Bearing = 0;  /* minimum left-sb       */
    public short min_Bottom_Side_Bearing = 0; /* minimum right-sb      */
    public short yMax_Extent = 0;            /* xmax extents          */
    public short caret_Slope_Rise = 0;
    public short caret_Slope_Run = 0;
    public short caret_Offset = 0;
    public short[] Reserved = new short[4];
    public short metric_Data_Format = 0;
    public Short number_Of_VMetrics = 0;
    /* The following fields are not defined by the TrueType specification */
    /* but they are used to connect the metrics header to the relevant    */
    /* `HMTX' table.                                                      */
    public Object long_metrics;
    public Object short_metrics;

    /* ==================== TTVertHeader ================================== */
    public TTVertHeader() {
      super(null);
    }
    
    /* ==================== TTVertHeader ================================== */
    public TTVertHeader(ftbase.FTStreamRec stream) {
      super(stream);
      oid++;
      id = oid;
      my_class_name = "org.apwtcl.gles20.truetype.TTVertHeader";
      if (frame_info.size() == 0) {
//        va = new TTInstanceVariable(my_class_name, this, "format_tag", 1);
//        frame_info.add(new FTFrameEntry("format_tag", va, readInt, VAR_IS_INT));
      }
//      fillVariables();
Debug(0, DBG_LOAD_GLYPH, TAG, "TTVertHeader offset: "+String.format("0x%08x", stream.pos()));
//      version = stream.readShort(stream);
      Version = (long)stream.readInt(stream);
      Ascender = stream.readShort(stream);
      Descender = stream.readShort(stream);
      Line_Gap = stream.readShort(stream);
      advance_Height_Max = stream.readShort(stream);
      min_Top_Side_Bearing = stream.readShort(stream);
      min_Bottom_Side_Bearing = stream.readShort(stream);
      yMax_Extent = stream.readShort(stream);
      caret_Slope_Rise = stream.readShort(stream);
      caret_Slope_Run = stream.readShort(stream);
      caret_Offset = stream.readShort(stream);
      for (int i = 0; i < 4; i++) {
        Reserved[i] = stream.readShort(stream);
      }
      metric_Data_Format = stream.readShort(stream);
      number_Of_VMetrics = stream.readShort(stream);
    }
    
    /* ==================== 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();
    }
 
}