com.flagstone.transform.util.font
Class FontFace

java.lang.Object
  extended by com.flagstone.transform.util.font.FontFace

public final class FontFace
extends Object

FontFace is a convenience class that can be used to create tables of fonts for use in an application.


Constructor Summary
FontFace(String fontName, boolean isBold, boolean isItalic)
          Create a new font face.
FontFace(String fontName, int style)
          Create a new font face.
 
Method Summary
 boolean equals(Object object)
           
 String getName()
          Get the (family) name of the font.
 int getStyle()
          Get the font style, as defined in the AWT Font class, either Font.PLAIN or a combination of Font.BOLD and Font.ITALIC.
 int hashCode()
           
 boolean isBold()
          Is the font bold or normal.
 boolean isItalic()
          Is the font italicised or normal.
 String toString()
          Get name of the font face which contains the name of the font followed by "Bold" for bold fonts and "Italic" for fonts with an italic style.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FontFace

public FontFace(String fontName,
                boolean isBold,
                boolean isItalic)
Create a new font face.

Parameters:
fontName - the family name of the font.
isBold - is the font bold.
isItalic - is the font italicised.

FontFace

public FontFace(String fontName,
                int style)
Create a new font face.

Parameters:
fontName - the family name of the font.
style - a java.awt.Font constant describing whether the font is normal, bold and/or italicised.
Method Detail

getName

public String getName()
Get the (family) name of the font.

Returns:
the family name of the font, e.g. Arial

isBold

public boolean isBold()
Is the font bold or normal.

Returns:
true if the font is bold, false if the font has normal weight.

isItalic

public boolean isItalic()
Is the font italicised or normal.

Returns:
true if the font is italicised, false if the font has normal weight.

getStyle

public int getStyle()
Get the font style, as defined in the AWT Font class, either Font.PLAIN or a combination of Font.BOLD and Font.ITALIC.

Returns:
the java.awt.Font constant defining the font style.

toString

public String toString()
Get name of the font face which contains the name of the font followed by "Bold" for bold fonts and "Italic" for fonts with an italic style.

Overrides:
toString in class Object
Returns:
a human readable string describing the font.

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.