8039273: Font related files should not be modified in ${java.home}/lib
Reviewed-by: serb, naoto
This commit is contained in:
parent
2c877752fe
commit
45e7f76530
@ -182,13 +182,19 @@ public abstract class FontConfiguration {
|
||||
throw new Error("java.home property not set");
|
||||
}
|
||||
javaLib = javaHome + File.separator + "lib";
|
||||
String javaConfFonts = javaHome +
|
||||
File.separator + "conf" +
|
||||
File.separator + "fonts";
|
||||
String userConfigFile = System.getProperty("sun.awt.fontconfig");
|
||||
if (userConfigFile != null) {
|
||||
fontConfigFile = new File(userConfigFile);
|
||||
} else {
|
||||
fontConfigFile = findFontConfigFile(javaConfFonts);
|
||||
if (fontConfigFile == null) {
|
||||
fontConfigFile = findFontConfigFile(javaLib);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void readFontConfigFile(File f) {
|
||||
/* This is invoked here as readFontConfigFile is only invoked
|
||||
@ -275,8 +281,11 @@ public abstract class FontConfiguration {
|
||||
return null;
|
||||
}
|
||||
|
||||
private File findFontConfigFile(String javaLib) {
|
||||
String baseName = javaLib + File.separator + "fontconfig";
|
||||
private File findFontConfigFile(String dir) {
|
||||
if (!(new File(dir)).exists()) {
|
||||
return null;
|
||||
}
|
||||
String baseName = dir + File.separator + "fontconfig";
|
||||
File configFile;
|
||||
String osMajorVersion = null;
|
||||
if (osVersion != null && osName != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user