public class SwingFontMetrics extends java.lang.Object implements FontMetricsHelper
Modifier and Type | Field and Description |
---|---|
(package private) java.awt.FontMetrics |
fm
Font metrics instance.
|
Constructor and Description |
---|
SwingFontMetrics(java.awt.FontMetrics fm)
Construct and instance.
|
Modifier and Type | Method and Description |
---|---|
int |
charWidth(char ch)
Report the advance width of the given character.
|
int |
getHeight()
Report the height of a line of text.
|
int[] |
getWidths()
Report the advance widths of the first 256 characters in the font.
|
int |
stringWidth(java.lang.String text)
Report the advance width of the given text.
|
int[] |
stringWidths(java.lang.String text)
Get the intermediate widths of this text (for each substring starting from index 0, ending
on indices 1 ..
|
public SwingFontMetrics(java.awt.FontMetrics fm)
public int charWidth(char ch)
charWidth
in interface FontMetricsHelper
ch
- The character to size.public int[] getWidths()
getWidths
in interface FontMetricsHelper
public int stringWidth(java.lang.String text)
stringWidth
in interface FontMetricsHelper
text
- The string to size.public int[] stringWidths(java.lang.String text)
stringWidths
in interface FontMetricsHelper
text
- The text.public int getHeight()
getHeight
in interface FontMetricsHelper