All Packages Class Hierarchy This Package Previous Next Index
Class com.bulletproof.gui.FontMetrics
java.lang.Object
|
+----com.bulletproof.gui.FontMetrics
- public class FontMetrics
- extends Object
A font metrics object.
-
FontMetrics(Font)
- Creates a new FontMetrics object with the specified font.
-
getCharWidth(char)
- Returns the width of the given character in pixels.
-
getHeight()
- Gets the standard height of a line of text in this font.
-
stringWidth(String)
-
Returns the total advance width for showing the specified String
in this Font.
FontMetrics
protected FontMetrics(Font font)
- Creates a new FontMetrics object with the specified font.
- Parameters:
- font - the font
stringWidth
public int stringWidth(String s)
- Returns the total advance width for showing the specified String
in this Font.
The advance width is the amount by which the current point is
moved from one character to the next in a line of text.
- Parameters:
- str - the String to be measured
getHeight
public int getHeight()
- Gets the standard height of a line of text in this font. This
is the distance between the baseline of adjacent lines of text.
It is the sum of the leading + ascent + descent. There is no
guarantee that lines of text spaced at this distance will be
disjoint; such lines may overlap if some characters overshoot
either the standard ascent or the standard descent metric.
getCharWidth
public int getCharWidth(char c)
- Returns the width of the given character in pixels.
All Packages Class Hierarchy This Package Previous Next Index