< prev index next >

src/java.desktop/unix/classes/sun/awt/X11FontManager.java

Print this page
rev 60064 : 8248802: Add log helper methods to FontUtilities.java

@@ -222,19 +222,17 @@
         if (fontID != null) {
             fileName = fontNameMap.get(fontID);
             if (fontPath == null &&
                 (fileName == null || !fileName.startsWith("/"))) {
                 if (FontUtilities.debugFonts()) {
-                    FontUtilities.getLogger()
-                          .warning("** Registering all font paths because " +
+                    FontUtilities.logWarning("** Registering all font paths because " +
                                    "can't find file for " + platName);
                 }
                 fontPath = getPlatformFontPath(noType1Font);
                 registerFontDirs(fontPath);
                 if (FontUtilities.debugFonts()) {
-                    FontUtilities.getLogger()
-                            .warning("** Finished registering all font paths");
+                    FontUtilities.logWarning("** Finished registering all font paths");
                 }
                 fileName = fontNameMap.get(fontID);
             }
             if (fileName == null && !isHeadless()) {
                 /* Query X11 directly to see if this font is available

@@ -287,11 +285,11 @@
          * Arial.ttf -monotype-arial-regular-r-normal--0-0-0-0-p-0-iso8859-1
          * Arial-Bold.ttf -monotype-arial-bold-r-normal--0-0-0-0-p-0-iso8859-1
          * ...
          */
         if (FontUtilities.debugFonts()) {
-            FontUtilities.getLogger().info("ParseFontDir " + path);
+            FontUtilities.logInfo("ParseFontDir " + path);
         }
         File fontsDotDir = new File(path + File.separator + "fonts.dir");
         FileReader fr = null;
         try {
             if (fontsDotDir.canRead()) {

@@ -366,14 +364,13 @@
                             String fontPart = st.sval.substring(breakPos+1);
                             String fontID = specificFontIDForName(fontPart);
                             String sVal = fontNameMap.get(fontID);
 
                             if (FontUtilities.debugFonts()) {
-                                PlatformLogger logger = FontUtilities.getLogger();
-                                logger.info("file=" + fileName +
+                                FontUtilities.logInfo("file=" + fileName +
                                             " xlfd=" + fontPart);
-                                logger.info("fontID=" + fontID +
+                                FontUtilities.logInfo("fontID=" + fontID +
                                             " sVal=" + sVal);
                             }
                             String fullPath = null;
                             try {
                                 File file = new File(path,fileName);

@@ -392,19 +389,17 @@
                             } catch (IOException e) {
                                 fullPath = path + File.separator + fileName;
                             }
                             Vector<String> xVal = xlfdMap.get(fullPath);
                             if (FontUtilities.debugFonts()) {
-                                FontUtilities.getLogger()
-                                      .info("fullPath=" + fullPath +
+                                FontUtilities.logInfo("fullPath=" + fullPath +
                                             " xVal=" + xVal);
                             }
                             if ((xVal == null || !xVal.contains(fontPart)) &&
                                 (sVal == null) || !sVal.startsWith("/")) {
                                 if (FontUtilities.debugFonts()) {
-                                    FontUtilities.getLogger()
-                                          .info("Map fontID:"+fontID +
+                                    FontUtilities.logInfo("Map fontID:"+fontID +
                                                 "to file:" + fullPath);
                                 }
                                 fontNameMap.put(fontID, fullPath);
                                 if (xVal == null) {
                                     xVal = new Vector<>();

@@ -479,12 +474,11 @@
             }
         }
 
         if (hyphenCnt != 14) {
             if (FontUtilities.debugFonts()) {
-                FontUtilities.getLogger()
-                    .severe("Font Configuration Font ID is malformed:" + name);
+                FontUtilities.logSevere("Font Configuration Font ID is malformed:" + name);
             }
             return name; // what else can we do?
         }
 
         StringBuffer sb =

@@ -509,12 +503,11 @@
             }
         }
 
         if (hyphenCnt != 14) {
             if (FontUtilities.debugFonts()) {
-                FontUtilities.getLogger()
-                    .severe("Font Configuration Font ID is malformed:" + name);
+                FontUtilities.logSevere("Font Configuration Font ID is malformed:" + name);
             }
             return name; // what else can we do?
         }
 
         String slant = name.substring(hPos[SLANT_FIELD-1]+1,

@@ -673,11 +666,11 @@
         if (fontConfigDirs == null) {
             fontConfigDirs = getFontConfiguration().getAWTFontPathSet();
             if (FontUtilities.debugFonts() && fontConfigDirs != null) {
                 String[] names = fontConfigDirs.toArray(new String[0]);
                 for (int i=0;i<names.length;i++) {
-                    FontUtilities.getLogger().info("awtfontpath : " + names[i]);
+                    FontUtilities.logInfo("awtfontpath : " + names[i]);
                 }
             }
         }
     }
 
< prev index next >