< prev index next >

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

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

@@ -71,16 +71,13 @@
             char glyphCode = cmap.getGlyph(charCode);
             if (glyphCode < numGlyphs ||
                 glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) {
                 return glyphCode;
             } else {
-                if (FontUtilities.isLogging()) {
-                    FontUtilities.getLogger().warning
-                        (font + " out of range glyph id=" +
+                FontUtilities.logWarning(font + " out of range glyph id=" +
                          Integer.toHexString((int)glyphCode) +
                          " for char " + Integer.toHexString(charCode));
-                }
                 return (char)missingGlyph;
             }
         } catch(Exception e) {
             handleBadCMAP();
             return (char) missingGlyph;

@@ -96,30 +93,26 @@
                                                     variationSelector);
             if (glyphCode < numGlyphs ||
                 glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) {
                 return glyphCode;
             } else {
-                if (FontUtilities.isLogging()) {
-                    FontUtilities.getLogger().warning
-                        (font + " out of range glyph id=" +
+                FontUtilities.logWarning(font + " out of range glyph id=" +
                          Integer.toHexString((int)glyphCode) +
                          " for char " + Integer.toHexString(charCode) +
                          " for vs " + Integer.toHexString(variationSelector));
-                }
                 return (char)missingGlyph;
             }
         } catch (Exception e) {
              handleBadCMAP();
              return (char) missingGlyph;
         }
     }
 
     private void handleBadCMAP() {
-        if (FontUtilities.isLogging()) {
-            FontUtilities.getLogger().severe("Null Cmap for " + font +
+        FontUtilities.logSevere("Null Cmap for " + font +
                                       "substituting for this font");
-        }
+
         SunFontManager.getInstance().deRegisterBadFont(font);
         /* The next line is not really a solution, but might
          * reduce the exceptions until references to this font2D
          * are gone.
          */
< prev index next >