src/share/classes/sun/font/TrueTypeGlyphMapper.java
Print this page
rev 1379 : [mq]: fontmanager.patch
*** 58,70 ****
handleBadCMAP();
}
missingGlyph = 0; /* standard for TrueType fonts */
ByteBuffer buffer = font.getTableBuffer(TrueTypeFont.maxpTag);
numGlyphs = buffer.getChar(4); // offset 4 bytes in MAXP table.
! if (FontManager.isSolaris && isJAlocale && font.supportsJA()) {
needsJAremapping = true;
! if (FontManager.isSolaris8 &&
getGlyphFromCMAP(JA_WAVE_DASH_CHAR) == missingGlyph) {
remapJAWaveDash = true;
}
} else {
needsJAremapping = false;
--- 58,70 ----
handleBadCMAP();
}
missingGlyph = 0; /* standard for TrueType fonts */
ByteBuffer buffer = font.getTableBuffer(TrueTypeFont.maxpTag);
numGlyphs = buffer.getChar(4); // offset 4 bytes in MAXP table.
! if (FontUtilities.isSolaris && isJAlocale && font.supportsJA()) {
needsJAremapping = true;
! if (FontUtilities.isSolaris8 &&
getGlyphFromCMAP(JA_WAVE_DASH_CHAR) == missingGlyph) {
remapJAWaveDash = true;
}
} else {
needsJAremapping = false;
*** 80,91 ****
char glyphCode = cmap.getGlyph(charCode);
if (glyphCode < numGlyphs ||
glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) {
return glyphCode;
} else {
! if (FontManager.logging) {
! FontManager.logger.warning
(font + " out of range glyph id=" +
Integer.toHexString((int)glyphCode) +
" for char " + Integer.toHexString(charCode));
}
return (char)missingGlyph;
--- 80,91 ----
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;
*** 95,109 ****
return (char) missingGlyph;
}
}
private void handleBadCMAP() {
! if (FontManager.logging) {
! FontManager.logger.severe("Null Cmap for " + font +
"substituting for this font");
}
! FontManager.deRegisterBadFont(font);
/* The next line is not really a solution, but might
* reduce the exceptions until references to this font2D
* are gone.
*/
cmap = CMap.theNullCmap;
--- 95,109 ----
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.
*/
cmap = CMap.theNullCmap;
*** 240,253 ****
if (font.checkUseNatives() &&
glyphs[i] < font.glyphToCharMap.length) {
font.glyphToCharMap[glyphs[i]] = (char)code;
}
! if (code < FontManager.MIN_LAYOUT_CHARCODE) {
continue;
}
! else if (FontManager.isComplexCharCode(code)) {
return true;
}
else if (code >= 0x10000) {
i += 1; // Empty glyph slot after surrogate
continue;
--- 240,253 ----
if (font.checkUseNatives() &&
glyphs[i] < font.glyphToCharMap.length) {
font.glyphToCharMap[glyphs[i]] = (char)code;
}
! if (code < FontUtilities.MIN_LAYOUT_CHARCODE) {
continue;
}
! else if (FontUtilities.isComplexCharCode(code)) {
return true;
}
else if (code >= 0x10000) {
i += 1; // Empty glyph slot after surrogate
continue;