Skip to content

Commit

Permalink
fix: wrong refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
batzorent committed Aug 22, 2019
1 parent 35fb840 commit 95bb101
Show file tree
Hide file tree
Showing 27 changed files with 114 additions and 61 deletions.
20 changes: 12 additions & 8 deletions src/main/java/org/mabb/fontverter/opentype/GlyphTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ protected byte[] generateUnpaddedData() throws IOException {
}
}

public void readData(byte[] data) throws IOException {
super.readData(data);
public void readData(byte[] data) throws IOException {
super.readData(data);

try (FontDataInputStream reader = new FontDataInputStream(data)) {
Long[] offsets = font.getLocaTable().getOffsets();

Expand All @@ -68,14 +68,18 @@ public void readData(byte[] data) throws IOException {
continue;
}

reader.seek(offset.intValue());
byte[] glyphData = reader.readBytes((int) length);
try {
reader.seek(offset.intValue());
byte[] glyphData = reader.readBytes((int) length);

TtfGlyph glyph = TtfGlyph.parse(glyphData, font);
glyphs.add(glyph);
TtfGlyph glyph = TtfGlyph.parse(glyphData, font);
glyphs.add(glyph);
} catch (Exception ex) {
log.error("", ex);
}
}
}
}
}

public List<TtfGlyph> getGlyphs() {
return glyphs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long n = stack.popUint32();
stack.popUint32();
// todo, in debugger versions of vm should invoke the font developers debugger not sure
// how to do this
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Number opCode = stack.popEint8();
// Number opCode =
stack.popEint8();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Integer functionId = (Integer) stack.pop();
Number loopCount = stack.popNumber();
// Integer functionId = (Integer)
stack.pop();
// Number loopCount =
stack.popNumber();

for (int i = 0; i < loopCount.longValue(); i++) {
// todo call function from maxp table
}
// for (int i = 0; i < loopCount.longValue(); i++) {
// // todo call function from maxp table
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// long p1 = stack.popUint32();
// long p2 = stack.popUint32();
// long p1 =
stack.popUint32();
// long p2 =
stack.popUint32();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// long point1Id = stack.popUint32();
// long point2Id = stack.popUint32();
// long ploopValue = stack.popUint32();
// long point1Id =
stack.popUint32();
// long point2Id =
stack.popUint32();
// long ploopValue =
stack.popUint32();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long p1 = stack.popUint32();
// Long p2 = stack.popUint32();
// Long ploopValue = stack.popUint32();
// Long p1 =
stack.popUint32();
// Long p2 =
stack.popUint32();
// Long ploopValue =
stack.popUint32();
// modifies graphical state stuff, not yet there with graphical state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long high = stack.popUint32();
// Long low = stack.popUint32();
// Long high =
stack.popUint32();
// Long low =
stack.popUint32();
// modifies graphical state stuff, not yet there with graphical state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long high = stack.popUint32();
// Long low = stack.popUint32();
// Long high =
stack.popUint32();
// Long low =
stack.popUint32();
// modifies graphical state stuff, not yet there with graphical state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long pointNum = stack.popUint32();
// Long pointNum =
stack.popUint32();

// todo needs to use projection vector
Float coordinateLocation = 0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long p1 = stack.popUint32();
// Long p2 = stack.popUint32();
// Long ploop = stack.popUint32();
// Long p1 =
stack.popUint32();
// Long p2 =
stack.popUint32();
// Long ploop =
stack.popUint32();
// todo graphical state
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long line1Start = stack.popUint32();
// Long line1End = stack.popUint32();
// Long line2Start = stack.popUint32();
// Long line2End = stack.popUint32();
// Long line1Start =
stack.popUint32();
// Long line1End =
stack.popUint32();
// Long line2Start =
stack.popUint32();
// Long line2End =
stack.popUint32();

// Long movePoint = stack.popUint32();
// Long movePoint =
stack.popUint32();
// todo graphical state
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long pointId2 = stack.popUint32();
// Long pointId1 = stack.popUint32();
// Long pointId2 =
stack.popUint32();
// Long pointId1 =
stack.popUint32();

// todo graphics state to grab actual point values
Float distance = 0.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long pointId = stack.popUint32();
// Long pointId =
stack.popUint32();

// todo graphics state handeling
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long pointId = stack.popUint32();
// Long pointId =
stack.popUint32();

// todo graphics state handeling
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Float cvtEntry = stack.popF26Dot6();
// Long pointId = stack.popUint32();
// Float cvtEntry =
stack.popF26Dot6();
// Long pointId =
stack.popUint32();

// todo graphics state handeling
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Float cvtEntry = stack.popF26Dot6();
// Long pointId = stack.popUint32();
// Float cvtEntry =
stack.popF26Dot6();
// Long pointId =
stack.popUint32();

// todo graphics state handeling
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Float distance = stack.popF26Dot6();
// Long pointId = stack.popUint32();
// Float distance =
stack.popF26Dot6();
// Long pointId =
stack.popUint32();

// todo graphics state handeling
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Float coordinateValue = stack.popF26Dot6();
// Long pointId = stack.popUint32();
// Float coordinateValue =
stack.popF26Dot6();
// Long pointId =
stack.popUint32();

// todo graphics state handeling
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long point2Id = stack.popUint32();
// Long point1Id = stack.popUint32();
// Long point2Id =
stack.popUint32();
// Long point1Id =
stack.popUint32();

// todo graphics state handeling
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long pointId2 = stack.popUint32();
// Long pointId1 = stack.popUint32();
// Long pointId2 =
stack.popUint32();
// Long pointId1 =
stack.popUint32();
// todo graphics state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long pointId2 = stack.popUint32();
// Long pointId1 = stack.popUint32();
// Long pointId2 =
stack.popUint32();
// Long pointId1 =
stack.popUint32();
// todo graphics state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long contourId = stack.popUint32();
// Long contourId =
stack.popUint32();
// todo graphics state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Float shift = stack.popF26Dot6();
// Float shift =
stack.popF26Dot6();
// todo graphics state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long pointId1 = stack.popUint32();
// Long pointId2 = stack.popUint32();
// Long ploopvalue = stack.popUint32();
// Long pointId1 =
stack.popUint32();
// Long pointId2 =
stack.popUint32();
// Long ploopvalue =
stack.popUint32();
// todo graphics state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long zoneId = stack.popUint32();
// Long zoneId =
stack.popUint32();
// todo graphics state handeling
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public void read(FontDataInputStream in) throws IOException {
}

public void execute(InstructionStack stack) throws IOException {
// Long id = stack.popUint32();
// Long id =
stack.popUint32();
// todo graphics state handeling
}
}

0 comments on commit 95bb101

Please sign in to comment.