mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 14:50:47 +00:00
Issue #198 Fixed DefineFont2Tag on zero numGlyphs
This commit is contained in:
@@ -120,19 +120,21 @@ public class DefineFont2Tag extends CharacterTag implements FontTag {
|
||||
}
|
||||
byte ba3[] = baos3.toByteArray();
|
||||
sos.write(ba2);
|
||||
long offset = ba2.length + ba3.length;
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset + 4);
|
||||
} else {
|
||||
sos.writeUI16((int) (offset + 2));
|
||||
}
|
||||
sos.write(ba3);
|
||||
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
if (fontFlagsWideCodes) {
|
||||
sos.writeUI16(codeTable.get(i));
|
||||
if (numGlyphs > 0) {
|
||||
long offset = ba2.length + ba3.length;
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset + 4);
|
||||
} else {
|
||||
sos.writeUI8(codeTable.get(i));
|
||||
sos.writeUI16((int) (offset + 2));
|
||||
}
|
||||
sos.write(ba3);
|
||||
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
if (fontFlagsWideCodes) {
|
||||
sos.writeUI16(codeTable.get(i));
|
||||
} else {
|
||||
sos.writeUI8(codeTable.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fontFlagsHasLayout) {
|
||||
@@ -187,11 +189,13 @@ public class DefineFont2Tag extends CharacterTag implements FontTag {
|
||||
offsetTable[i] = sis.readUI16();
|
||||
}
|
||||
}
|
||||
long codeTableOffset;
|
||||
if (fontFlagsWideOffsets) {
|
||||
codeTableOffset = sis.readUI32();
|
||||
} else {
|
||||
codeTableOffset = sis.readUI16();
|
||||
long codeTableOffset = 0;
|
||||
if (numGlyphs > 0) {
|
||||
if (fontFlagsWideOffsets) {
|
||||
codeTableOffset = sis.readUI32();
|
||||
} else {
|
||||
codeTableOffset = sis.readUI16();
|
||||
}
|
||||
}
|
||||
|
||||
glyphShapeTable = new SHAPE[numGlyphs];
|
||||
|
||||
Reference in New Issue
Block a user