JBR-2000 RM 2019.3.1 font rendering regression, normal text is heavier

Added -Djava2d.font.loadFontConfig=bundled to force loading bundled font.conf

(cherry picked from commit 788e078f64)
This commit is contained in:
Alexey Ushakov
2019-12-12 15:58:07 +03:00
committed by alexey.ushakov@jetbrains.com
parent d2aeba8305
commit bb97af7063

View File

@@ -53,16 +53,21 @@ class FreetypeFontScaler extends FontScaler {
@SuppressWarnings("removal")
String fontConfName = java.security.AccessController.doPrivileged(
(PrivilegedAction<String>) () -> {
if ("true".equals(System.getProperty(
"java2d.font.loadFontConf", ""))) {
String loadFontConfig = System.getProperty(
"java2d.font.loadFontConf", "");
if ("true".equals(loadFontConfig)) {
File f = new File(System.getProperty("user.home", "") +
File.separator + ".fonts.conf");
File.separator + ".fonts.conf");
if (!f.exists()) {
f = new File(System.getProperty("java.home", "") +
File.separator + "lib" + File.separator +
"fonts" + File.separator + "font.conf");
if (f.exists()) {
return f.getAbsolutePath();
}
}
if ("true".equals(loadFontConfig) || "bundled".equals(loadFontConfig)) {
File f = new File(System.getProperty("java.home", "") +
File.separator + "lib" + File.separator + "fonts" + File.separator + "font.conf");
return f.getAbsolutePath();
}
return null;