diff --git a/src/main/config/irscrutinizer.sh b/src/main/config/irscrutinizer.sh index f95fecd8..71a6da0f 100755 --- a/src/main/config/irscrutinizer.sh +++ b/src/main/config/irscrutinizer.sh @@ -8,17 +8,10 @@ # When changing this file, or updating the programs, it may be a good idea to # delete the property file, normally ~/.config/IrScrutinizer/properties.xml. -if [ "$1" = "-s" -o "$1" = "--scale" ] ; then - SCALE_FACTOR=$2 - shift 2 -fi - # Set to the preferred Java VM, with or without directory. JAVA=${JAVA:-java} -# Modify for Hight DPI usage. -# Not all JVMs recognize this; some only accept integer arguments. -JVM_ARGS=-Dsun.java2d.uiScale=${SCALE_FACTOR:-1} +JVM_ARGS= # Where the programs are installed, adjust if required export IRSCRUTINIZERHOME="$(dirname -- "$(readlink -f -- "${0}")" )" diff --git a/src/main/java/org/harctoolbox/irscrutinizer/IrScrutinizer.java b/src/main/java/org/harctoolbox/irscrutinizer/IrScrutinizer.java index b5adafaa..5aab6ac9 100644 --- a/src/main/java/org/harctoolbox/irscrutinizer/IrScrutinizer.java +++ b/src/main/java/org/harctoolbox/irscrutinizer/IrScrutinizer.java @@ -101,6 +101,9 @@ public static void main(String[] args) { System.exit(IrpUtils.EXIT_SUCCESS); } + if (commandLineArgs.scaling != null) + System.setProperty("sun.java2d.uiScale", commandLineArgs.scaling); + setupRadixPrefixes(); String applicationHome = Utils.findApplicationHome(commandLineArgs.applicationHome, IrScrutinizer.class, Version.appName); @@ -209,6 +212,9 @@ private final static class CommandLineArgs { @Parameter(names = {"-p", "--properties"}, description = "Pathname of properties file") private String propertiesFilename = null; + @Parameter(names = {"-s", "--scale", "--scaling"}, description = "Set scaling of the GUI. Accepted values and their semantics depend on the JVM.") + private String scaling = null; + @Parameter(names = {"-V", "--version"}, description = "Display version information") private boolean versionRequested;