From 14c2b3f54748779b2fbd3db8b908e1672897c777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 7 Mar 2016 20:32:05 +0100 Subject: [PATCH] #1193 FLA export - text tag advance fix for some fonts --- .../src/com/jpexs/decompiler/flash/tags/base/TextTag.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/TextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/TextTag.java index deb48e304..9c47e26a3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/TextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/TextTag.java @@ -336,11 +336,12 @@ public abstract class TextTag extends CharacterTag implements DrawableTag { if (nextEntry != null) { kerningAdjustment = font.getGlyphKerningAdjustment(entry.glyphIndex, nextEntry.glyphIndex); } - defaultAdvance = (int) Math.round(textHeight * (font.getGlyphAdvance(entry.glyphIndex) + kerningAdjustment) / 1024.0); + defaultAdvance = (int) (Math.round(textHeight * (font.getGlyphAdvance(entry.glyphIndex) + kerningAdjustment) / 1024.0) / font.getDivider()); } 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 / (font.getDivider()); } allLetterSpacings.add(letterSpacing);