public Rectangle2D getStringBounds (String str, int beginIndex, int limit, Graphics context)

Returns the bounds of the specified String in the specified Graphics context. The bounds is used to layout the String.

Note: The returned bounds is in baseline-relative coordinates (see class notes).

Parameters:
str    the specified String
beginIndex    the offset of the beginning of str
limit    the end offset of str
context    the specified Graphics context

Returns:  a Rectangle2D that is the bounding box of the specified String in the specified Graphics context.

See also:
java.awt.Font.getStringBounds(String, int, int, FontRenderContext)