diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java
index aea323765..ded1285ba 100644
--- a/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java
+++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java
@@ -198,12 +198,12 @@ public abstract class TextTag extends CharacterTag implements BoundedTag, Drawab
if (nextEntry != null) {
kerningAdjustment = font.getGlyphKerningAdjustment(entry.glyphIndex, nextEntry.glyphIndex);
}
- defaultAdvance = (int) Math.round(SWF.unitDivisor * textHeight * (font.getGlyphAdvance(entry.glyphIndex) + kerningAdjustment) / (font.getDivider() * 1024.0));
+ defaultAdvance = (int) Math.round(textHeight * (font.getGlyphAdvance(entry.glyphIndex) + kerningAdjustment) / 1024.0);
} else {
defaultAdvance = (int) Math.round(SWF.unitDivisor * FontTag.getSystemFontAdvance(aFont, font.glyphToChar(entry.glyphIndex), nextEntry == null ? null : font.glyphToChar(nextEntry.glyphIndex)));
}
letterSpacing = adv - defaultAdvance;
- x += adv;
+ x += adv/(font.getDivider());
}
allLetterSpacings.add(letterSpacing);
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java
index b94202263..fdb2e40a5 100644
--- a/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java
+++ b/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.exporters.MovieExporter;
import com.jpexs.decompiler.flash.exporters.SoundExporter;
+import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.exporters.modes.MovieExportMode;
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
import com.jpexs.decompiler.flash.exporters.modes.SoundExportMode;
@@ -392,20 +393,24 @@ public class XFLConverter {
}
public static String convertMatrix(MATRIX m) {
+ return convertMatrix(new Matrix(m));
+ }
+
+ public static String convertMatrix(Matrix m) {
String ret = "";
if (m == null) {
- m = new MATRIX();
+ m = new Matrix();
}
ret += "";
return ret;
@@ -1447,9 +1452,8 @@ public class XFLConverter {
format += 1;
}
format += 4; //quality best
- SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(soundData), swf.version);
try {
- MP3SOUNDDATA s = new MP3SOUNDDATA(sis, false);
+ MP3SOUNDDATA s = new MP3SOUNDDATA(new ByteArrayInputStream(soundData), false);
//sis.readSI16();
//MP3FRAME frame = new MP3FRAME(sis);
MP3FRAME frame = s.frames.get(0);
@@ -2295,11 +2299,13 @@ public class XFLConverter {
return ret;
}
- public static String convertText(String instanceName, List tags, TextTag tag, MATRIX matrix, List filters, CLIPACTIONS clipActions) {
+ public static String convertText(String instanceName, List tags, TextTag tag, MATRIX m, List filters, CLIPACTIONS clipActions) {
String ret = "";
- if (matrix == null) {
- matrix = new MATRIX();
+
+ if (m == null) {
+ m = new MATRIX();
}
+ Matrix matrix=new Matrix(m);
CSMTextSettingsTag csmts = null;
String filterStr = "";
if (filters != null) {
@@ -2331,18 +2337,12 @@ public class XFLConverter {
}
String matStr = "";
matStr += "";
+ String left = "";
RECT bounds = tag.getBounds();
if ((tag instanceof DefineTextTag) || (tag instanceof DefineText2Tag)) {
- MATRIX textMatrix = tag.getTextMatrix();
- matrix = matrix.merge(textMatrix);
- } else {
- matrix.translateX += bounds.Xmin;
- matrix.translateY += bounds.Ymin;
-
- //I do not know why, but there is (always?) 2px difference
- matrix.translateX += 2 * 20;
- matrix.translateY += 2 * 20;
- }
+ MATRIX textMatrix = tag.getTextMatrix();
+ left = " left=\""+doubleToString((textMatrix.translateX)/SWF.unitDivisor)+"\"";
+ }
matStr += convertMatrix(matrix);
matStr += "";
if ((tag instanceof DefineTextTag) || (tag instanceof DefineText2Tag)) {
@@ -2352,7 +2352,7 @@ public class XFLConverter {
} else if (tag instanceof DefineText2Tag) {
textRecords = ((DefineText2Tag) tag).textRecords;
}
-
+
looprec:
for (TEXTRECORD rec : textRecords) {
if (rec.styleFlagsHasFont) {
@@ -2371,6 +2371,7 @@ public class XFLConverter {
}
ret += "