edu.princeton.swing.text
Class FontInfo

java.lang.Object
  extended by edu.princeton.swing.text.FontInfo

public class FontInfo
extends Object

FontInfo is a class that analyzes a font to see if it is monospaced over a specified set of characters.


Constructor Summary
FontInfo(Font font, boolean[] characterAllowed)
          Creates a new FontInfo object.
 
Method Summary
 int[] getBoldCharacterWidths()
          Returns the set of all character widths for the bold flavor of the font.
 int[] getBoldItalicCharacterWidths()
          Returns the set of all character widths for the bold-italic flavor of the font.
 int getCharacterHeight()
          Gets the maximum character height for the font over the specified set of characters.
 Font getFont()
          Returns the font represented by this FontInfo object.
 int[] getItalicCharacterWidths()
          Returns the set of all character widths for the italic flavor of the font.
 int getLineSpacing()
          Gets the recommended number pixels which should vertically separate each line.
 int getMaxCharacterWidth()
          Returns the maximum width attained by one of the characters in the specified set of characters.
 int[] getPlainCharacterWidths()
          Returns the set of all character widths for the plain flavor of the font.
 boolean isMonospaced()
          Returns wheter or not the font is monspaced over the specified set of characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontInfo

public FontInfo(Font font,
                boolean[] characterAllowed)
Creates a new FontInfo object.

Method Detail

getFont

public Font getFont()
Returns the font represented by this FontInfo object.

Returns:
The font represented by this FontInfo object.

isMonospaced

public boolean isMonospaced()
Returns wheter or not the font is monspaced over the specified set of characters.

Returns:
True iff the font is monospaced over the specified set of characters.

getMaxCharacterWidth

public int getMaxCharacterWidth()
Returns the maximum width attained by one of the characters in the specified set of characters.

Returns:
The maximum width attained by one of the characters in the specified set of characters.

getPlainCharacterWidths

public int[] getPlainCharacterWidths()
Returns the set of all character widths for the plain flavor of the font.

Returns:
The set of all character widths for the plain flavor of the font. Indices which are out of bounds and elements with a value 0 denote characters which were not in the specified set.

getBoldCharacterWidths

public int[] getBoldCharacterWidths()
Returns the set of all character widths for the bold flavor of the font.

Returns:
The set of all character widths for the bold flavor of the font. Indices which are out of bounds and elements with a value 0 denote characters which were not in the specified set.

getItalicCharacterWidths

public int[] getItalicCharacterWidths()
Returns the set of all character widths for the italic flavor of the font.

Returns:
The set of all character widths for the italic flavor of the font. Indices which are out of bounds and elements with a value 0 denote characters which were not in the specified set.

getBoldItalicCharacterWidths

public int[] getBoldItalicCharacterWidths()
Returns the set of all character widths for the bold-italic flavor of the font.

Returns:
The set of all character widths for the bold-italic flavor of the font. Indices which are out of bounds and elements with a value 0 denote characters which were not in the specified set.

getCharacterHeight

public int getCharacterHeight()
Gets the maximum character height for the font over the specified set of characters.

Returns:
The maximum character height for the font over the specified set of characters.

getLineSpacing

public int getLineSpacing()
Gets the recommended number pixels which should vertically separate each line.

Returns:
The recommended number pixels which should vertically separate each line.