TextMeasurerpublic class G2TextMeasurer extends java.lang.Object implements TextMeasurer
TextMeasurer based on a Graphics2D.| Constructor | Description |
|---|---|
G2TextMeasurer(java.awt.Graphics2D g2) |
Creates a new text measurer.
|
| Modifier and Type | Method | Description |
|---|---|---|
float |
getStringWidth(java.lang.String text,
int start,
int end) |
Returns the string width.
|
public G2TextMeasurer(java.awt.Graphics2D g2)
g2 - the graphics device.public float getStringWidth(java.lang.String text, int start, int end)
getStringWidth in interface TextMeasurertext - the text.start - the index of the first character to measure.end - the index of the last character to measure.