JRE-205 Font is wrong and without anti aliasing in 2017.1 EAP
Minor refactoring
diff --git a/src/share/classes/sun/font/FreetypeFontScaler.java b/src/share/classes/sun/font/FreetypeFontScaler.java
index 2b95577..235fc2f 100644
--- a/src/share/classes/sun/font/FreetypeFontScaler.java
+++ b/src/share/classes/sun/font/FreetypeFontScaler.java
@@ -51,17 +51,14 @@
and therefore no need to load it explicitly here */
FontManagerNativeLibrary.load();
- String loadFontConf = java.security.AccessController.doPrivileged(
- (PrivilegedAction<String>) () ->
- System.getProperty("java2d.font.loadFontConf",
- ""));
-
- String jreFontConfName = "false".equals(loadFontConf) ? null :
- java.security.AccessController.doPrivileged(
+ String jreFontConfName = java.security.AccessController.doPrivileged(
(PrivilegedAction<String>) () -> (
- System.getProperty("java.home", "") +
- File.separator + "lib") + File.separator + "fonts" +
- File.separator + "font.conf");
+ "false".equals(System.getProperty(
+ "java2d.font.loadFontConf", "")) ?
+ null :
+ System.getProperty("java.home", "") +
+ File.separator + "lib") + File.separator +
+ "fonts" + File.separator + "font.conf");
initIDs(FreetypeFontScaler.class, Toolkit.class, PhysicalFont.class,
jreFontConfName);
diff --git a/src/share/native/sun/font/freetypeScaler.c b/src/share/native/sun/font/freetypeScaler.c
index d32298c..630361f 100644
--- a/src/share/native/sun/font/freetypeScaler.c
+++ b/src/share/native/sun/font/freetypeScaler.c
@@ -207,7 +207,7 @@
jclass PFClass, jstring jreFontConfName)
{
const char *fssLogEnabled = getenv("OPENJDK_LOG_FFS");
- const char *fontConf = (*env)->IsSameObject(env, jreFontConfName, NULL) ?
+ const char *fontConf = (jreFontConfName == NULL) ?
NULL : (*env)->GetStringUTFChars(env, jreFontConfName, NULL);
if (fssLogEnabled != NULL && !strcmp(fssLogEnabled, "yes")) {
@@ -265,7 +265,9 @@
}
}
#endif
- (*env)->ReleaseStringUTFChars(env, jreFontConfName, fontConf);
+ if (!fontConf) {
+ (*env)->ReleaseStringUTFChars(env, jreFontConfName, fontConf);
+ }
}
static FT_Error FT_Library_SetLcdFilter_Proxy(FT_Library library, FT_LcdFilter filter) {