java.lang.Object
com.lowagie.text.Font
- All Implemented Interfaces:
Comparable
Deprecated.
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
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.this is a possible style.static final intDeprecated.this is a possible style.static final intDeprecated.a possible value of a font family.static final intDeprecated.the value of the default size.static final intDeprecated.a possible value of a font family.static final intDeprecated.this is a possible style.static final intDeprecated.this is a possible style.static final intDeprecated.this is a possible style.static final intDeprecated.a possible value of a font family.static final intDeprecated.a possible value of a font family.static final intDeprecated.the value of an undefined attribute.static final intDeprecated.this is a possible style.static final intDeprecated.a possible value of a font family. -
Constructor Summary
ConstructorsConstructorDescriptionFont()Deprecated.Constructs a Font.Font(int family) Deprecated.Constructs a Font.Font(int family, float size) Deprecated.Constructs a Font.Font(int family, float size, int style) Deprecated.Constructs a Font.Deprecated.Constructs a Font.Deprecated.Copy constructor of a FontDeprecated.Constructs a Font.Deprecated.Constructs a Font.Deprecated.Constructs a Font.Deprecated.Constructs a Font. -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated.Compares thisFontwith anotherdifference(Font font) Deprecated.Replaces the attributes that are equal to null with the attributes of a given font.Deprecated.Gets theBaseFontinside this object.intDeprecated.Return the style of the BaseFont based on it's name.getCalculatedBaseFont(boolean specialEncoding) Deprecated.Gets theBaseFontthis class represents.floatgetCalculatedLeading(float linespacing) Deprecated.Gets the leading that can be used with this font.floatDeprecated.Gets the size that can be used with the calculatedBaseFont.intDeprecated.Gets the style that can be used with the calculatedBaseFont.getColor()Deprecated.Gets the color of this font.intDeprecated.Returns the combined style of the font with the base font.intDeprecated.Gets the family of this font.static intgetFamilyIndex(String family) Deprecated.Translates aString-value of a certain family into the index that is used for this family in this class.Deprecated.Gets the familyname as a String.static intgetFontStyleFromName(String fontName) Deprecated.Returns the font-style, if the font is already styled.floatgetSize()Deprecated.Gets the size of this font.intgetStyle()Deprecated.Gets the style of this font.static intgetStyleValue(String style) Deprecated.Translates aString-value of a certain style into the index value is used for this style in this class.booleanisBold()Deprecated.checks if this font is Bold.booleanisItalic()Deprecated.checks if this font is italic.booleanDeprecated.Checks if the properties of this font are undefined or null.booleanDeprecated.checks if the style of this font is STRIKETHRU.booleanDeprecated.checks if this font is underlined.voidsetColor(int red, int green, int blue) Deprecated.Sets the color.voidDeprecated.Sets the color.voidDeprecated.Sets the family using aString("Courier", "Helvetica", "Times New Roman", "Symbol" or "ZapfDingbats").voidsetSize(float size) Deprecated.Sets the size.voidsetStyle(int style) Deprecated.Sets the style.voidDeprecated.Sets the style using aStringcontaining one of more of the following values: normal, bold, italic, underline, strike.
-
Field Details
-
COURIER
public static final int COURIERDeprecated.a possible value of a font family.- See Also:
-
HELVETICA
public static final int HELVETICADeprecated.a possible value of a font family.- See Also:
-
TIMES_ROMAN
public static final int TIMES_ROMANDeprecated.a possible value of a font family.- See Also:
-
SYMBOL
public static final int SYMBOLDeprecated.a possible value of a font family.- See Also:
-
ZAPFDINGBATS
public static final int ZAPFDINGBATSDeprecated.a possible value of a font family.- See Also:
-
NORMAL
public static final int NORMALDeprecated.this is a possible style.- See Also:
-
BOLD
public static final int BOLDDeprecated.this is a possible style.- See Also:
-
ITALIC
public static final int ITALICDeprecated.this is a possible style.- See Also:
-
UNDERLINE
public static final int UNDERLINEDeprecated.this is a possible style.- See Also:
-
STRIKETHRU
public static final int STRIKETHRUDeprecated.this is a possible style.- See Also:
-
BOLDITALIC
public static final int BOLDITALICDeprecated.this is a possible style.- See Also:
-
UNDEFINED
public static final int UNDEFINEDDeprecated.the value of an undefined attribute.- See Also:
-
DEFAULTSIZE
public static final int DEFAULTSIZEDeprecated.the value of the default size.- See Also:
-
-
Constructor Details
-
Font
Deprecated.Copy constructor of a Font- Parameters:
other- the font that has to be copied
-
Font
Deprecated.Constructs a Font.- Parameters:
family- the family to which this font belongssize- the size of this fontstyle- the style of this fontcolor- theColorof this font.
-
Font
Deprecated.Constructs a Font.- Parameters:
bf- the external fontsize- the size of this fontstyle- the style of this fontcolor- theColorof this font.
-
Font
Deprecated.Constructs a Font.- Parameters:
bf- the external fontsize- the size of this fontstyle- the style of this font
-
Font
Deprecated.Constructs a Font.- Parameters:
bf- the external fontsize- the size of this font
-
Font
Deprecated.Constructs a Font.- Parameters:
bf- the external font
-
Font
public Font(int family, float size, int style) Deprecated.Constructs a Font.- Parameters:
family- the family to which this font belongssize- the size of this fontstyle- the style of this font
-
Font
public Font(int family, float size) Deprecated.Constructs a Font.- Parameters:
family- the family to which this font belongssize- the size of this font
-
Font
public Font(int family) Deprecated.Constructs a Font.- Parameters:
family- the family to which this font belongs
-
Font
public Font()Deprecated.Constructs a Font.
-
-
Method Details
-
getFamilyIndex
Deprecated.Translates aString-value of a certain family into the index that is used for this family in this class.- Parameters:
family- AStringrepresenting a certain font-family- Returns:
- the corresponding index
-
getFontStyleFromName
Deprecated.Returns the font-style, if the font is already styled.
For example: font: Helvetica - style: normal font: Helvetica-Bold - style: bold
- Parameters:
fontName- the name of the Font- Returns:
- the styles of an already styled font.
-
getStyleValue
Deprecated.Translates aString-value of a certain style into the index value is used for this style in this class.- Parameters:
style- AString- Returns:
- the corresponding value
-
compareTo
Deprecated.Compares thisFontwith another- Specified by:
compareToin interfaceComparable- Parameters:
object- the otherFont- Returns:
- a value
-
getFamily
public int getFamily()Deprecated.Gets the family of this font.- Returns:
- the value of the family
-
setFamily
Deprecated.Sets the family using aString("Courier", "Helvetica", "Times New Roman", "Symbol" or "ZapfDingbats").- Parameters:
family- AStringrepresenting a certain font-family.
-
getFamilyname
Deprecated.Gets the familyname as a String.- Returns:
- the familyname
-
getSize
public float getSize()Deprecated.Gets the size of this font.- Returns:
- a size
-
setSize
public void setSize(float size) Deprecated.Sets the size.- Parameters:
size- The new size of the font.
-
getCalculatedSize
public float getCalculatedSize()Deprecated.Gets the size that can be used with the calculatedBaseFont.- Returns:
- the size that can be used with the calculated
BaseFont
-
getCalculatedLeading
public float getCalculatedLeading(float linespacing) Deprecated.Gets the leading that can be used with this font.- Parameters:
linespacing- a certain linespacing- Returns:
- the height of a line
-
getStyle
public int getStyle()Deprecated.Gets the style of this font.- Returns:
- a size
-
setStyle
public void setStyle(int style) Deprecated.Sets the style.- Parameters:
style- the style.
-
setStyle
Deprecated.Sets the style using aStringcontaining one of more of the following values: normal, bold, italic, underline, strike.- Parameters:
style- AStringrepresenting a certain style.
-
getCalculatedStyle
public int getCalculatedStyle()Deprecated.Gets the style that can be used with the calculatedBaseFont.- Returns:
- the style that can be used with the calculated
BaseFont
-
getCombinedStyle
public int getCombinedStyle()Deprecated.Returns the combined style of the font with the base font. -
getBaseFontStyle
public int getBaseFontStyle()Deprecated.Return the style of the BaseFont based on it's name.- Returns:
- Font.NORMAL if no style can be detected from the font name.
-
isBold
public boolean isBold()Deprecated.checks if this font is Bold.- Returns:
- a
boolean
-
isItalic
public boolean isItalic()Deprecated.checks if this font is italic.- Returns:
- a
boolean
-
isUnderlined
public boolean isUnderlined()Deprecated.checks if this font is underlined.- Returns:
- a
boolean
-
isStrikethru
public boolean isStrikethru()Deprecated.checks if the style of this font is STRIKETHRU.- Returns:
- a
boolean
-
getColor
Deprecated.Gets the color of this font.- Returns:
- a color
-
setColor
Deprecated.Sets the color.- Parameters:
color- the new color of the font
-
setColor
public void setColor(int red, int green, int blue) Deprecated.Sets the color.- Parameters:
red- the red-value of the new colorgreen- the green-value of the new colorblue- the blue-value of the new color
-
getBaseFont
Deprecated.Gets theBaseFontinside this object.- Returns:
- the
BaseFont
-
getCalculatedBaseFont
Deprecated.Gets theBaseFontthis class represents. For the built-in fonts aBaseFontis calculated.- Parameters:
specialEncoding-trueto use the special encoding for Symbol and ZapfDingbats,falseto always useCp1252- Returns:
- the
BaseFontthis class represents
-
isStandardFont
public boolean isStandardFont()Deprecated.Checks if the properties of this font are undefined or null.If so, the standard should be used.
- Returns:
- a
boolean
-
difference
Deprecated.Replaces the attributes that are equal to null with the attributes of a given font.- Parameters:
font- the font of a bigger element class- Returns:
- a
Font
-