blob: 1088a681263fb60b78f2be8853c88dd1be2d1544 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
diff --git a/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java b/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java
index ecb813de..a847c79c 100644
--- a/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java
+++ b/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java
@@ -356,7 +356,29 @@ public class FcFontConfiguration extends FontConfiguration {
String userDir = System.getProperty("user.home");
String version = System.getProperty("java.version");
String fs = File.separator;
- String dir = userDir+fs+".java"+fs+"fonts"+fs+version;
+ String dir;
+
+ /* On Linux systems, put the font config into
+ * ${XDG_CONFIG_HOME:-$HOME/.config}/java/fonts in order to follow
+ * the XDG Base Directory Specification.
+ */
+ if (System.getProperty("os.name").equals("Linux")) {
+ /* assume homedir can be found, which the jvm already does */
+ String xdgDefaultConfigHome = System.getenv("HOME")+"/.config";
+ String xdgConfigHomeEnvVar = "XDG_CONFIG_HOME";
+ String xdgConfigDir;
+
+ String xdgSetConfigDir = System.getenv(xdgConfigHomeEnvVar);
+
+ if (xdgSetConfigDir == null) {
+ xdgConfigDir = xdgDefaultConfigHome;
+ } else {
+ xdgConfigDir = xdgSetConfigDir;
+ }
+ dir = xdgConfigDir+"/java/fonts/"+version;
+ } else {
+ dir = userDir+fs+".java"+fs+"fonts"+fs+version;
+ }
String lang = SunToolkit.getStartupLocale().getLanguage();
String name = "fcinfo-"+fileVersion+"-"+hostname+"-"+
osName+"-"+osVersion+"-"+lang+".properties";
|