diff --git a/CHANGELOG.md b/CHANGELOG.md index a49147e99..3ad4b0527 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ All notable changes to this project will be documented in this file. - #1294 Font editation (DefineFont2/3) - correct switching of wide character codes - #1302 Callpropvoid instruction docblock not correct - #1309 recent files not getting updates +- #1311 actionScript source font size - #1312 faster colliding usages finder ## [9.0.0] - 2016-08-12 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 9f5993f55..214ddaa8c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -284,6 +284,11 @@ public class Configuration { @ConfigurationName("gui.window.maximized.vertical") public static final ConfigurationItem guiWindowMaximizedVertical = null; + @ConfigurationDefaultDouble(1) + @ConfigurationCategory("display") + @ConfigurationName("gui.fontSizeMultiplier") + public static final ConfigurationItem guiFontSizeMultiplier = null; + @ConfigurationDefaultDouble(0.5) @ConfigurationName("gui.avm2.splitPane.dividerLocationPercent") @ConfigurationInternal @@ -622,7 +627,6 @@ public class Configuration { public static final ConfigurationItem showSetAdvanceValuesMessage = null; private enum OSId { - WINDOWS, OSX, UNIX } @@ -1018,7 +1022,6 @@ public class Configuration { File libsDir = getFlashLibPath(); if (libsDir != null && libsDir.exists()) { File[] libs = libsDir.listFiles(new FilenameFilter() { - @Override public boolean accept(File dir, String name) { return name.toLowerCase().startsWith("playerglobal"); @@ -1043,7 +1046,6 @@ public class Configuration { File projectoDir = getProjectorPath(); if (projectoDir != null && projectoDir.exists()) { File[] projectors = projectoDir.listFiles(new FilenameFilter() { - @Override public boolean accept(File dir, String name) { switch (exportMode) { diff --git a/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/Configuration.java b/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/Configuration.java index d0875280d..1a41a0b0b 100644 --- a/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/Configuration.java +++ b/libsrc/jsyntaxpane/jsyntaxpane/src/main/java/jsyntaxpane/util/Configuration.java @@ -27,7 +27,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * Wrapper around the Properties class with supprt for Heirarchical confogurations + * Wrapper around the Properties class with support for Hierarchical configurations * and more functionality. * * Except for the getXXXX methods, all other Map Interface methods operate on the diff --git a/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java b/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java index 281c49303..14460a0a5 100644 --- a/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/FolderPreviewPanel.java @@ -100,7 +100,6 @@ public class FolderPreviewPanel extends JPanel { cachedPreviews = Cache.getInstance(false, false, "preview"); addMouseListener(new MouseAdapter() { - @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() > 1) { @@ -154,7 +153,6 @@ public class FolderPreviewPanel extends JPanel { } repaint(); } - }); } diff --git a/src/com/jpexs/decompiler/flash/gui/View.java b/src/com/jpexs/decompiler/flash/gui/View.java index add04b510..879b5e09a 100644 --- a/src/com/jpexs/decompiler/flash/gui/View.java +++ b/src/com/jpexs/decompiler/flash/gui/View.java @@ -196,11 +196,11 @@ public class View { FontPolicy pol = SubstanceLookAndFeel.getFontPolicy(); final FontSet fs = pol.getFontSet("Substance", null); + double fontSizeMultiplier = Configuration.guiFontSizeMultiplier.get(); + //Restore default font for chinese characters SubstanceLookAndFeel.setFontPolicy(new FontPolicy() { - private final FontSet fontSet = new FontSet() { - private FontUIResource controlFont; private FontUIResource menuFont; @@ -213,11 +213,15 @@ public class View { private FontUIResource messageFont; + private int getFontSize(int defaultFontSize) { + return (int) (defaultFontSize * fontSizeMultiplier); + } + @Override public FontUIResource getControlFont() { if (controlFont == null) { FontUIResource f = fs.getControlFont(); - controlFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize()); + controlFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize())); } return controlFont; } @@ -226,7 +230,7 @@ public class View { public FontUIResource getMenuFont() { if (menuFont == null) { FontUIResource f = fs.getMenuFont(); - menuFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize()); + menuFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize())); } return menuFont; } @@ -235,7 +239,7 @@ public class View { public FontUIResource getTitleFont() { if (titleFont == null) { FontUIResource f = fs.getTitleFont(); - titleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize()); + titleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize())); } return titleFont; } @@ -244,7 +248,7 @@ public class View { public FontUIResource getWindowTitleFont() { if (windowTitleFont == null) { FontUIResource f = fs.getWindowTitleFont(); - windowTitleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize()); + windowTitleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize())); } return windowTitleFont; } @@ -253,7 +257,7 @@ public class View { public FontUIResource getSmallFont() { if (smallFont == null) { FontUIResource f = fs.getSmallFont(); - smallFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize()); + smallFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize())); } return smallFont; } @@ -262,7 +266,7 @@ public class View { public FontUIResource getMessageFont() { if (messageFont == null) { FontUIResource f = fs.getMessageFont(); - messageFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize()); + messageFont = new FontUIResource(defaultFont.getName(), f.getStyle(), getFontSize(f.getSize())); } return messageFont; } diff --git a/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java b/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java index 6779614bd..88aec184a 100644 --- a/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/editor/UndoFixedEditorPane.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.gui.editor; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.View; import com.jpexs.helpers.Stopwatch; +import java.awt.Font; import java.awt.event.KeyEvent; import java.io.IOException; import java.io.Reader; @@ -61,7 +62,6 @@ public class UndoFixedEditorPane extends JEditorPane { private void addDocumentListener() { documentListener = new DocumentListener() { - @Override public void insertUpdate(DocumentEvent e) { fireTextChanged(); @@ -88,7 +88,9 @@ public class UndoFixedEditorPane extends JEditorPane { public void changeContentType(String type) { if (!type.equals(getContentType())) { removeDocumentListener(); + Font oldFont = getFont(); setContentType(type); + setFont(oldFont); addDocumentListener(); } } diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index aa5af79cd..1a460901a 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -440,3 +440,6 @@ config.description.useFlexAs3Compiler = Use AS3 compiler from Flex SDK while Act config.name.showSetAdvanceValuesMessage = Show again information about setting advance values config.description.showSetAdvanceValuesMessage = Show again information about setting advance values + +config.name.gui.fontSizeMultiplier = Font size multiplier +config.description.gui.fontSizeMultiplier = Font size multiplier