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