--- old/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m 2015-11-17 11:24:23.000000000 +0530 +++ new/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m 2015-11-17 11:24:23.000000000 +0530 @@ -562,6 +562,17 @@ (CGGI_GlyphCanvas *canvas, const CGGlyph glyph, GlyphInfo *info, const CGGI_RenderingMode *mode) { + if (isnan(info->topLeftX) || isnan(info->topLeftY)) { + // Explicitly set glyphInfo width/height to be 0 to ensure + // zero length glyph image is copied into GlyphInfo from canvas + info->width = 0; + info->height = 0; + + // copy the "empty" glyph from the canvas into the info + (*mode->glyphDescriptor->copyFxnPtr)(canvas, info); + return; + } + // clean the canvas CGGI_ClearCanvas(canvas, info); @@ -570,7 +581,6 @@ -info->topLeftX, canvas->image->height + info->topLeftY, &glyph, 1); - // copy the glyph from the canvas into the info (*mode->glyphDescriptor->copyFxnPtr)(canvas, info); }