diff --git a/app/src/processing/app/ui/Toolkit.java b/app/src/processing/app/ui/Toolkit.java index eed7e579c..dafd1d5c9 100644 --- a/app/src/processing/app/ui/Toolkit.java +++ b/app/src/processing/app/ui/Toolkit.java @@ -891,8 +891,9 @@ public class Toolkit { * the Preferences window, and can be used by HTMLEditorKit for WebFrame). */ static private Font createFont(String filename, int size) throws IOException, FontFormatException { - //File fontFile = new File(System.getProperty("java.home"), "lib/fonts/" + filename); - File fontFile = new File(Base.getJavaHome(), "lib/fonts/" + filename); + // Can't use Base.getJavaHome(), because if we're not using our local JRE, + // we likely have bigger problems with how things are running. + File fontFile = new File(System.getProperty("java.home"), "lib/fonts/" + filename); if (!fontFile.exists()) { // if we're debugging from Eclipse, grab it from the work folder (user.dir is /app) fontFile = new File(System.getProperty("user.dir"), "../build/shared/lib/fonts/" + filename); @@ -902,7 +903,13 @@ public class Toolkit { fontFile = new File(System.getProperty("user.dir"), "../../shared/lib/fonts/" + filename); } if (!fontFile.exists()) { - Base.showError("Font Sadness", "Could not find required fonts", null); + String msg = "Could not find required fonts. "; + if (hasNonAsciiChars(System.getProperty("java.home"))) { + msg += "Trying moving Processing to a location with only ASCII characters in the path."; + } else { + msg += "Please reinstall Processing from the original location."; + } + Base.showError("Font Sadness", msg, null); } BufferedInputStream input = new BufferedInputStream(new FileInputStream(fontFile)); @@ -912,6 +919,14 @@ public class Toolkit { } + static private final boolean hasNonAsciiChars(String what) { + for (char c : what.toCharArray()) { + if (c < 32 || c > 127) return true; + } + return false; + } + + /** * Synthesized replacement for FontMetrics.getAscent(), which is dreadfully * inaccurate and inconsistent across platforms. diff --git a/todo.txt b/todo.txt index f2c9a1b1a..1fae21437 100644 --- a/todo.txt +++ b/todo.txt @@ -60,6 +60,7 @@ _ https://code.google.com/p/processing/adminAdvanced _ https://github.com/processing/ beta +_ set title of welcome window _ fix the red for the console/error stuff _ also the sidebar, the squiggly line beneath code, and the status bar _ write notes about changes with Toolkit and Util, and packages