< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m

Print this page

        

@@ -560,19 +560,24 @@
 static inline void
 CGGI_CreateImageForGlyph
     (CGGI_GlyphCanvas *canvas, const CGGlyph glyph,
      GlyphInfo *info, const CGGI_RenderingMode *mode)
 {
+    if (isnan(info->topLeftX) || isnan(info->topLeftY)) {
+        // copy the "empty" glyph from the canvas into the info
+        (*mode->glyphDescriptor->copyFxnPtr)(canvas, info);
+        return;
+    }
+
     // clean the canvas
     CGGI_ClearCanvas(canvas, info);
 
     // strike the glyph in the upper right corner
     CGContextShowGlyphsAtPoint(canvas->context,
                                -info->topLeftX,
                                canvas->image->height + info->topLeftY,
                                &glyph, 1);
-
     // copy the glyph from the canvas into the info
     (*mode->glyphDescriptor->copyFxnPtr)(canvas, info);
 }
 
 /*
< prev index next >