aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schweinsberg <[email protected]>2010-08-10 11:44:02 +0000
committerDavid Schweinsberg <[email protected]>2010-08-10 11:44:02 +0000
commit6b8acb81454a6100c723f5168d81140998531e37 (patch)
tree9a47bbc0c4f0598fb336d3a9547ab1b4dd4a7c83
parent11f9632f6553436a19822e5e5dc1536ab204dc5c (diff)
Fixed problem where unsigned shorts were being read in as signed shorts.
-rw-r--r--src/net/java/dev/typecast/ot/table/GlyfCompositeComp.java14
-rw-r--r--src/net/java/dev/typecast/ot/table/HheaTable.java8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/net/java/dev/typecast/ot/table/GlyfCompositeComp.java b/src/net/java/dev/typecast/ot/table/GlyfCompositeComp.java
index 0bb517f..0a3f91a 100644
--- a/src/net/java/dev/typecast/ot/table/GlyfCompositeComp.java
+++ b/src/net/java/dev/typecast/ot/table/GlyfCompositeComp.java
@@ -54,7 +54,7 @@ import java.io.DataInput;
import java.io.IOException;
/**
- * @version $Id: GlyfCompositeComp.java,v 1.2 2004-12-15 14:10:25 davidsch Exp $
+ * @version $Id: GlyfCompositeComp.java,v 1.3 2010-08-10 11:41:55 davidsch Exp $
* @author <a href="mailto:[email protected]">David Schweinsberg</a>
*/
public class GlyfCompositeComp {
@@ -73,8 +73,8 @@ public class GlyfCompositeComp {
private int _firstContour;
private short _argument1;
private short _argument2;
- private short _flags;
- private short _glyphIndex;
+ private int _flags;
+ private int _glyphIndex;
private double _xscale = 1.0;
private double _yscale = 1.0;
private double _scale01 = 0.0;
@@ -88,8 +88,8 @@ public class GlyfCompositeComp {
throws IOException {
_firstIndex = firstIndex;
_firstContour = firstContour;
- _flags = di.readShort();
- _glyphIndex = di.readShort();
+ _flags = di.readUnsignedShort();
+ _glyphIndex = di.readUnsignedShort();
// Get the arguments as just their raw values
if ((_flags & ARG_1_AND_2_ARE_WORDS) != 0) {
@@ -146,11 +146,11 @@ public class GlyfCompositeComp {
return _argument2;
}
- public short getFlags() {
+ public int getFlags() {
return _flags;
}
- public short getGlyphIndex() {
+ public int getGlyphIndex() {
return _glyphIndex;
}
diff --git a/src/net/java/dev/typecast/ot/table/HheaTable.java b/src/net/java/dev/typecast/ot/table/HheaTable.java
index 0f90ad2..4b49f41 100644
--- a/src/net/java/dev/typecast/ot/table/HheaTable.java
+++ b/src/net/java/dev/typecast/ot/table/HheaTable.java
@@ -13,7 +13,7 @@ import java.io.IOException;
import net.java.dev.typecast.ot.Fixed;
/**
- * @version $Id: HheaTable.java,v 1.1.1.1 2004-12-05 23:14:44 davidsch Exp $
+ * @version $Id: HheaTable.java,v 1.2 2010-08-10 11:44:02 davidsch Exp $
* @author <a href="mailto:[email protected]">David Schweinsberg</a>
*/
public class HheaTable implements Table {
@@ -30,7 +30,7 @@ public class HheaTable implements Table {
private short caretSlopeRise;
private short caretSlopeRun;
private short metricDataFormat;
- private short numberOfHMetrics;
+ private int numberOfHMetrics;
protected HheaTable(DirectoryEntry de, DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
@@ -48,7 +48,7 @@ public class HheaTable implements Table {
di.readShort();
}
metricDataFormat = di.readShort();
- numberOfHMetrics = di.readShort();
+ numberOfHMetrics = di.readUnsignedShort();
}
public short getAdvanceWidthMax() {
@@ -87,7 +87,7 @@ public class HheaTable implements Table {
return minRightSideBearing;
}
- public short getNumberOfHMetrics() {
+ public int getNumberOfHMetrics() {
return numberOfHMetrics;
}