mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-18 16:48:22 +00:00
#1677 DefineFont2/3 font must have layout or numGlyphs>0 for codeTableOffset to be present
This commit is contained in:
@@ -153,10 +153,12 @@ public class DefineFont2Tag extends FontTag {
|
||||
}
|
||||
}
|
||||
|
||||
if (fontFlagsWideOffsets) {
|
||||
sis.readUI32("codeTableOffset");
|
||||
} else {
|
||||
sis.readUI16("codeTableOffset");
|
||||
if (numGlyphs > 0 || fontFlagsHasLayout) {
|
||||
if (fontFlagsWideOffsets) {
|
||||
sis.readUI32("codeTableOffset");
|
||||
} else {
|
||||
sis.readUI16("codeTableOffset");
|
||||
}
|
||||
}
|
||||
|
||||
glyphShapeTable = new ArrayList<>();
|
||||
@@ -280,11 +282,13 @@ public class DefineFont2Tag extends FontTag {
|
||||
}
|
||||
}
|
||||
|
||||
long offset = (glyphShapeTable.size() + 1/*CodeTableOffset*/) * (fontFlagsWideOffsets ? 4 : 2) + baGlyphShapes.length;
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset);
|
||||
} else {
|
||||
sos.writeUI16((int) offset);
|
||||
if (numGlyphs > 0 || fontFlagsHasLayout) {
|
||||
long offset = (glyphShapeTable.size() + 1/*CodeTableOffset*/) * (fontFlagsWideOffsets ? 4 : 2) + baGlyphShapes.length;
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset);
|
||||
} else {
|
||||
sos.writeUI16((int) offset);
|
||||
}
|
||||
}
|
||||
if (numGlyphs > 0) {
|
||||
sos.write(baGlyphShapes);
|
||||
|
||||
@@ -145,10 +145,12 @@ public class DefineFont3Tag extends FontTag {
|
||||
offsetTable[i] = sis.readUI16("offset");
|
||||
}
|
||||
}
|
||||
if (fontFlagsWideOffsets) {
|
||||
sis.readUI32("codeTableOffset");
|
||||
} else {
|
||||
sis.readUI16("codeTableOffset");
|
||||
if (numGlyphs > 0 || fontFlagsHasLayout) {
|
||||
if (fontFlagsWideOffsets) {
|
||||
sis.readUI32("codeTableOffset");
|
||||
} else {
|
||||
sis.readUI16("codeTableOffset");
|
||||
}
|
||||
}
|
||||
glyphShapeTable = new ArrayList<>();
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
@@ -269,11 +271,13 @@ public class DefineFont3Tag extends FontTag {
|
||||
sos.writeUI16((int) offset2);
|
||||
}
|
||||
}
|
||||
long offset = (glyphShapeTable.size() + 1/*CodeTableOffset*/) * (fontFlagsWideOffsets ? 4 : 2) + baGlyphShapes.length;
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset);
|
||||
} else {
|
||||
sos.writeUI16((int) offset);
|
||||
if (numGlyphs > 0 || fontFlagsHasLayout) {
|
||||
long offset = (glyphShapeTable.size() + 1/*CodeTableOffset*/) * (fontFlagsWideOffsets ? 4 : 2) + baGlyphShapes.length;
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset);
|
||||
} else {
|
||||
sos.writeUI16((int) offset);
|
||||
}
|
||||
}
|
||||
if (numGlyphs > 0) {
|
||||
sos.write(baGlyphShapes);
|
||||
|
||||
Reference in New Issue
Block a user