|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.Font
com.lowagie.text.rtf.style.RtfFont
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. Version: $Id: RtfFont.java,v 1.14 2005/02/02 16:15:40 hallm Exp $
Field Summary | |
---|---|
private int |
charset
The character set to use for this font |
private RtfColor |
color
The colour of this font |
private RtfDocument |
document
The RtfDocument this RtfFont belongs to; |
private static byte[] |
FONT_BOLD
Constant for the bold flag |
private static byte[] |
FONT_CHARSET
Constant for the charset |
private static byte[] |
FONT_FAMILY
Constant for the font family to use ("froman") |
private static byte[] |
FONT_ITALIC
Constant for the italic flag |
static byte[] |
FONT_SIZE
Constant for the font size |
private static byte[] |
FONT_STRIKETHROUGH
Constant for the strikethrough flag |
private static byte[] |
FONT_UNDERLINE
Constant for the underline flag |
private String |
fontName
The font name. |
private int |
fontNumber
The number of this font |
private int |
fontSize
The font size. |
private int |
fontStyle
The font style. |
static int |
STYLE_BOLD
Constant for a bold font |
static int |
STYLE_ITALIC
Constant for an italic font |
static int |
STYLE_NONE
Constant for a plain font |
static int |
STYLE_STRIKETHROUGH
Constant for a strikethrough font |
static int |
STYLE_UNDERLINE
Constant for an underlined font |
Fields inherited from class com.lowagie.text.Font |
---|
BOLD, BOLDITALIC, COURIER, DEFAULTSIZE, HELVETICA, ITALIC, NORMAL, STRIKETHRU, SYMBOL, TIMES_ROMAN, UNDEFINED, UNDERLINE, ZAPFDINGBATS |
Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement |
---|
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR |
Constructor Summary | |
---|---|
|
RtfFont(RtfDocument doc,
Font font)
Constructs a RtfFont from a com.lowagie.text.Font |
protected |
RtfFont(RtfDocument doc,
int fontNumber)
Special constructor for the default font |
|
RtfFont(String fontName)
Constructs a RtfFont with the given font name and all other properties at their default values. |
|
RtfFont(String fontName,
float size)
Constructs a RtfFont with the given font name and font size and all other properties at their default values. |
|
RtfFont(String fontName,
float size,
int style)
Constructs a RtfFont with the given font name, font size and font style and the default color. |
|
RtfFont(String fontName,
float size,
int style,
Color color)
Constructs a RtfFont with the given font name, font size, font style and color. |
Method Summary | |
---|---|
Font |
difference(Font font)
Replaces the attributes that are equal to null with the attributes of a given font. |
boolean |
equals(Object obj)
Tests for equality of RtfFonts. |
String |
getFamilyname()
Gets the familyname as a String. |
String |
getFontName()
Gets the font name of this RtfFont |
int |
getFontNumber()
Gets the font number of this RtfFont |
int |
getFontSize()
Gets the font size of this RtfFont |
int |
getFontStyle()
Gets the font style of this RtfFont |
int |
hashCode()
Returns the hash code of this RtfFont. |
private byte[] |
intToByteArray(int i)
Transforms an integer into its String representation and then returns the bytes of that string. |
void |
setInHeader(boolean inHeader)
Unused |
void |
setInTable(boolean inTable)
Unused |
void |
setRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfFont belongs to |
byte[] |
write()
Unused |
byte[] |
writeBegin()
Writes the font beginning |
byte[] |
writeDefinition()
Writes the font definition |
byte[] |
writeEnd()
Write the font end |
Methods inherited from class com.lowagie.text.Font |
---|
color, compareTo, family, getBaseFont, getCalculatedBaseFont, getCalculatedSize, getCalculatedStyle, getFamilyIndex, getStyleValue, isBold, isItalic, isStandardFont, isStrikethru, isUnderlined, leading, setColor, setColor, setFamily, setSize, setStyle, setStyle, size, style |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final byte[] FONT_FAMILY
private static final byte[] FONT_CHARSET
public static final byte[] FONT_SIZE
private static final byte[] FONT_BOLD
private static final byte[] FONT_ITALIC
private static final byte[] FONT_UNDERLINE
private static final byte[] FONT_STRIKETHROUGH
public static final int STYLE_NONE
public static final int STYLE_ITALIC
public static final int STYLE_BOLD
public static final int STYLE_UNDERLINE
public static final int STYLE_STRIKETHROUGH
private String fontName
private int fontSize
private int fontStyle
private int fontNumber
private RtfColor color
private int charset
private RtfDocument document
Constructor Detail |
public RtfFont(String fontName)
fontName
- The font name to usepublic RtfFont(String fontName, float size)
fontName
- The font name to usesize
- The font size to usepublic RtfFont(String fontName, float size, int style)
fontName
- The font name to usesize
- The font size to usestyle
- The font style to usepublic RtfFont(String fontName, float size, int style, Color color)
fontName
- The font name to usesize
- the font size to usestyle
- The font style to usecolor
- The font color to useprotected RtfFont(RtfDocument doc, int fontNumber)
doc
- The RtfDocument this font appears infontNumber
- The id of this fontpublic RtfFont(RtfDocument doc, Font font)
doc
- The RtfDocument this font appears infont
- The Font to use as a baseMethod Detail |
public byte[] writeDefinition()
writeDefinition
in interface RtfExtendedElement
public byte[] writeBegin()
public byte[] writeEnd()
public byte[] write()
write
in interface RtfBasicElement
public boolean equals(Object obj)
obj
- The RtfFont to compare with this RtfFont
True
if the RtfFonts are equal, false
otherwisepublic int hashCode()
public String getFontName()
public String getFamilyname()
Font
getFamilyname
in class Font
Font.getFamilyname()
public int getFontSize()
public int getFontStyle()
public int getFontNumber()
public void setRtfDocument(RtfDocument doc)
setRtfDocument
in interface RtfBasicElement
doc
- The RtfDocument to usepublic void setInTable(boolean inTable)
setInTable
in interface RtfBasicElement
inTable
- public void setInHeader(boolean inHeader)
setInHeader
in interface RtfBasicElement
inHeader
- private byte[] intToByteArray(int i)
i
- The integer to convert
public Font difference(Font font)
difference
in class Font
font
- The surrounding font
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |