mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-18 08:02:20 +00:00
Fixed #1711 DefineFont2-3 advance values need to be handled as unsigned (UI16)
This commit is contained in:
@@ -89,7 +89,8 @@ public class DefineFont2Tag extends FontTag {
|
||||
@Conditional("fontFlagsHasLayout")
|
||||
public int fontLeading;
|
||||
|
||||
@SWFType(BasicType.SI16)
|
||||
//Docs Says SI16, but Flash handles this as unsigned. There's probably not such thing as negative advance
|
||||
@SWFType(BasicType.UI16)
|
||||
@Conditional("fontFlagsHasLayout")
|
||||
public List<Integer> fontAdvanceTable;
|
||||
|
||||
@@ -182,7 +183,7 @@ public class DefineFont2Tag extends FontTag {
|
||||
fontLeading = sis.readSI16("fontLeading");
|
||||
fontAdvanceTable = new ArrayList<>();
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
fontAdvanceTable.add(sis.readSI16("fontAdvance"));
|
||||
fontAdvanceTable.add(sis.readUI16("fontAdvance"));
|
||||
}
|
||||
fontBoundsTable = new ArrayList<>();
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
@@ -306,7 +307,7 @@ public class DefineFont2Tag extends FontTag {
|
||||
sos.writeUI16(fontDescent);
|
||||
sos.writeSI16(fontLeading);
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
sos.writeSI16(fontAdvanceTable.get(i));
|
||||
sos.writeUI16(fontAdvanceTable.get(i));
|
||||
}
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
sos.writeRECT(fontBoundsTable.get(i));
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
|
||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.awt.Font;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -89,7 +90,8 @@ public class DefineFont3Tag extends FontTag {
|
||||
@Conditional("fontFlagsHasLayout")
|
||||
public int fontLeading;
|
||||
|
||||
@SWFType(BasicType.SI16)
|
||||
//Docs Says SI16, but Flash handles this as unsigned. There's probably not such thing as negative advance
|
||||
@SWFType(BasicType.UI16)
|
||||
@Conditional("fontFlagsHasLayout")
|
||||
public List<Integer> fontAdvanceTable;
|
||||
|
||||
@@ -171,7 +173,7 @@ public class DefineFont3Tag extends FontTag {
|
||||
fontLeading = sis.readSI16("fontLeading");
|
||||
fontAdvanceTable = new ArrayList<>();
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
fontAdvanceTable.add(sis.readSI16("fontAdvance"));
|
||||
fontAdvanceTable.add(sis.readUI16("fontAdvance"));
|
||||
}
|
||||
fontBoundsTable = new ArrayList<>();
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
@@ -296,7 +298,7 @@ public class DefineFont3Tag extends FontTag {
|
||||
sos.writeUI16(fontDescent);
|
||||
sos.writeSI16(fontLeading);
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
sos.writeSI16(fontAdvanceTable.get(i));
|
||||
sos.writeUI16(fontAdvanceTable.get(i));
|
||||
}
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
sos.writeRECT(fontBoundsTable.get(i));
|
||||
|
||||
Reference in New Issue
Block a user