< 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,86 **** 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=" + Integer.toHexString((int)glyphCode) + " for char " + Integer.toHexString(charCode)); - } return (char)missingGlyph; } } catch(Exception e) { handleBadCMAP(); return (char) missingGlyph; --- 71,83 ---- char glyphCode = cmap.getGlyph(charCode); if (glyphCode < numGlyphs || glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) { return glyphCode; } else { ! 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,125 **** variationSelector); if (glyphCode < numGlyphs || 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)); - } return (char)missingGlyph; } } catch (Exception e) { handleBadCMAP(); return (char) missingGlyph; } } private void handleBadCMAP() { ! if (FontUtilities.isLogging()) { ! FontUtilities.getLogger().severe("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. */ --- 93,118 ---- variationSelector); if (glyphCode < numGlyphs || glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) { return glyphCode; } else { ! 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() { ! 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 >