Save This Page
Home » iText-src-2.1.3 » com.lowagie » text » rtf » style » [javadoc | source]
com.lowagie.text.rtf.style
public class: RtfFont [javadoc | source]
java.lang.Object
   com.lowagie.text.Font
      com.lowagie.text.rtf.style.RtfFont

All Implemented Interfaces:
    RtfExtendedElement, Comparable

Direct Known Subclasses:
    RtfParagraphStyle

The RtfFont class stores one font for an rtf document. It extends Font, so can be set as a font, to allow adding of fonts with arbitrary names. BaseFont fontname handling contributed by Craig Fleming. Various fixes Renaud Michel, Werner Daehn. Version: $Id: RtfFont.java 3373 2008-05-12 16:21:24Z xlv $
Field Summary
public static final  byte[] FONT_SIZE    Constant for the font size 
public static final  int STYLE_NONE    Constant for a plain font 
public static final  int STYLE_BOLD    Constant for a bold font 
public static final  int STYLE_ITALIC    Constant for an italic font 
public static final  int STYLE_UNDERLINE    Constant for an underlined font 
public static final  int STYLE_STRIKETHROUGH    Constant for a strikethrough font 
public static final  int STYLE_DOUBLE_STRIKETHROUGH    Constant for a double strikethrough font 
public static final  int STYLE_SHADOW    Constant for a shadowed font 
public static final  int STYLE_OUTLINE    Constant for an outlined font 
public static final  int STYLE_EMBOSSED    Constant for an embossed font 
public static final  int STYLE_ENGRAVED    Constant for an engraved font 
public static final  int STYLE_HIDDEN    Constant for a font that hides the actual text. 
protected  RtfDocument document    The RtfDocument this RtfFont belongs to. 
Fields inherited from com.lowagie.text.Font:
COURIER,  HELVETICA,  TIMES_ROMAN,  SYMBOL,  ZAPFDINGBATS,  NORMAL,  BOLD,  ITALIC,  UNDERLINE,  STRIKETHRU,  BOLDITALIC,  UNDEFINED,  DEFAULTSIZE
Constructor:
 public RtfFont(String fontName) 
    Constructs a RtfFont with the given font name and all other properties at their default values.
    Parameters:
    fontName - The font name to use
 public RtfFont(String fontName,
    float size) 
    Constructs a RtfFont with the given font name and font size and all other properties at their default values.
    Parameters:
    fontName - The font name to use
    size - The font size to use
 protected RtfFont(RtfDocument doc,
    int fontNumber) 
    Special constructor for the default font
    Parameters:
    doc - The RtfDocument this font appears in
    fontNumber - The id of this font
 public RtfFont(RtfDocument doc,
    Font font) 
    Constructs a RtfFont from a com.lowagie.text.Font
    Parameters:
    doc - The RtfDocument this font appears in
    font - The Font to use as a base
 public RtfFont(String fontName,
    float size,
    int style) 
    Constructs a RtfFont with the given font name, font size and font style and the default color.
    Parameters:
    fontName - The font name to use
    size - The font size to use
    style - The font style to use
 public RtfFont(String fontName,
    float size,
    int style,
    Color color) 
    Constructs a RtfFont with the given font name, font size, font style and color.
    Parameters:
    fontName - The font name to use
    size - the font size to use
    style - The font style to use
    color - The font color to use
 public RtfFont(String fontName,
    float size,
    int style,
    Color color,
    int charset) 
    Constructs a RtfFont with the given font name, font size, font style, color and charset. This can be used when generating non latin-1 text.
    Parameters:
    fontName - The font name to use
    size - the font size to use
    style - The font style to use
    color - The font color to use
    charset - The charset of the font content
Method from com.lowagie.text.rtf.style.RtfFont Summary:
compareTo,   difference,   equals,   getCharset,   getFamilyname,   getFontName,   getFontNumber,   getFontSize,   getFontStyle,   hashCode,   intToByteArray,   isStandardFont,   setCharset,   setColor,   setColor,   setFamily,   setFontName,   setInHeader,   setInTable,   setRtfDocument,   setSize,   setStyle,   setStyle,   writeBegin,   writeContent,   writeDefinition,   writeEnd
Methods from com.lowagie.text.Font:
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:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.rtf.style.RtfFont Detail:
 public int compareTo(Object object) 
 public Font difference(Font font) 
    Replaces the attributes that are equal to null with the attributes of a given font.
 public boolean equals(Object obj) 
    Tests for equality of RtfFonts. RtfFonts are equal if their fontName, fontSize, fontStyle and fontSuperSubscript are equal
 public int getCharset() 
    Gets the charset used for constructing this RtfFont.
 public String getFamilyname() 
 public String getFontName() 
    Gets the font name of this RtfFont
 public int getFontNumber() 
    Gets the font number of this RtfFont
 public int getFontSize() 
    Gets the font size of this RtfFont
 public int getFontStyle() 
    Gets the font style of this RtfFont
 public int hashCode() 
    Returns the hash code of this RtfFont. The hash code is the hash code of the string containing the font name + font size + "-" + the font style + "-" + the font super/supscript value.
 protected byte[] intToByteArray(int i) 
    Transforms an integer into its String representation and then returns the bytes of that string.
 public boolean isStandardFont() 
    The RtfFont is never a standard font.
 public  void setCharset(int charset) 
    Sets the charset used for constructing this RtfFont.
 public  void setColor(Color color) 
 public  void setColor(int red,
    int green,
    int blue) 
 public  void setFamily(String family) 
 protected  void setFontName(String fontName) 
    Sets the font name of this RtfFont.
 public  void setInHeader(boolean inHeader) 
    Unused
 public  void setInTable(boolean inTable) 
    Unused
 public  void setRtfDocument(RtfDocument doc) 
    Sets the RtfDocument this RtfFont belongs to
 public  void setSize(float size) 
 public  void setStyle(int style) 
 public  void setStyle(String style) 
 public  void writeBegin(OutputStream result) throws IOException 
    Writes the font beginning
 public  void writeContent(OutputStream out) throws IOException 
    unused
 public  void writeDefinition(OutputStream result) throws IOException 
    Writes the font definition
 public  void writeEnd(OutputStream result) throws IOException 
    Write the font end