< prev index next >

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

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

@@ -220,13 +220,12 @@
              matrix[0] == matrix[3] &&
              matrix[0] >= 3.0 && matrix[0] <= 100.0) &&
             !((TrueTypeFont)fileFont).useEmbeddedBitmapsForSize(intPtSize)) {
             useNatives = true;
         }
-        if (FontUtilities.isLogging() && FontUtilities.isWindows) {
-            FontUtilities.getLogger().info
-                ("Strike for " + fileFont + " at size = " + intPtSize +
+        if (FontUtilities.isWindows) {
+            FontUtilities.logInfo("Strike for " + fileFont + " at size = " + intPtSize +
                  " use natives = " + useNatives +
                  " useJavaRasteriser = " + fileFont.useJavaRasterizer +
                  " AAHint = " + desc.aaHint +
                  " Has Embedded bitmaps = " +
                  ((TrueTypeFont)fileFont).

@@ -316,16 +315,13 @@
             float advance = getGlyphAdvance(glyphCode, false);
             StrikeCache.unsafe.putFloat(ptr + StrikeCache.xAdvanceOffset,
                                         advance);
             return ptr;
         } else {
-            if (FontUtilities.isLogging()) {
-                FontUtilities.getLogger().warning(
-                        "Failed to render glyph using GDI: code=" + glyphCode
+            FontUtilities.logWarning("Failed to render glyph using GDI: code=" + glyphCode
                                 + ", fontFamily=" + family + ", style=" + style
                                 + ", size=" + size);
-            }
             return fileFont.getGlyphImage(pScalerContext, glyphCode);
         }
     }
 
     /* Try the native strikes first, then try the fileFont strike */

@@ -353,13 +349,12 @@
         if ((glyphPtr = getCachedGlyphPtr(glyphCode)) != 0L) {
             return glyphPtr;
         } else {
             if (useNatives) {
                 glyphPtr = getGlyphImageFromNative(glyphCode);
-                if (glyphPtr == 0L && FontUtilities.isLogging()) {
-                    FontUtilities.getLogger().info
-                        ("Strike for " + fileFont +
+                if (glyphPtr == 0L) {
+                    FontUtilities.logInfo("Strike for " + fileFont +
                          " at size = " + intPtSize +
                          " couldn't get native glyph for code = " + glyphCode);
                  }
             } if (glyphPtr == 0L) {
                 glyphPtr = fileFont.getGlyphImage(pScalerContext,
< prev index next >