use local location for fonts (papers over #3543)

This commit is contained in:
Ben Fry
2015-08-06 14:25:24 -04:00
parent 4c192a5cda
commit 9e264caeb7
2 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -2148,7 +2148,8 @@ public class Base {
/**
* Get reference to a file adjacent to the executable on Windows and Linux,
* or inside Contents/Resources/Java on Mac OS X.
* or inside Contents/Resources/Java on Mac OS X. This will return the local
* JRE location, *whether or not it is the active JRE*.
*/
static public File getContentFile(String name) {
if (processingRoot == null) {
+3 -3
View File
@@ -888,11 +888,11 @@ public class Toolkit {
* Get a font from the JRE lib/fonts folder. Our default fonts are also
* installed there so that the monospace (and others) can be used by other
* font listing calls (i.e. it appears in the list of monospace fonts in
* the Preferences window).
* the Preferences window, and can be used by HTMLEditorKit for WebFrame).
*/
static private Font createFont(String filename, int size) throws IOException, FontFormatException {
//InputStream is = Base.getLibStream("fonts/" + filename);
File fontFile = new File(System.getProperty("java.home"), "lib/fonts/" + filename);
//File fontFile = new File(System.getProperty("java.home"), "lib/fonts/" + filename);
File fontFile = new File(Base.getJavaHome(), "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);