< prev index next >

src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -35,11 +35,10 @@
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Locale;
 import java.util.Properties;
 import java.util.Scanner;
 import sun.awt.FcFontManager;
 import sun.awt.FontConfiguration;
 import sun.awt.FontDescriptor;

@@ -263,11 +262,11 @@
                 String[] faceNames = new String[numFonts];
 
                 int index;
                 for (index = 0; index < fcFonts.length; index++) {
                     fileNames[index] = fcFonts[index].fontFile;
-                    faceNames[index] = fcFonts[index].fullName;
+                    faceNames[index] = fcFonts[index].familyName;
                 }
 
                 if (installedFallbackFontFiles != null) {
                     System.arraycopy(installedFallbackFontFiles, 0,
                                      fileNames, fcFonts.length,

@@ -356,15 +355,13 @@
             }
             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;
-            Locale locale = SunToolkit.getStartupLocale();
-            String lang = locale.getLanguage();
-            String country = locale.getCountry();
+            String lang = SunToolkit.getStartupLocale().getLanguage();
             String name = "fcinfo-"+fileVersion+"-"+hostname+"-"+
-                osName+"-"+osVersion+"-"+lang+"-"+country+".properties";
+                osName+"-"+osVersion+"-"+lang+".properties";
             fcInfoFileName = dir+fs+name;
         }
         return new File(fcInfoFileName);
     }
 

@@ -386,16 +383,14 @@
             FcCompFont fci = fcCompFonts[i];
             String styleKey = fci.jdkName+"."+fci.style;
             props.setProperty(styleKey+".length",
                               Integer.toString(fci.allFonts.length));
             for (int j=0; j<fci.allFonts.length; j++) {
+                props.setProperty(styleKey+"."+j+".family",
+                                  fci.allFonts[j].familyName);
                 props.setProperty(styleKey+"."+j+".file",
                                   fci.allFonts[j].fontFile);
-                if (fci.allFonts[j].fullName != null) {
-                    props.setProperty(styleKey+"."+j+".fullName",
-                                      fci.allFonts[j].fullName);
-                }
             }
         }
         try {
             /* This writes into a temp file then renames when done.
              * Since the rename is an atomic action within the same

@@ -506,13 +501,13 @@
                         return; // bad file
                     }
                     fci[index].allFonts = new FontConfigFont[nfonts];
                     for (int f=0; f<nfonts; f++) {
                         fci[index].allFonts[f] = new FontConfigFont();
-                        String fkey = key+"."+f+".fullName";
-                        String fullName = (String)props.get(fkey);
-                        fci[index].allFonts[f].fullName = fullName;
+                        String fkey = key+"."+f+".family";
+                        String family = (String)props.get(fkey);
+                        fci[index].allFonts[f].familyName = family;
                         fkey = key+"."+f+".file";
                         String file = (String)props.get(fkey);
                         if (file == null) {
                             return; // bad file
                         }
< prev index next >