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.


Constructor Index

 o FontMetrics(Font)
Creates a new FontMetrics object with the specified font.

Method Index

 o getCharWidth(char)
Returns the width of the given character in pixels.
 o getHeight()
Gets the standard height of a line of text in this font.
 o stringWidth(String)
Returns the total advance width for showing the specified String in this Font.

Constructors

 o FontMetrics
 protected FontMetrics(Font font)
Creates a new FontMetrics object with the specified font.

Parameters:
font - the font

Methods

 o 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
 o 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.

 o getCharWidth
 public int getCharWidth(char c)
Returns the width of the given character in pixels.


All Packages  Class Hierarchy  This Package  Previous  Next  Index