|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lowagie.text.Font
public class Font
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 | |
|---|---|
private BaseFont |
baseFont
the external font |
static int |
BOLD
this is a possible style. |
static int |
BOLDITALIC
this is a possible style. |
private 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. |
private 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. |
private float |
size
the value of the fontsize. |
static int |
STRIKETHRU
this is a possible style. |
private int |
style
the value of the 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()
Constructs a Font. |
|
Font(BaseFont bf)
Constructs a Font. |
|
Font(BaseFont bf,
float size)
Constructs a Font. |
|
Font(BaseFont bf,
float size,
int style)
Constructs a Font. |
|
Font(BaseFont bf,
float size,
int style,
Color color)
Constructs a Font. |
|
Font(Font other)
Copy constructor of a Font |
|
Font(int family)
Constructs a Font. |
|
Font(int family,
float size)
Constructs a Font. |
|
Font(int family,
float size,
int style)
Constructs a Font. |
|
Font(int family,
float size,
int style,
Color color)
Constructs a Font. |
|
| Method Summary | |
|---|---|
Color |
color()
Deprecated. As of iText 2.0.3, replaced by getColor(),
scheduled for removal at 2.1.0 |
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()
Deprecated. As of iText 2.0.3, replaced by getFamily(),
scheduled for removal at 2.1.0 |
BaseFont |
getBaseFont()
Gets the BaseFont inside this object. |
BaseFont |
getCalculatedBaseFont(boolean specialEncoding)
Gets the BaseFont this class represents. |
float |
getCalculatedLeading(float linespacing)
Gets the leading that can be used with this font. |
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
. |
Color |
getColor()
Gets the color of this font. |
int |
getFamily()
Gets the family of this font. |
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. |
float |
getSize()
Gets the size of this font. |
int |
getStyle()
Gets the style of this font. |
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)
Deprecated. As of iText 2.0.3, replaced by getCalculatedLeading(float),
scheduled for removal at 2.1.0 |
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(int style)
Sets the style. |
void |
setStyle(String style)
Sets the style using a String containing one of more of
the following values: normal, bold, italic, underline, strike. |
float |
size()
Deprecated. As of iText 2.0.3, replaced by getSize(),
scheduled for removal at 2.1.0 |
int |
style()
Deprecated. As of iText 2.0.3, replaced by getStyle(),
scheduled for removal at 2.1.0 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int COURIER
public static final int HELVETICA
public static final int TIMES_ROMAN
public static final int SYMBOL
public static final int ZAPFDINGBATS
public static final int NORMAL
public static final int BOLD
public static final int ITALIC
public static final int UNDERLINE
public static final int STRIKETHRU
public static final int BOLDITALIC
public static final int UNDEFINED
public static final int DEFAULTSIZE
private int family
private float size
private int style
private Color color
private BaseFont baseFont
| Constructor Detail |
|---|
public Font(Font other)
other - the font that has to be copied
public Font(int family,
float size,
int style,
Color color)
family - the family to which this font belongssize - the size of this fontstyle - the style of this fontcolor - the Color of this font.
public Font(BaseFont bf,
float size,
int style,
Color color)
bf - the external fontsize - the size of this fontstyle - the style of this fontcolor - the Color of this font.
public Font(BaseFont bf,
float size,
int style)
bf - the external fontsize - the size of this fontstyle - the style of this font
public Font(BaseFont bf,
float size)
bf - the external fontsize - the size of this fontpublic Font(BaseFont bf)
bf - the external font
public Font(int family,
float size,
int style)
family - the family to which this font belongssize - the size of this fontstyle - the style of this font
public Font(int family,
float size)
family - the family to which this font belongssize - the size of this fontpublic Font(int family)
family - the family to which this font belongspublic Font()
| Method Detail |
|---|
public int compareTo(Object object)
Font with another
compareTo in interface Comparableobject - the other Font
public int getFamily()
public String getFamilyname()
public void setFamily(String family)
String ("Courier", "Helvetica",
"Times New Roman", "Symbol" or "ZapfDingbats").
family - A String representing a certain font-family.public static int getFamilyIndex(String family)
String -value of a certain family into the
index that is used for this family in this class.
family - A String representing a certain font-family
public float getSize()
public float getCalculatedSize()
BaseFont
.
BaseFont
public float getCalculatedLeading(float linespacing)
linespacing - a certain linespacing
public void setSize(float size)
size - The new size of the font.public int getStyle()
public int getCalculatedStyle()
BaseFont
.
BaseFont
public boolean isBold()
booleanpublic boolean isItalic()
booleanpublic boolean isUnderlined()
booleanpublic boolean isStrikethru()
booleanpublic void setStyle(int style)
style - the style.public void setStyle(String style)
String containing one of more of
the following values: normal, bold, italic, underline, strike.
style - A String representing a certain style.public static int getStyleValue(String style)
String -value of a certain style into the
index value is used for this style in this class.
style - A String
public Color getColor()
public void setColor(Color color)
color - the new color of the font
public void setColor(int red,
int green,
int blue)
red - the red-value of the new colorgreen - the green-value of the new colorblue - the blue-value of the new colorpublic BaseFont getBaseFont()
BaseFont inside this object.
BaseFontpublic BaseFont getCalculatedBaseFont(boolean specialEncoding)
BaseFont this class represents. For the built-in
fonts a BaseFont is calculated.
specialEncoding - true to use the special encoding for Symbol and
ZapfDingbats, false to always use Cp1252
BaseFont this class representspublic boolean isStandardFont()
If so, the standard should be used.
booleanpublic Font difference(Font font)
font - the font of a bigger element class
Fontpublic int family()
getFamily(),
scheduled for removal at 2.1.0
public float size()
getSize(),
scheduled for removal at 2.1.0
public float leading(float linespacing)
getCalculatedLeading(float),
scheduled for removal at 2.1.0
linespacing - a certain linespacing
public int style()
getStyle(),
scheduled for removal at 2.1.0
public Color color()
getColor(),
scheduled for removal at 2.1.0
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||