public class ITextFont extends Object
iText
wrapper object for font.Font
Modifier and Type | Field and Description |
---|---|
static String |
BOLD
A bold font style
|
static int |
DEFAULT_FONT_COLOR_BLUE
A default Black color definition
|
static int |
DEFAULT_FONT_COLOR_GREEN
A default Black color definition
|
static int |
DEFAULT_FONT_COLOR_RED
A default Black color definition
|
static String |
DEFAULT_FONT_NAME
A default font name
|
static float |
DEFAULT_FONT_SIZE
A default font size
|
static String |
DEFAULT_FONT_STYLE
A default font style
|
static String |
ITALIC
A italic font style
|
static String |
NORMAL
A normal font style
|
static String |
UNDERLINE
An underline font style
|
Constructor and Description |
---|
ITextFont()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addBold()
Add bold style to the current style
|
void |
addItalic()
Add italic style to the current style
|
void |
addUnderlined()
Add italic style to the current style
|
static com.lowagie.text.Font |
getFont(int style,
float size,
Color color)
Convenience method to get a defined font depending the wanted style and size.
|
String |
getFontColorBlue()
Return the font color blue
|
String |
getFontColorGreen()
Return the font color green
|
String |
getFontColorRed()
Return the font color red
|
String |
getFontName()
Return the font name
|
String |
getFontSize()
Return the font name
|
String |
getFontStyle()
Return the font style
|
static com.lowagie.text.Font |
getMonoSpacedFont(int style,
float size,
Color color)
Convenience method to get a defined MonoSpaced font depending the wanted style and size.
|
static int |
getSectionFontSize(int sectionNumber)
Get a section font size depending the section number.
|
void |
removeBold()
Remove bold style to the current style
|
void |
removeItalic()
Remove italic style to the current style
|
void |
removeUnderlined()
Remove italic style to the current style
|
void |
setColor(Color color)
Set a new font color
|
void |
setMonoSpaced(boolean monoSpaced)
Add monospaced style to the current style
|
void |
setSize(float size)
Set a new font color
|
public static final String NORMAL
public static final String BOLD
public static final String ITALIC
public static final String UNDERLINE
public static final String DEFAULT_FONT_NAME
public static final float DEFAULT_FONT_SIZE
public static final String DEFAULT_FONT_STYLE
public static final int DEFAULT_FONT_COLOR_RED
public static final int DEFAULT_FONT_COLOR_GREEN
public static final int DEFAULT_FONT_COLOR_BLUE
public ITextFont()
public void addBold()
public void removeBold()
public void addItalic()
public void removeItalic()
public void addUnderlined()
public void removeUnderlined()
public void setMonoSpaced(boolean monoSpaced)
monoSpaced
- true for monospaced stylepublic void setSize(float size)
size
- a new sizepublic String getFontName()
public String getFontStyle()
public String getFontSize()
public String getFontColorBlue()
public String getFontColorGreen()
public String getFontColorRed()
public static int getSectionFontSize(int sectionNumber)
sectionNumber
- a section numberpublic static com.lowagie.text.Font getMonoSpacedFont(int style, float size, Color color)
style
- the font style.size
- the font size.color
- the font color.Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.