| java.lang.Object com.lowagie.text.Font
All known Subclasses: com.lowagie.text.rtf.style.RtfFont, com.lowagie.text.rtf.RtfFont,
Font | public class Font implements Comparable(Code) | | 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 | |
final public static int | BOLD this is a possible style. | final public static int | BOLDITALIC this is a possible style. | final public static int | COURIER a possible value of a font family. | final public static int | DEFAULTSIZE the value of the default size. | final public static int | HELVETICA a possible value of a font family. | final public static int | ITALIC this is a possible style. | final public static int | NORMAL this is a possible style. | final public static int | STRIKETHRU this is a possible style. | final public static int | SYMBOL a possible value of a font family. | final public static int | TIMES_ROMAN a possible value of a font family. | final public static int | UNDEFINED the value of an undefined attribute. | final public static int | UNDERLINE this is a possible style. | final public static int | ZAPFDINGBATS a possible value of a font family. |
Constructor Summary | |
public | Font(Font other) | public | Font(int family, float size, int style, Color color) Constructs a Font. | public | Font(BaseFont bf, float size, int style, Color color) Constructs a Font. | public | Font(BaseFont bf, float size, int style) Constructs a Font. | public | Font(BaseFont bf, float size) Constructs a Font. | public | Font(BaseFont bf) Constructs a Font. | public | Font(int family, float size, int style) Constructs a Font. | public | Font(int family, float size) Constructs a Font. | public | Font(int family) Constructs a Font. | public | Font() Constructs a Font. |
Method Summary | |
public Color | color() Gets the color of this font. | 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 int | family() Gets the family of this font. | public BaseFont | getBaseFont() Gets the BaseFont inside this object. | public BaseFont | getCalculatedBaseFont(boolean specialEncoding) Gets the BaseFont this class represents. | 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. | public boolean | isStrikethru() checks if the style of this font is STRIKETHRU. | public boolean | isUnderlined() checks if this font is underlined. | public float | leading(float linespacing) Gets the leading that can be used with this font. | 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. | public float | size() Gets the size of this font. | public int | style() Gets the style of this font. |
BOLD | final public static int BOLD(Code) | | this is a possible style.
|
BOLDITALIC | final public static int BOLDITALIC(Code) | | this is a possible style.
|
COURIER | final public static int COURIER(Code) | | a possible value of a font family.
|
DEFAULTSIZE | final public static int DEFAULTSIZE(Code) | | the value of the default size.
|
HELVETICA | final public static int HELVETICA(Code) | | a possible value of a font family.
|
ITALIC | final public static int ITALIC(Code) | | this is a possible style.
|
NORMAL | final public static int NORMAL(Code) | | this is a possible style.
|
STRIKETHRU | final public static int STRIKETHRU(Code) | | this is a possible style.
|
SYMBOL | final public static int SYMBOL(Code) | | a possible value of a font family.
|
TIMES_ROMAN | final public static int TIMES_ROMAN(Code) | | a possible value of a font family.
|
UNDEFINED | final public static int UNDEFINED(Code) | | the value of an undefined attribute.
|
UNDERLINE | final public static int UNDERLINE(Code) | | this is a possible style.
|
ZAPFDINGBATS | final public static int ZAPFDINGBATS(Code) | | a possible value of a font family.
|
Font | public Font(Font other)(Code) | | Copy constructor of a Font
Parameters: other - the font that has to be copied |
Font | public Font(int family, float size, int style, Color color)(Code) | | Constructs a Font.
Parameters: family - the family to which this font belongs Parameters: size - the size of this font Parameters: style - the style of this font Parameters: color - the Color of this font. |
Font | public Font(BaseFont bf, float size, int style, Color color)(Code) | | Constructs a Font.
Parameters: bf - the external font Parameters: size - the size of this font Parameters: style - the style of this font Parameters: color - the Color of this font. |
Font | public Font(BaseFont bf, float size, int style)(Code) | | Constructs a Font.
Parameters: bf - the external font Parameters: size - the size of this font Parameters: style - the style of this font |
Font | public Font(BaseFont bf, float size)(Code) | | Constructs a Font.
Parameters: bf - the external font Parameters: size - the size of this font |
Font | public Font(BaseFont bf)(Code) | | Constructs a Font.
Parameters: bf - the external font |
Font | public Font(int family, float size, int style)(Code) | | Constructs a Font.
Parameters: family - the family to which this font belongs Parameters: size - the size of this font Parameters: style - the style of this font |
Font | public Font(int family, float size)(Code) | | Constructs a Font.
Parameters: family - the family to which this font belongs Parameters: size - the size of this font |
Font | public Font(int family)(Code) | | Constructs a Font.
Parameters: family - the family to which this font belongs |
Font | public Font()(Code) | | Constructs a Font.
|
compareTo | public int compareTo(Object object)(Code) | | Compares this Font with another
Parameters: object - the other Font a value |
difference | public Font difference(Font font)(Code) | | Replaces the attributes that are equal to null with the
attributes of a given font.
Parameters: font - the font of a bigger element class a Font |
getBaseFont | public BaseFont getBaseFont()(Code) | | Gets the BaseFont inside this object.
the BaseFont |
getCalculatedBaseFont | public BaseFont getCalculatedBaseFont(boolean specialEncoding)(Code) | | Gets the BaseFont this class represents. For the built-in
fonts a BaseFont is calculated.
Parameters: specialEncoding - true to use the special encoding for Symbol andZapfDingbats, false to always use Cp1252 the BaseFont this class represents |
getCalculatedLeading | public float getCalculatedLeading(float linespacing)(Code) | | Gets the leading that can be used with this font.
Parameters: linespacing - a certain linespacing the height of a line |
getCalculatedSize | public float getCalculatedSize()(Code) | | Gets the size that can be used with the calculated BaseFont
.
the size that can be used with the calculated BaseFont |
getCalculatedStyle | public int getCalculatedStyle()(Code) | | Gets the style that can be used with the calculated BaseFont
.
the style that can be used with the calculated BaseFont |
getColor | public Color getColor()(Code) | | Gets the color of this font.
a color |
getFamily | public int getFamily()(Code) | | Gets the family of this font.
the value of the family |
getFamilyIndex | public static int getFamilyIndex(String family)(Code) | | Translates a String -value of a certain family into the
index that is used for this family in this class.
Parameters: family - A String representing a certain font-family the corresponding index |
getFamilyname | public String getFamilyname()(Code) | | Gets the familyname as a String.
the familyname |
getSize | public float getSize()(Code) | | Gets the size of this font.
a size |
getStyle | public int getStyle()(Code) | | Gets the style of this font.
a size |
getStyleValue | public static int getStyleValue(String style)(Code) | | Translates a String -value of a certain style into the
index value is used for this style in this class.
Parameters: style - A String the corresponding value |
isBold | public boolean isBold()(Code) | | checks if this font is Bold.
a boolean |
isItalic | public boolean isItalic()(Code) | | checks if this font is Bold.
a boolean |
isStandardFont | public boolean isStandardFont()(Code) | | Checks if the properties of this font are undefined or null.
If so, the standard should be used.
a boolean |
isStrikethru | public boolean isStrikethru()(Code) | | checks if the style of this font is STRIKETHRU.
a boolean |
isUnderlined | public boolean isUnderlined()(Code) | | checks if this font is underlined.
a boolean |
leading | public float leading(float linespacing)(Code) | | Gets the leading that can be used with this font.
Parameters: linespacing - a certain linespacing the height of a lineFont.getCalculatedLeading(float) |
setColor | public void setColor(Color color)(Code) | | Sets the color.
Parameters: color - the new color of the font |
setColor | public void setColor(int red, int green, int blue)(Code) | | Sets the color.
Parameters: red - the red-value of the new color Parameters: green - the green-value of the new color Parameters: blue - the blue-value of the new color |
setFamily | public void setFamily(String family)(Code) | | Sets the family using a String ("Courier", "Helvetica",
"Times New Roman", "Symbol" or "ZapfDingbats").
Parameters: family - A String representing a certain font-family. |
setSize | public void setSize(float size)(Code) | | Sets the size.
Parameters: size - The new size of the font. |
setStyle | public void setStyle(int style)(Code) | | Sets the style.
Parameters: style - the style. |
setStyle | public void setStyle(String style)(Code) | | Sets the style using a String containing one of more of
the following values: normal, bold, italic, underline, strike.
Parameters: style - A String representing a certain style. |
|
|