#1075 Lenght of DefineText is more larger than original when DefineText is saved: detect letter spacing

This commit is contained in:
2015-12-20 11:12:32 +01:00
parent da2d824e9c
commit 300022acc7
5 changed files with 81 additions and 51 deletions
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.configuration.SwfSpecificConfiguration;
import com.jpexs.decompiler.flash.gui.helpers.TableLayoutHelper;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.FontTag;
@@ -214,28 +213,7 @@ public class FontPanel extends JPanel {
fontCharactersScrollPane.getVerticalScrollBar().scrollRectToVisible(new Rectangle(0, 0, 1, 1));
setAllowSave(false);
String selectedFont;
if (swf.sourceFontNamesMap.containsKey(ft.getFontId())) {
selectedFont = swf.sourceFontNamesMap.get(ft.getFontId());
} else {
SwfSpecificConfiguration swfConf = Configuration.getSwfSpecificConfiguration(swf.getShortFileName());
String key = ft.getFontId() + "_" + ft.getFontNameIntag();
if (swfConf != null && swfConf.fontPairingMap.containsKey(key)) {
selectedFont = swfConf.fontPairingMap.get(key);
} else if (Configuration.getFontToNameMap().containsKey(ft.getFontNameIntag())) {
selectedFont = Configuration.getFontToNameMap().get(ft.getFontNameIntag());
} else {
selectedFont = FontTag.findInstalledFontName(ft.getFontName());
}
}
Font selFont = FontTag.installedFontsByName.get(selectedFont);
if (selFont == null) {
selectedFont = FontTag.findInstalledFontName(ft.getFontName());
selFont = FontTag.installedFontsByName.get(selectedFont);
}
Font selFont = ft.getSystemFont();
fontFamilyNameSelection.setSelectedItem(new FontFamily(selFont));
fontFaceSelection.setSelectedItem(new FontFace(selFont));