mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 17:18:05 +00:00
Issue #504: font name reading fixed
This commit is contained in:
@@ -214,7 +214,11 @@ public class DefineFont2Tag extends FontTag {
|
||||
fontFlagsBold = sis.readUB(1) == 1;
|
||||
languageCode = sis.readLANGCODE();
|
||||
int fontNameLen = sis.readUI8();
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
if (version >= 6) {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen), Utf8Helper.charset);
|
||||
} else {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
}
|
||||
numGlyphs = sis.readUI16();
|
||||
//offsetTable = new long[numGlyphs];
|
||||
for (int i = 0; i < numGlyphs; i++) { //offsetTable
|
||||
|
||||
@@ -124,7 +124,11 @@ public class DefineFont3Tag extends FontTag {
|
||||
fontFlagsBold = sis.readUB(1) == 1;
|
||||
languageCode = sis.readLANGCODE();
|
||||
int fontNameLen = sis.readUI8();
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
if (version >= 6) {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen), Utf8Helper.charset);
|
||||
} else {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
}
|
||||
numGlyphs = sis.readUI16();
|
||||
for (int i = 0; i < numGlyphs; i++) { //offsetTable
|
||||
if (fontFlagsWideOffsets) {
|
||||
|
||||
@@ -95,7 +95,11 @@ public class DefineFontInfo2Tag extends Tag {
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontID = sis.readUI16();
|
||||
int fontNameLen = sis.readUI8();
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
if (version >= 6) {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen), Utf8Helper.charset);
|
||||
} else {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
}
|
||||
sis.readUB(2);//reserved
|
||||
fontFlagsSmallText = sis.readUB(1) == 1;
|
||||
fontFlagsShiftJIS = sis.readUB(1) == 1;
|
||||
|
||||
@@ -87,6 +87,7 @@ public class DefineFontInfoTag extends Tag {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param swf
|
||||
* @param data Data bytes
|
||||
* @param version SWF version
|
||||
* @param pos
|
||||
@@ -97,7 +98,11 @@ public class DefineFontInfoTag extends Tag {
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontId = sis.readUI16();
|
||||
int fontNameLen = sis.readUI8();
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
if (version >= 6) {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen), Utf8Helper.charset);
|
||||
} else {
|
||||
fontName = new String(sis.readBytesEx(fontNameLen));
|
||||
}
|
||||
sis.readUB(2); //reserved
|
||||
fontFlagsSmallText = sis.readUB(1) == 1;
|
||||
fontFlagsShiftJIS = sis.readUB(1) == 1;
|
||||
|
||||
Reference in New Issue
Block a user