--- old/dependencies/java.desktop/module-info.java.extra 2016-11-07 14:09:18.867742713 -0800 +++ new/dependencies/java.desktop/module-info.java.extra 2016-11-07 14:09:18.615742713 -0800 @@ -29,3 +29,4 @@ exports sun.awt.image to javafx.swing; exports sun.java2d to javafx.swing; exports sun.swing to javafx.swing; +exports sun.font.lookup to javafx.graphics; --- old/modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java 2016-11-07 14:09:19.439742710 -0800 +++ new/modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java 2016-11-07 14:09:19.223742711 -0800 @@ -100,9 +100,7 @@ NativeLibLoader.loadLibrary("javafx_font"); String dbg = System.getProperty("prism.debugfonts", ""); boolean debug = "true".equals(dbg); - jreFontDir = - System.getProperty("java.home","") + File.separator + - "lib" + File.separator + "fonts" + File.separator; + jreFontDir = getJDKFontDir(); String s = System.getProperty("com.sun.javafx.fontSize"); systemFontSize = -1f; if (s != null) { @@ -170,6 +168,23 @@ cacheLayoutSize = tempCacheLayoutSize[0]; } + private static String getJDKFontDir() { + try { + Class c = Class.forName("sun.font.lookup.JDKFontLookup"); + Method m = c.getMethod("getJDKFontDir"); + jreFontDir = (String)m.invoke(c); + return jreFontDir; + } catch (Throwable t) { + if (debugFonts) { + System.err.println("Could not get JRE font dir via API"); + t.printStackTrace(); + } + } + return + System.getProperty("java.home","") + File.separator + + "lib" + File.separator + "fonts" + File.separator; + } + private static String getNativeFactoryName() { if (isWindows) return DW_FACTORY; if (isMacOSX || isIOS) return CT_FACTORY;