Home » iText-2.1.7 » com.lowagie » text » [javadoc | source]
com.lowagie.text
public class: Font [javadoc | source]
java.lang.Object
   com.lowagie.text.Font

All Implemented Interfaces:
    Comparable

Direct Known Subclasses:
    RtfFont, RtfParagraphStyle, RtfFont

Contains all the specifications of a font: fontfamily, size, style and color.

Example:


Paragraph p = new Paragraph("This is a paragraph", new
Font(Font.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)) );

Field Summary
public static final  int COURIER    a possible value of a font family. 
public static final  int HELVETICA    a possible value of a font family. 
public static final  int TIMES_ROMAN    a possible value of a font family. 
public static final  int SYMBOL    a possible value of a font family. 
public static final  int ZAPFDINGBATS    a possible value of a font family. 
public static final  int NORMAL    this is a possible style. 
public static final  int BOLD    this is a possible style. 
public static final  int ITALIC    this is a possible style. 
public static final  int UNDERLINE    this is a possible style. 
public static final  int STRIKETHRU    this is a possible style. 
public static final  int BOLDITALIC    this is a possible style. 
public static final  int UNDEFINED    the value of an undefined attribute. 
public static final  int DEFAULTSIZE    the value of the default size. 
Constructor:
 public Font() 
 public Font(Font other) 
    Copy constructor of a Font
    Parameters:
    other - the font that has to be copied
 public Font(BaseFont bf) 
    Constructs a Font.
    Parameters:
    bf - the external font
 public Font(int family) 
 public Font(BaseFont bf,
    float size) 
    Constructs a Font.
    Parameters:
    bf - the external font
    size - the size of this font
 public Font(int family,
    float size) 
 public Font(BaseFont bf,
    float size,
    int style) 
    Constructs a Font.
    Parameters:
    bf - the external font
    size - the size of this font
    style - the style of this font
 public Font(int family,
    float size,
    int style) 
 public Font(int family,
    float size,
    int style,
    Color color) 
    Constructs a Font.
    Parameters:
    family - the family to which this font belongs
    size - the size of this font
    style - the style of this font
    color - the Color of this font.
 public Font(BaseFont bf,
    float size,
    int style,
    Color color) 
    Constructs a Font.
    Parameters:
    bf - the external font
    size - the size of this font
    style - the style of this font
    color - the Color of this font.
Method from com.lowagie.text.Font Summary:
compareTo,   difference,   getBaseFont,   getCalculatedBaseFont,   getCalculatedLeading,   getCalculatedSize,   getCalculatedStyle,   getColor,   getFamily,   getFamilyIndex,   getFamilyname,   getSize,   getStyle,   getStyleValue,   isBold,   isItalic,   isStandardFont,   isStrikethru,   isUnderlined,   setColor,   setColor,   setFamily,   setSize,   setStyle,   setStyle
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.Font Detail:
 public int compareTo(Object object) 
    Compares this Font with another
 public Font difference(Font font) 
    Replaces the attributes that are equal to null with the attributes of a given font.
 public BaseFont getBaseFont() 
    Gets the BaseFont inside this object.
 public BaseFont getCalculatedBaseFont(boolean specialEncoding) 
    Gets the BaseFont this class represents. For the built-in fonts a BaseFont is calculated.
 public float getCalculatedLeading(float linespacing) 
    Gets the leading that can be used with this font.
 public float getCalculatedSize() 
    Gets the size that can be used with the calculated BaseFont .
 public int getCalculatedStyle() 
    Gets the style that can be used with the calculated BaseFont .
 public Color getColor() 
    Gets the color of this font.
 public int getFamily() 
    Gets the family of this font.
 public static int getFamilyIndex(String family) 
    Translates a String -value of a certain family into the index that is used for this family in this class.
 public String getFamilyname() 
    Gets the familyname as a String.
 public float getSize() 
    Gets the size of this font.
 public int getStyle() 
    Gets the style of this font.
 public static int getStyleValue(String style) 
    Translates a String -value of a certain style into the index value is used for this style in this class.
 public boolean isBold() 
    checks if this font is Bold.
 public boolean isItalic() 
    checks if this font is Bold.
 public boolean isStandardFont() 
    Checks if the properties of this font are undefined or null.

    If so, the standard should be used.

 public boolean isStrikethru() 
    checks if the style of this font is STRIKETHRU.
 public boolean isUnderlined() 
    checks if this font is underlined.
 public  void setColor(Color color) 
    Sets the color.
 public  void setColor(int red,
    int green,
    int blue) 
    Sets the color.
 public  void setFamily(String family) 
    Sets the family using a String ("Courier", "Helvetica", "Times New Roman", "Symbol" or "ZapfDingbats").
 public  void setSize(float size) 
    Sets the size.
 public  void setStyle(int style) 
    Sets the style.
 public  void setStyle(String style) 
    Sets the style using a String containing one of more of the following values: normal, bold, italic, underline, strike.