# HG changeset patch # User mbaesken # Date 1593789039 -7200 # Fri Jul 03 17:10:39 2020 +0200 # Node ID f4fe31c7ef0fc34dcb6a3edad0543347836385f1 # Parent e7f126fb2655ec7cfea0e9d0994f2a0c3597e93b 8248802: Add log helper methods to FontUtilities.java diff --git a/src/java.desktop/macosx/classes/sun/font/CFontManager.java b/src/java.desktop/macosx/classes/sun/font/CFontManager.java --- a/src/java.desktop/macosx/classes/sun/font/CFontManager.java +++ b/src/java.desktop/macosx/classes/sun/font/CFontManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -96,7 +96,7 @@ // already existing fonts in this list if (logicalFont || !genericFonts.containsKey(fontName)) { if (FontUtilities.debugFonts()) { - FontUtilities.getLogger().info("Add to Family "+familyName + + FontUtilities.logInfo("Add to Family "+familyName + ", Font " + fontName + " rank="+rank); } FontFamily family = FontFamily.getFamily(familyName); diff --git a/src/java.desktop/share/classes/sun/awt/FontConfiguration.java b/src/java.desktop/share/classes/sun/awt/FontConfiguration.java --- a/src/java.desktop/share/classes/sun/awt/FontConfiguration.java +++ b/src/java.desktop/share/classes/sun/awt/FontConfiguration.java @@ -83,8 +83,7 @@ */ public FontConfiguration(SunFontManager fm) { if (FontUtilities.debugFonts()) { - FontUtilities.getLogger() - .info("Creating standard Font Configuration"); + FontUtilities.logInfo("Creating standard Font Configuration"); } if (FontUtilities.debugFonts() && logger == null) { logger = PlatformLogger.getLogger("sun.awt.FontConfiguration"); @@ -116,8 +115,7 @@ boolean preferPropFonts) { fontManager = fm; if (FontUtilities.debugFonts()) { - FontUtilities.getLogger() - .info("Creating alternate Font Configuration"); + FontUtilities.logInfo("Creating alternate Font Configuration"); } this.preferLocaleFonts = preferLocaleFonts; this.preferPropFonts = preferPropFonts; diff --git a/src/java.desktop/share/classes/sun/font/CMap.java b/src/java.desktop/share/classes/sun/font/CMap.java --- a/src/java.desktop/share/classes/sun/font/CMap.java +++ b/src/java.desktop/share/classes/sun/font/CMap.java @@ -401,9 +401,7 @@ subtableLength = buffer.getInt(offset+4) & INTMASK; } if (offset+subtableLength > buffer.capacity()) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().warning("Cmap subtable overflows buffer."); - } + FontUtilities.logWarning("Cmap subtable overflows buffer."); } switch (subtableFormat) { case 0: return new CMapFormat0(buffer, offset); @@ -423,10 +421,7 @@ if (subtableFormat == 14) { long subtableLength = buffer.getInt(offset + 2) & INTMASK; if (offset + subtableLength > buffer.capacity()) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .warning("Cmap UVS subtable overflows buffer."); - } + FontUtilities.logWarning("Cmap UVS subtable overflows buffer."); } try { this.uvs = new UVS(buffer, offset); diff --git a/src/java.desktop/share/classes/sun/font/FileFontStrike.java b/src/java.desktop/share/classes/sun/font/FileFontStrike.java --- a/src/java.desktop/share/classes/sun/font/FileFontStrike.java +++ b/src/java.desktop/share/classes/sun/font/FileFontStrike.java @@ -222,9 +222,8 @@ !((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 + @@ -318,12 +317,9 @@ 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); } } @@ -355,9 +351,8 @@ } 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); } diff --git a/src/java.desktop/share/classes/sun/font/FontFamily.java b/src/java.desktop/share/classes/sun/font/FontFamily.java --- a/src/java.desktop/share/classes/sun/font/FontFamily.java +++ b/src/java.desktop/share/classes/sun/font/FontFamily.java @@ -1,5 +1,5 @@ /* - * 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 @@ -181,7 +181,7 @@ 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 + @@ -191,7 +191,7 @@ 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); } @@ -208,7 +208,7 @@ } 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()); @@ -242,19 +242,16 @@ 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 + - " of lower rank " + font.getRank() + - " to family " + this + - " of rank " + familyRank); - } + FontUtilities.logWarning("Rejecting adding " + font + + " of lower rank " + font.getRank() + + " to family " + this + + " of rank " + familyRank); return; } diff --git a/src/java.desktop/share/classes/sun/font/FontUtilities.java b/src/java.desktop/share/classes/sun/font/FontUtilities.java --- a/src/java.desktop/share/classes/sun/font/FontUtilities.java +++ b/src/java.desktop/share/classes/sun/font/FontUtilities.java @@ -324,6 +324,23 @@ return debugFonts; } + public static void logWarning(String s) { + if (isLogging()) { + getLogger().warning(s); + } + } + + public static void logInfo(String s) { + if (isLogging()) { + getLogger().info(s); + } + } + + public static void logSevere(String s) { + if (isLogging()) { + getLogger().severe(s); + } + } // The following methods are used by Swing. diff --git a/src/java.desktop/share/classes/sun/font/GlyphLayout.java b/src/java.desktop/share/classes/sun/font/GlyphLayout.java --- a/src/java.desktop/share/classes/sun/font/GlyphLayout.java +++ b/src/java.desktop/share/classes/sun/font/GlyphLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, 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 @@ -478,8 +478,7 @@ if (_gvdata._count < 0) { gv = new StandardGlyphVector(font, text, offset, count, frc); if (FontUtilities.debugFonts()) { - FontUtilities.getLogger().warning("OpenType layout failed on font: " + - font); + FontUtilities.logWarning("OpenType layout failed on font: " + font); } } else { gv = _gvdata.createGlyphVector(font, frc, result); diff --git a/src/java.desktop/share/classes/sun/font/SunFontManager.java b/src/java.desktop/share/classes/sun/font/SunFontManager.java --- a/src/java.desktop/share/classes/sun/font/SunFontManager.java +++ b/src/java.desktop/share/classes/sun/font/SunFontManager.java @@ -320,7 +320,7 @@ break; } else { if (FontUtilities.debugFonts()) { - FontUtilities.getLogger().warning("read bad font: " + name); + FontUtilities.logWarning("read bad font: " + name); } badFonts.add(name); } @@ -354,7 +354,7 @@ String[] fontInfo = getDefaultPlatformFont(); defaultFontName = fontInfo[0]; if (defaultFontName == null && FontUtilities.debugFonts()) { - FontUtilities.getLogger().warning("defaultFontName is null"); + FontUtilities.logWarning("defaultFontName is null"); } defaultFontFileName = fontInfo[1]; @@ -403,10 +403,9 @@ } if (FontUtilities.debugFonts()) { - PlatformLogger logger = FontUtilities.getLogger(); - logger.info("JRE font directory: " + jreFontDirName); - logger.info("Extra font path: " + extraFontPath); - logger.info("Debug font path: " + dbgFontPath); + FontUtilities.logInfo("JRE font directory: " + jreFontDirName); + FontUtilities.logInfo("Extra font path: " + extraFontPath); + FontUtilities.logInfo("Debug font path: " + dbgFontPath); } if (dbgFontPath != null) { @@ -562,11 +561,8 @@ } private void addCompositeToFontList(CompositeFont f, int rank) { - - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().info("Add to Family "+ f.familyName + - ", Font " + f.fullName + " rank="+rank); - } + FontUtilities.logInfo("Add to Family "+ f.familyName + + ", Font " + f.fullName + " rank="+rank); f.setRank(rank); compositeFonts.put(f.fullName, f); fullNameToFont.put(f.fullName.toLowerCase(Locale.ENGLISH), f); @@ -624,10 +620,8 @@ } f.setRank(rank); if (!physicalFonts.containsKey(fontName)) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().info("Add to Family "+familyName + - ", Font " + fontName + " rank="+rank); - } + FontUtilities.logInfo("Add to Family "+familyName + + ", Font " + fontName + " rank="+rank); physicalFonts.put(fontName, f); FontFamily family = FontFamily.getFamily(familyName); if (family == null) { @@ -698,23 +692,16 @@ * problem with our choice of font configuration fonts. */ if (oldFont.platName.startsWith(jreFontDirName)) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .warning("Unexpected attempt to replace a JRE " + - " font " + fontName + " from " + - oldFont.platName + - " with " + newFont.platName); - } + FontUtilities.logWarning("Unexpected attempt to replace a JRE " + + " font " + fontName + " from " + oldFont.platName + + " with " + newFont.platName); return oldFont; } - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Replace in Family " + familyName + + FontUtilities.logInfo("Replace in Family " + familyName + ",Font " + fontName + " new rank="+rank + " from " + oldFont.platName + " with " + newFont.platName); - } replaceFont(oldFont, newFont); physicalFonts.put(fontName, newFont); fullNameToFont.put(fontName.toLowerCase(Locale.ENGLISH), @@ -902,10 +889,7 @@ if (fileNameKey == null) { return null; } - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Opening deferred font file " + fileNameKey); - } + FontUtilities.logInfo("Opening deferred font file " + fileNameKey); PhysicalFont physicalFont = null; FontRegistrationInfo regInfo = deferredFontFiles.get(fileNameKey); @@ -990,16 +974,10 @@ default: } - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Registered file " + fileName + " as font " + + FontUtilities.logInfo("Registered file " + fileName + " as font " + physicalFont + " rank=" + fontRank); - } } catch (FontFormatException ffe) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().warning("Unusable font: " + - fileName + " " + ffe.toString()); - } + FontUtilities.logInfo("Unusable font: " + fileName + " " + ffe.toString()); } if (physicalFont != null && fontFormat != FONTFORMAT_NATIVE) { @@ -1041,11 +1019,8 @@ if (font2d instanceof PhysicalFont) { defaultPhysicalFont = (PhysicalFont)font2d; } else { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .warning("Font returned by findFont2D for default font name " + + FontUtilities.logWarning("Font returned by findFont2D for default font name " + defaultFontName + " is not a physical font: " + font2d.getFontName(null)); - } } } if (defaultPhysicalFont == null) { @@ -1303,10 +1278,7 @@ } } fontToFamilyNameMap.remove(name); - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("No file for font:" + name); - } + FontUtilities.logInfo("No file for font:" + name); } } } @@ -1354,10 +1326,7 @@ for (String pathFile : getFontFilesFromPath(false)) { if (!registryFiles.contains(pathFile)) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Found non-registry file : " + pathFile); - } + FontUtilities.logInfo("Found non-registry file : " + pathFile); PhysicalFont f = registerFontFile(getPathName(pathFile)); if (f == null) { continue; @@ -1399,10 +1368,7 @@ int fn = 0; TrueTypeFont ttf; String fullPath = getPathName(file); - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Trying to resolve file " + fullPath); - } + FontUtilities.logInfo("Trying to resolve file " + fullPath); do { ttf = new TrueTypeFont(fullPath, null, fn++, false); // prefer the font's locale name. @@ -1410,11 +1376,8 @@ if (unmappedFonts.contains(fontName)) { fontToFileMap.put(fontName, file); unmappedFonts.remove(fontName); - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Resolved absent registry entry for " + + FontUtilities.logInfo("Resolved absent registry entry for " + fontName + " located in " + fullPath); - } } } while (fn < ttf.getFontCount()); @@ -1537,10 +1500,7 @@ } if (failure) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger(). - info("Hardcoded file missing looking for " + lcName); - } + FontUtilities.logInfo("Hardcoded file missing looking for " + lcName); platformFontMap.remove(firstWord); return null; } @@ -1565,10 +1525,7 @@ }); if (failure) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger(). - info("Hardcoded file missing looking for " + lcName); - } + FontUtilities.logInfo("Hardcoded file missing looking for " + lcName); platformFontMap.remove(firstWord); return null; } @@ -1833,11 +1790,8 @@ String fontNameLC = fontList[f].toLowerCase(Locale.ENGLISH); String fileName = fontToFileMap.get(fontNameLC); if (fileName == null) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Platform lookup : No file for font " + + FontUtilities.logInfo("Platform lookup : No file for font " + fontList[f] + " in family " +familyName); - } return null; } } @@ -1906,9 +1860,7 @@ return font; } - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().info("Search for font: " + name); - } + FontUtilities.logInfo("Search for font: " + name); // The check below is just so that the bitmap fonts being set by // AWT and Swing thru the desktop properties do not trigger the @@ -2020,10 +1972,8 @@ if (FontUtilities.isWindows) { font = findFontFromPlatformMap(lowerCaseName, style); - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("findFontFromPlatformMap returned " + font); - } + FontUtilities.logInfo("findFontFromPlatformMap returned " + font); + if (font != null) { fontNameCache.put(mapName, font); return font; @@ -2041,12 +1991,9 @@ } font = findFontFromPlatform(lowerCaseName, style); if (font != null) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Found font via platform API for request:\"" + + FontUtilities.logInfo("Found font via platform API for request:\"" + name + "\":, style="+style+ " found font: " + font); - } fontNameCache.put(mapName, font); return font; } @@ -2115,20 +2062,14 @@ * are not yet loaded, do so, and then recurse. */ if (!loadedAllFonts) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Load fonts looking for:" + name); - } + FontUtilities.logInfo("Load fonts looking for:" + name); loadFonts(); loadedAllFonts = true; return findFont2D(name, style, fallback); } if (!loadedAllFontFiles) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Load font files looking for:" + name); - } + FontUtilities.logInfo("Load font files looking for:" + name); loadFontFiles(); loadedAllFontFiles = true; return findFont2D(name, style, fallback); @@ -2186,9 +2127,7 @@ return font; } - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().info("No font found for:" + name); - } + FontUtilities.logInfo("No font found for:" + name); switch (fallback) { case PHYSICAL_FALLBACK: return getDefaultPhysicalFont(); @@ -2361,10 +2300,7 @@ /* We should never reach here, but just in case */ return; } else { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .severe("Deregister bad font: " + font2D); - } + FontUtilities.logSevere("Deregister bad font: " + font2D); replaceFont((PhysicalFont)font2D, getDefaultPhysicalFont()); } } @@ -2385,10 +2321,7 @@ * so pick any alternative physical font */ if (oldFont == newFont) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .severe("Can't replace bad font with itself " + oldFont); - } + FontUtilities.logSevere("Can't replace bad font with itself " + oldFont); PhysicalFont[] physFonts = getPhysicalFonts(); for (int i=0; i() { public Void run() { @@ -3133,11 +3052,7 @@ private void initCompositeFonts(FontConfiguration fontConfig, ConcurrentHashMap altNameCache) { - - if (FontUtilities.isLogging()) { - FontUtilities.getLogger() - .info("Initialising composite fonts"); - } + FontUtilities.logInfo("Initialising composite fonts"); int numCoreFonts = fontConfig.getNumberCoreFonts(); String[] fcFonts = fontConfig.getPlatformFontNames(); @@ -3236,8 +3151,7 @@ true); } if (FontUtilities.debugFonts()) { - FontUtilities.getLogger() - .info("registered " + descriptor.getFaceName()); + FontUtilities.logInfo("registered " + descriptor.getFaceName()); } } } diff --git a/src/java.desktop/share/classes/sun/font/TrueTypeFont.java b/src/java.desktop/share/classes/sun/font/TrueTypeFont.java --- a/src/java.desktop/share/classes/sun/font/TrueTypeFont.java +++ b/src/java.desktop/share/classes/sun/font/TrueTypeFont.java @@ -243,9 +243,7 @@ private synchronized FileChannel open(boolean usePool) throws FontFormatException { if (disposerRecord.channel == null) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().info("open TTF: " + platName); - } + FontUtilities.logInfo("open TTF: " + platName); try { RandomAccessFile raf = AccessController.doPrivileged( new PrivilegedExceptionAction() { @@ -308,12 +306,10 @@ * isn't updated. If the file has changed whilst we * are executing we want to bail, not spin. */ - if (FontUtilities.isLogging()) { - String msg = "Read offset is " + offset + + String msg = "Read offset is " + offset + " file size is " + fileSize+ " file is " + platName; - FontUtilities.getLogger().severe(msg); - } + FontUtilities.logSevere(msg); return -1; } else { length = fileSize - offset; @@ -330,9 +326,7 @@ msg += " File size was " + fileSize + " and now is " + currSize; } - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().severe(msg); - } + FontUtilities.logSevere(msg); // We could still flip() the buffer here because // it's possible that we did read some data in // an earlier loop, and we probably should @@ -345,11 +339,8 @@ // data was read to probably continue. if (bread > length/2 || bread > 16384) { buffer.flip(); - if (FontUtilities.isLogging()) { - msg = "Returning " + bread + - " bytes instead of " + length; - FontUtilities.getLogger().severe(msg); - } + msg = "Returning " + bread + " bytes instead of " + length; + FontUtilities.logSevere(msg); } else { bread = -1; } @@ -522,9 +513,7 @@ } initNames(); } catch (Exception e) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().severe(e.toString()); - } + FontUtilities.logSevere(e.toString()); if (e instanceof FontFormatException) { throw (FontFormatException)e; } else { @@ -1072,9 +1061,7 @@ try { return new String(bytes, 0, len, charset); } catch (UnsupportedEncodingException e) { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().warning(e + " EncodingID=" + encoding); - } + FontUtilities.logWarning(e + " EncodingID=" + encoding); return new String(bytes, 0, len); } catch (Throwable t) { return null; diff --git a/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java b/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java --- a/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java +++ b/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java @@ -73,12 +73,9 @@ 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) { @@ -98,13 +95,10 @@ glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) { return glyphCode; } else { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().warning - (font + " out of range glyph id=" + - Integer.toHexString((int)glyphCode) + - " for char " + Integer.toHexString(charCode) + - " for vs " + Integer.toHexString(variationSelector)); - } + 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) { @@ -114,10 +108,9 @@ } private void handleBadCMAP() { - if (FontUtilities.isLogging()) { - FontUtilities.getLogger().severe("Null Cmap for " + font + - "substituting for this 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 diff --git a/src/java.desktop/unix/classes/sun/awt/X11FontManager.java b/src/java.desktop/unix/classes/sun/awt/X11FontManager.java --- a/src/java.desktop/unix/classes/sun/awt/X11FontManager.java +++ b/src/java.desktop/unix/classes/sun/awt/X11FontManager.java @@ -224,15 +224,13 @@ if (fontPath == null && (fileName == null || !fileName.startsWith("/"))) { if (FontUtilities.debugFonts()) { - FontUtilities.getLogger() - .warning("** Registering all font paths because " + - "can't find file for " + platName); + 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); } @@ -289,7 +287,7 @@ * ... */ if (FontUtilities.debugFonts()) { - FontUtilities.getLogger().info("ParseFontDir " + path); + FontUtilities.logInfo("ParseFontDir " + path); } File fontsDotDir = new File(path + File.separator + "fonts.dir"); FileReader fr = null; @@ -368,10 +366,9 @@ 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; @@ -394,16 +391,14 @@ } Vector xVal = xlfdMap.get(fullPath); if (FontUtilities.debugFonts()) { - FontUtilities.getLogger() - .info("fullPath=" + fullPath + - " xVal=" + xVal); + 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 + - "to file:" + fullPath); + FontUtilities.logInfo("Map fontID:"+fontID + + "to file:" + fullPath); } fontNameMap.put(fontID, fullPath); if (xVal == null) { @@ -481,8 +476,7 @@ 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? } @@ -511,8 +505,7 @@ 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? } @@ -675,7 +668,7 @@ if (FontUtilities.debugFonts() && fontConfigDirs != null) { String[] names = fontConfigDirs.toArray(new String[0]); for (int i=0;i