mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-19 02:08:08 +00:00
Fixed #1711 DefineFont2-3 advance values need to be handled as unsigned (UI16)
This commit is contained in:
@@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Freetransform tool dragging not always started on mousedown
|
||||
- [#1695] Freetransform tool vs zooming
|
||||
- [#1752] Freetransform tool on sprites with offset
|
||||
- [#1711] DefineFont2-3 advance values need to be handled as unsigned (UI16)
|
||||
|
||||
### Changed
|
||||
- AS3 integer values are internally (e.g. in the lib) handled as java int type instead of long.
|
||||
@@ -2404,6 +2405,7 @@ All notable changes to this project will be documented in this file.
|
||||
[#1771]: https://www.free-decompiler.com/flash/issues/1771
|
||||
[#1695]: https://www.free-decompiler.com/flash/issues/1695
|
||||
[#1752]: https://www.free-decompiler.com/flash/issues/1752
|
||||
[#1711]: https://www.free-decompiler.com/flash/issues/1711
|
||||
[#270]: https://www.free-decompiler.com/flash/issues/270
|
||||
[#1718]: https://www.free-decompiler.com/flash/issues/1718
|
||||
[#1801]: https://www.free-decompiler.com/flash/issues/1801
|
||||
|
||||
@@ -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