Getting the Shape from the Outline of Text Shape getTextShape( Graphics2D g2d, String str, Font font) { TextLayout tl = new TextLayout( str, font, g2d.getFontRenderContext()); return tl.getOutline(null); }