diff --git a/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java b/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java index 48ae55603d49..66dfbc909453 100644 --- a/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java +++ b/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java @@ -1798,9 +1798,9 @@ Rectangle2D getGlyphOutlineBounds(int glyphID, float x, float y) { result = new Rectangle2D.Float(); result.setRect(strike.getGlyphOutlineBounds(glyphID)); // don't mutate cached rect } else { - if (sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 && + final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID); + if (!rect.isEmpty() && sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 && sgv.invdtx.getScaleX() > 0 && sgv.invdtx.getScaleY() > 0) { - final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID); result = new Rectangle2D.Float( (float)(rect.x*sgv.invdtx.getScaleX() + sgv.invdtx.getTranslateX()), (float)(rect.y*sgv.invdtx.getScaleY() + sgv.invdtx.getTranslateY()),