From da4b6934de607dea8f8eb58cc239a892e70f9c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 5 Nov 2022 09:10:33 +0100 Subject: [PATCH] Fixed #1818 GFX: Importing XML --- CHANGELOG.md | 2 ++ .../flash/importers/SwfXmlImporter.java | 15 ++++++++++++++- .../flash/tags/gfx/DefineExternalGradient.java | 9 ++++++++- .../flash/tags/gfx/DefineExternalImage.java | 12 ++++++++++++ .../flash/tags/gfx/DefineExternalImage2.java | 12 +++++++++++- .../flash/tags/gfx/DefineExternalSound.java | 10 +++++++++- .../flash/tags/gfx/DefineExternalStreamSound.java | 11 ++++++++++- .../flash/tags/gfx/DefineGradientMap.java | 11 ++++++++++- .../decompiler/flash/tags/gfx/DefineSubImage.java | 13 +++++++++++++ .../decompiler/flash/tags/gfx/ExporterInfo.java | 11 ++++++++++- .../flash/tags/gfx/FontTextureInfo.java | 11 ++++++++++- .../decompiler/flash/types/gfx/ContourType.java | 7 ++++++- .../decompiler/flash/types/gfx/EdgeType.java | 7 ++++++- .../decompiler/flash/types/gfx/FONTINFO.java | 7 ++++++- .../decompiler/flash/types/gfx/FontType.java | 5 +++-- .../decompiler/flash/types/gfx/GLYPHIDX.java | 6 +++++- .../decompiler/flash/types/gfx/GlyphInfoType.java | 6 +++++- .../decompiler/flash/types/gfx/GlyphType.java | 12 +++++++++++- .../flash/types/gfx/KerningPairType.java | 8 +++++++- .../decompiler/flash/types/gfx/TEXGLYPH.java | 6 +++++- 20 files changed, 163 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee2ea8681..ec2d871ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. - GFX: Drawing missing DefineExternalImage/2, DefineSubImage as red instead of throwing exception - GFX: DefineExternalImage2 properly saving characterId - Hex view refreshing after selecting Unknown tag +- [#1818] GFX: Importing XML ## [16.0.4] - 2022-11-03 ### Fixed @@ -2478,6 +2479,7 @@ All notable changes to this project will be documented in this file. [#1849]: https://www.free-decompiler.com/flash/issues/1849 [#1712]: https://www.free-decompiler.com/flash/issues/1712 [#1857]: https://www.free-decompiler.com/flash/issues/1857 +[#1818]: https://www.free-decompiler.com/flash/issues/1818 [#1860]: https://www.free-decompiler.com/flash/issues/1860 [#1782]: https://www.free-decompiler.com/flash/issues/1782 [#1679]: https://www.free-decompiler.com/flash/issues/1679 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/SwfXmlImporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/SwfXmlImporter.java index 3642a998f..18193815c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/SwfXmlImporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/SwfXmlImporter.java @@ -95,6 +95,15 @@ import com.jpexs.decompiler.flash.types.filters.DROPSHADOWFILTER; import com.jpexs.decompiler.flash.types.filters.GLOWFILTER; import com.jpexs.decompiler.flash.types.filters.GRADIENTBEVELFILTER; import com.jpexs.decompiler.flash.types.filters.GRADIENTGLOWFILTER; +import com.jpexs.decompiler.flash.types.gfx.ContourType; +import com.jpexs.decompiler.flash.types.gfx.EdgeType; +import com.jpexs.decompiler.flash.types.gfx.FONTINFO; +import com.jpexs.decompiler.flash.types.gfx.FontType; +import com.jpexs.decompiler.flash.types.gfx.GLYPHIDX; +import com.jpexs.decompiler.flash.types.gfx.GlyphInfoType; +import com.jpexs.decompiler.flash.types.gfx.GlyphType; +import com.jpexs.decompiler.flash.types.gfx.KerningPairType; +import com.jpexs.decompiler.flash.types.gfx.TEXGLYPH; import com.jpexs.decompiler.flash.types.shaperecords.CurvedEdgeRecord; import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord; import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord; @@ -168,7 +177,11 @@ public class SwfXmlImporter { AVM2ConstantPool.class, Decimal.class, Namespace.class, NamespaceSet.class, Multiname.class, MethodInfo.class, MetadataInfo.class, ValueKind.class, InstanceInfo.class, Traits.class, TraitClass.class, TraitFunction.class, TraitMethodGetterSetter.class, TraitSlotConst.class, ClassInfo.class, ScriptInfo.class, MethodBody.class, - ABCException.class, ABCVersion.class, Amf3Value.class}; + ABCException.class, ABCVersion.class, Amf3Value.class, + //GFX: + ContourType.class, EdgeType.class, FONTINFO.class, FontType.class, GLYPHIDX.class, + GlyphInfoType.class, GlyphType.class, KerningPairType.class, TEXGLYPH.class + }; for (Class cls2 : knownObjects) { if (!ReflectionTools.canInstantiateDefaultConstructor(cls2)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java index b3f03e05a..bdfa3e5fc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.Tag; @@ -71,6 +73,11 @@ public class DefineExternalGradient extends Tag { readData(sis, data, 0, false, false, false); } + public DefineExternalGradient(SWF swf) { + super(swf, ID, NAME, null); + fileName = ""; + } + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { gradientId = sis.readUI16("gradientId"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java index 80ea67c98..55e24d6ac 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.helpers.ImageHelper; @@ -93,6 +94,17 @@ public class DefineExternalImage extends ImageTag { readData(sis, data, 0, false, false, false); } + public DefineExternalImage(SWF swf) { + super(swf, ID, NAME, null); + exportName = ""; + fileName = ""; + targetWidth = 1; + targetHeight = 1; + createFailedImage(); + } + + + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java index 012d3102e..a1dd958fb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.helpers.ImageHelper; @@ -68,7 +69,7 @@ public class DefineExternalImage2 extends ImageTag { @HideInRawEdit private SerializableImage serImage; - + /** * Gets data bytes * @@ -101,6 +102,15 @@ public class DefineExternalImage2 extends ImageTag { readData(sis, data, 0, false, false, false); } + public DefineExternalImage2(SWF swf) { + super(swf, ID, NAME, null); + exportName = ""; + fileName = ""; + targetWidth = 1; + targetHeight = 1; + createFailedImage(); + } + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID") | 0x8000; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java index e60946fb1..5c728432c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.Tag; @@ -81,6 +83,12 @@ public class DefineExternalSound extends Tag { super(sis.getSwf(), ID, NAME, data); readData(sis, data, 0, false, false, false); } + + public DefineExternalSound(SWF swf) { + super(swf, ID, NAME, null); + exportName = ""; + fileName = ""; + } @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java index c46ac8c00..ed09c043c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.Tag; @@ -82,6 +84,13 @@ public class DefineExternalStreamSound extends Tag { readData(sis, data, 0, false, false, false); } + public DefineExternalStreamSound(SWF swf) { + super(swf, ID, NAME, null); + fileName = ""; + } + + + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { soundFormat = sis.readUI16("soundFormat"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java index 7f4bd477d..8bd844d4b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.Tag; @@ -59,6 +61,13 @@ public class DefineGradientMap extends Tag { readData(sis, data, 0, false, false, false); } + public DefineGradientMap(SWF swf) { + super(swf, ID, NAME, null); + indices = new int[0]; + } + + + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { int numGradients = sis.readUI16("numGradients"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java index 7645db804..3dc77cb1c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.helpers.ImageHelper; @@ -88,6 +89,18 @@ public class DefineSubImage extends ImageTag { readData(sis, data, 0, false, false, false); } + public DefineSubImage(SWF swf) { + super(swf, ID, NAME, null); + characterID = swf.getNextCharacterId(); + x1 = 0; + x2 = 1; + y1 = 0; + y2 = 1; + createFailedImage(); + } + + + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { characterID = sis.readUI16("characterID"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java index dc61b0b0b..0040048fc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.Tag; @@ -93,6 +95,13 @@ public class ExporterInfo extends Tag { readData(sis, data, 0, false, false, false); } + public ExporterInfo(SWF swf) { + super(swf, ID, NAME, null); + swfName = ""; + } + + + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { this.version = sis.readUI16("version"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java index 5fa24fac5..aea807ca6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java @@ -12,9 +12,11 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.tags.gfx; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.tags.Tag; @@ -97,6 +99,13 @@ public class FontTextureInfo extends Tag { readData(sis, data, 0, false, false, false); } + public FontTextureInfo(SWF swf) { + super(swf, ID, NAME, null); + fileName = ""; + } + + + @Override public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException { textureID = sis.readUI32("textureID"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/ContourType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/ContourType.java index f18ecddb7..317e92e0e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/ContourType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/ContourType.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import com.jpexs.decompiler.flash.types.shaperecords.CurvedEdgeRecord; @@ -74,6 +75,10 @@ public class ContourType implements Serializable { edges = edgesList.toArray(new EdgeType[edgesList.size()]); } + public ContourType() { + edges = new EdgeType[0]; + } + public ContourType(GFxInputStream sis, long fontOffset) throws IOException { moveToX = sis.readSI15("moveToX"); moveToY = sis.readSI15("moveToY"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java index 09dfd4c2d..e16099c15 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import com.jpexs.decompiler.flash.types.shaperecords.CurvedEdgeRecord; @@ -70,6 +71,10 @@ public class EdgeType implements Serializable { private static final int Edge_Quad = 3; public int[] data; + + public EdgeType() { + data = new int[] {Edge_Line, 0, 0}; + } public EdgeType(boolean vertical, int v) { data = new int[]{vertical ? Edge_VLine : Edge_HLine, v}; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java index e765d6cbc..aa3be608f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import java.io.IOException; @@ -28,6 +29,10 @@ public class FONTINFO implements Serializable { public GLYPHIDX[] glyphIndices; + public FONTINFO() { + glyphIndices = new GLYPHIDX[0]; + } + public FONTINFO(int fontId, int numGlyphs, GLYPHIDX[] glyphIndices) { this.fontId = fontId; this.glyphIndices = glyphIndices; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java index 78cfbf554..3a3c1d8c2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import com.jpexs.decompiler.flash.types.SHAPE; @@ -56,7 +57,7 @@ public class FontType implements Serializable { kerning = new ArrayList<>(); glyphs = new ArrayList<>(); } - + public FontType(GFxInputStream sis) throws IOException { long offset = sis.getPos(); fontName = sis.readString("fontName"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GLYPHIDX.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GLYPHIDX.java index 204a9d58a..02315accc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GLYPHIDX.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GLYPHIDX.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import java.io.IOException; @@ -28,6 +29,9 @@ public class GLYPHIDX implements Serializable { public int indexInTexture; + public GLYPHIDX() { + } + public GLYPHIDX(int indexInFont, int indexInTexture) { this.indexInFont = indexInFont; this.indexInTexture = indexInTexture; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphInfoType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphInfoType.java index 813bfdcac..17da395e8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphInfoType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphInfoType.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import java.io.IOException; @@ -30,6 +31,9 @@ public class GlyphInfoType implements Serializable { public long globalOffset; + public GlyphInfoType() { + } + public GlyphInfoType(int glyphCode, int advance, int glyphPos) { this.glyphCode = glyphCode; this.advanceX = advance; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphType.java index 27fe38578..1d30c2e39 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GlyphType.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import com.jpexs.decompiler.flash.types.RECT; @@ -35,6 +36,15 @@ public class GlyphType implements Serializable { public ContourType[] contours; + public GlyphType() { + contours = new ContourType[0]; + boundingBox = new int[4]; + boundingBox[2] = 1; //xmax + boundingBox[3] = 1; //ymax + } + + + public GlyphType(List records) { RECT bounds = SHAPERECORD.getBounds(records); boundingBox = new int[4]; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/KerningPairType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/KerningPairType.java index e2b90e29f..9263f642c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/KerningPairType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/KerningPairType.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import java.io.IOException; @@ -30,6 +31,11 @@ public class KerningPairType implements Serializable { public int advance; + public KerningPairType() { + } + + + public KerningPairType(int char1, int char2, int advance) { this.char1 = char1; this.char2 = char2; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/TEXGLYPH.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/TEXGLYPH.java index 4d4055f31..01a9fec6d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/TEXGLYPH.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/TEXGLYPH.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.gfx; import java.io.IOException; @@ -36,6 +37,9 @@ public class TEXGLYPH implements Serializable { public float uvOriginY; + public TEXGLYPH() { + } + public TEXGLYPH(float uvBoundsLeft, float uvBoundsTop, float uvBoundsRight, float uvBoundsBottom, float uvOriginX, float uvOriginY) { this.uvBoundsLeft = uvBoundsLeft; this.uvBoundsTop = uvBoundsTop;