diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java index ec65ac569..4c1a44417 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java @@ -149,7 +149,7 @@ public final class DefineCompactedFont extends FontTag implements DrawableTag { FontType font = fonts.get(0); double d = 1; //1024/font.nominalSize; - SHAPE shp = SHAPERECORD.fontCharacterToSHAPE(cfont, fontStyle, (int) (SWF.unitDivisor * font.nominalSize * d), character); + SHAPE shp = SHAPERECORD.fontCharacterToSHAPE(cfont, fontStyle, (int) (font.nominalSize * d), character); int code = (int) character; int pos = -1; 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 12e5d3346..3fcaf4104 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; @@ -38,7 +39,7 @@ public class ContourType implements Serializable { public ContourType(List records) { int i = 0; - int divider = 20; + int divider = 1; for (; i < records.size(); i++) { if (records.get(i) instanceof StyleChangeRecord) { StyleChangeRecord scr = (StyleChangeRecord) records.get(i); @@ -69,20 +70,23 @@ public class ContourType implements Serializable { edges = edgesList.toArray(new EdgeType[edgesList.size()]); } - public ContourType(GFxInputStream sis) throws IOException { + public ContourType(GFxInputStream sis,long fontOffset) throws IOException { moveToX = sis.readSI15("moveToX"); moveToY = sis.readSI15("moveToY"); long numEdgesRef = sis.readUI30("numEdgesRef"); isReference = (numEdgesRef & 1) == 1; numEdgesRef >>= 1; long oldPos = sis.getPos(); + int numEdges; if (isReference) { - sis.setPos(numEdgesRef); - numEdgesRef = sis.readUI30("numEdgesRef"); - numEdgesRef >>= 1; + long referencePos = numEdgesRef; + sis.setPos(fontOffset+referencePos); + numEdges = (int)(sis.readUI30("numEdges") >> 1); + }else{ + numEdges = (int)numEdgesRef; } - edges = new EdgeType[(int) numEdgesRef]; + edges = new EdgeType[(int) numEdges]; for (int i = 0; i < edges.length; i++) { sis.newDumpLevel("edgeType", "EdgeType"); edges[i] = new EdgeType(sis); 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 b1a516056..563efc0ca 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; @@ -73,10 +74,10 @@ public class FontType implements Serializable { for (int i = 0; i < glyphInfo.size(); i++) { sis.setPos(glyphInfo.get(i).globalOffset + offset); sis.newDumpLevel("glyphType", "GlyphType"); - glyphs.add(new GlyphType(sis)); + glyphs.add(new GlyphType(sis,offset)); sis.endDumpLevel(); } - + sis.setPos(pos); } 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 4cf267bf2..045ba90bc 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; @@ -60,7 +61,7 @@ public class GlyphType implements Serializable { contours = contoursList.toArray(new ContourType[contoursList.size()]); } - public GlyphType(GFxInputStream sis) throws IOException { + public GlyphType(GFxInputStream sis, long fontOffset) throws IOException { boundingBox = new int[4]; for (int i = 0; i < 4; i++) { boundingBox[i] = sis.readSI15("boundingBox"); @@ -69,7 +70,7 @@ public class GlyphType implements Serializable { contours = new ContourType[numContours]; for (int i = 0; i < numContours; i++) { sis.newDumpLevel("contourType", "ContourType"); - contours[i] = new ContourType(sis); + contours[i] = new ContourType(sis, fontOffset); sis.endDumpLevel(); } }