Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
batzorent committed Aug 22, 2019
1 parent a747277 commit 66a38af
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/main/java/org/mabb/fontverter/woff/Woff1Font.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import static org.mabb.fontverter.woff.Woff1Font.Woff1Table.WOFF1_TABLE_DIRECTORY_ENTRY_SIZE;

public class Woff1Font extends WoffFont {

static final int WOFF1_HEADER_SIZE = 44;

public WoffTable createTable() {
Expand Down Expand Up @@ -134,15 +135,16 @@ protected void readCompressedData(byte[] readData) throws IOException {
}

public byte[] getDirectoryData() throws IOException {
WoffOutputStream writer = new WoffOutputStream();

writer.writeString(tag);
writer.writeInt(offset);
writer.writeInt(getCompressedData().length - paddingAdded);
writer.writeInt(tableData.length);
writer.writeUnsignedInt((int) checksum);

return writer.toByteArray();
try (WoffOutputStream writer = new WoffOutputStream()) {

writer.writeString(tag);
writer.writeInt(offset);
writer.writeInt(getCompressedData().length - paddingAdded);
writer.writeInt(tableData.length);
writer.writeUnsignedInt((int) checksum);

return writer.toByteArray();
}
}

public void setOffset(int offset) {
Expand Down

0 comments on commit 66a38af

Please sign in to comment.