public class StringBoundsUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.awt.geom.Rectangle2D |
computeStringBounds(java.lang.String string,
java.awt.Font font)
Compute the bounds of the given string when rendered with the given
font into a default graphics object that uses fractional metrics.
|
static java.awt.geom.Rectangle2D |
computeStringBounds(java.lang.String string,
java.awt.Font font,
java.awt.geom.Rectangle2D result)
Compute the bounds of the given string when rendered with the given
font into a default graphics object that uses fractional metrics.
|
public static java.awt.geom.Rectangle2D computeStringBounds(java.lang.String string,
java.awt.Font font)
string - The stringfont - The fontpublic static java.awt.geom.Rectangle2D computeStringBounds(java.lang.String string,
java.awt.Font font,
java.awt.geom.Rectangle2D result)
null,
then a new rectangle will be created and returned.string - The stringfont - The fontresult - The rectangle that will store the resultCopyright © 2019. All Rights Reserved.