< prev index next >

src/java.desktop/share/classes/sun/font/FontFamily.java

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

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2020, 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

@@ -179,21 +179,21 @@
 
         if (Math.abs(Font2D.FWIDTH_NORMAL - newWidth) <
             Math.abs(Font2D.FWIDTH_NORMAL - familyWidth))
         {
            if (FontUtilities.debugFonts()) {
-               FontUtilities.getLogger().info(
+               FontUtilities.logInfo(
                "Found more preferred width. New width = " + newWidth +
                " Old width = " + familyWidth + " in font " + font +
                " nulling out fonts plain: " + plain + " bold: " + bold +
                " italic: " + italic + " bolditalic: " + bolditalic);
            }
            familyWidth = newWidth;
            plain = bold = italic = bolditalic = null;
            return true;
         } else if (FontUtilities.debugFonts()) {
-               FontUtilities.getLogger().info(
+               FontUtilities.logInfo(
                "Family rejecting font " + font +
                " of less preferred width " + newWidth);
         }
         return false;
     }

@@ -206,11 +206,11 @@
         if (currFont == null) {
             return true;
         }
 
         if (FontUtilities.debugFonts()) {
-            FontUtilities.getLogger().info(
+            FontUtilities.logInfo(
             "New weight for style " + style + ". Curr.font=" + currFont +
             " New font="+font+" Curr.weight="+ + currFont.getWeight()+
             " New weight="+font.getWeight());
         }
 

@@ -240,19 +240,18 @@
                       " with style " + style + " to family " + familyName;
             } else {
                 msg = "Request to add " + font +
                       " with style " + style + " to family " + this;
             }
-            FontUtilities.getLogger().info(msg);
+            FontUtilities.logInfo(msg);
         }
         /* Allow a lower-rank font only if its a file font
          * from the exact same source as any previous font.
          */
         if ((font.getRank() > familyRank) && !isFromSameSource(font)) {
             if (FontUtilities.isLogging()) {
-                FontUtilities.getLogger()
-                                  .warning("Rejecting adding " + font +
+                FontUtilities.logWarning("Rejecting adding " + font +
                                            " of lower rank " + font.getRank() +
                                            " to family " + this +
                                            " of rank " + familyRank);
             }
             return;
< prev index next >