diff --git a/.gitignore b/.gitignore index 9ac98523f..6f4ef8cae 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.conflict~ *.identcache *.recompiled.swf +*(Selective Sync Conflict* run_test_*.swf Thumbs.db /build/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc9db6f1..e882be30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. ### Removed - Due to Java9+ limited support of reflection, following features were removed: -- Support for detecting installed fonts - affects fonts editation +- Automatic detection of installed fonts changes (on font editation) - FFDec needs to be restarted to font changes to take effect - XML import/export - Raw editation of tags - Generic editation of tags through treeview (affects tags like FileAttributes, ExportAssets) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java index efd10c7b7..f8fd816fb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java @@ -56,11 +56,11 @@ public class FontHelper { * @return Map> */ public static Map> getInstalledFonts() { - return new HashMap<>(); - /*NOT AVAILABLE SINCE JAVA9+ + Map> ret = new HashMap<>(); Font[] fonts = null; + /*Refreshing list of installed fonts - reflection access NOT AVAILABLE SINCE JAVA9+ try { Object fm = getFontManager(); @@ -88,7 +88,7 @@ public class FontHelper { } catch (Throwable ex) { // ignore } - + */ if (fonts == null) { fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); } @@ -107,7 +107,7 @@ public class FontHelper { ret.get(fam).put(f.getFontName(Locale.ENGLISH), f); } - return ret;*/ + return ret; } public static String fontToString(Font font) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java index 660d392a1..e7b09d667 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -285,9 +285,7 @@ public abstract class FontTag extends DrawableTag implements AloneTag { } else if (installedFontsByFamily.containsKey("Arial")) { defaultFontName = "Arial"; } else { - //NOT AVAILABLE SINCE JAVA9+ - //defaultFontName = installedFontsByFamily.keySet().iterator().next(); - defaultFontName = "Dialog"; + defaultFontName = installedFontsByFamily.keySet().iterator().next(); } } @@ -303,11 +301,7 @@ public abstract class FontTag extends DrawableTag implements AloneTag { return "Arial"; } - //NOT AVAILABLE SINCE JAVA9+ - //First font - //return installedFontsByFamily.keySet().iterator().next(); - - return "Dialog"; + return installedFontsByFamily.keySet().iterator().next(); } public static String isFontFamilyInstalled(String fontFamily) { diff --git a/src/com/jpexs/decompiler/flash/gui/FontPanel.java b/src/com/jpexs/decompiler/flash/gui/FontPanel.java index 8541f7b2c..5102ea5ee 100644 --- a/src/com/jpexs/decompiler/flash/gui/FontPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/FontPanel.java @@ -101,10 +101,10 @@ public class FontPanel extends JPanel { public static ComboBoxModel getFaceModel(FontFamily family) { Set faceSet = new TreeSet<>(); - /*NOT AVAILABLE SINCE JAVA 9+ + for (Font f : FontTag.getInstalledFontsByFamily().get(family.familyEn).values()) { faceSet.add(new FontFace(f)); - }*/ + } return new DefaultComboBoxModel<>(new Vector<>(faceSet)); }