Class ITextFont
- java.lang.Object
-
- org.apache.maven.doxia.module.itext.ITextFont
-
public class ITextFont extends java.lang.Object
iText
wrapper object for font.- Version:
- $Id: ITextFont.java 1438269 2013-01-24 23:47:50Z olamy $
- Author:
- Vincent Siveton
- See Also:
Font
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BOLD
A bold font stylestatic int
DEFAULT_FONT_COLOR_BLUE
A default Black color definitionstatic int
DEFAULT_FONT_COLOR_GREEN
A default Black color definitionstatic int
DEFAULT_FONT_COLOR_RED
A default Black color definitionstatic java.lang.String
DEFAULT_FONT_NAME
A default font namestatic float
DEFAULT_FONT_SIZE
A default font sizestatic java.lang.String
DEFAULT_FONT_STYLE
A default font stylestatic java.lang.String
ITALIC
A italic font stylestatic java.lang.String
NORMAL
A normal font stylestatic java.lang.String
UNDERLINE
An underline font style
-
Constructor Summary
Constructors Constructor Description ITextFont()
Default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBold()
Add bold style to the current stylevoid
addItalic()
Add italic style to the current stylevoid
addUnderlined()
Add italic style to the current stylestatic com.lowagie.text.Font
getFont(int style, float size, java.awt.Color color)
Convenience method to get a defined font depending the wanted style and size.java.lang.String
getFontColorBlue()
Return the font color bluejava.lang.String
getFontColorGreen()
Return the font color greenjava.lang.String
getFontColorRed()
Return the font color redjava.lang.String
getFontName()
Return the font namejava.lang.String
getFontSize()
Return the font namejava.lang.String
getFontStyle()
Return the font stylestatic com.lowagie.text.Font
getMonoSpacedFont(int style, float size, java.awt.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 stylevoid
removeItalic()
Remove italic style to the current stylevoid
removeUnderlined()
Remove italic style to the current stylevoid
setColor(java.awt.Color color)
Set a new font colorvoid
setMonoSpaced(boolean monoSpaced)
Add monospaced style to the current stylevoid
setSize(float size)
Set a new font color
-
-
-
Field Detail
-
NORMAL
public static final java.lang.String NORMAL
A normal font style- See Also:
- Constant Field Values
-
BOLD
public static final java.lang.String BOLD
A bold font style- See Also:
- Constant Field Values
-
ITALIC
public static final java.lang.String ITALIC
A italic font style- See Also:
- Constant Field Values
-
UNDERLINE
public static final java.lang.String UNDERLINE
An underline font style- See Also:
- Constant Field Values
-
DEFAULT_FONT_NAME
public static final java.lang.String DEFAULT_FONT_NAME
A default font name- See Also:
- Constant Field Values
-
DEFAULT_FONT_SIZE
public static final float DEFAULT_FONT_SIZE
A default font size- See Also:
- Constant Field Values
-
DEFAULT_FONT_STYLE
public static final java.lang.String DEFAULT_FONT_STYLE
A default font style- See Also:
- Constant Field Values
-
DEFAULT_FONT_COLOR_RED
public static final int DEFAULT_FONT_COLOR_RED
A default Black color definition
-
DEFAULT_FONT_COLOR_GREEN
public static final int DEFAULT_FONT_COLOR_GREEN
A default Black color definition
-
DEFAULT_FONT_COLOR_BLUE
public static final int DEFAULT_FONT_COLOR_BLUE
A default Black color definition
-
-
Method Detail
-
addBold
public void addBold()
Add bold style to the current style
-
removeBold
public void removeBold()
Remove bold style to the current style
-
addItalic
public void addItalic()
Add italic style to the current style
-
removeItalic
public void removeItalic()
Remove italic style to the current style
-
addUnderlined
public void addUnderlined()
Add italic style to the current style
-
removeUnderlined
public void removeUnderlined()
Remove italic style to the current style
-
setMonoSpaced
public void setMonoSpaced(boolean monoSpaced)
Add monospaced style to the current style- Parameters:
monoSpaced
- true for monospaced style
-
setColor
public void setColor(java.awt.Color color)
Set a new font color- Parameters:
color
- a new color
-
setSize
public void setSize(float size)
Set a new font color- Parameters:
size
- a new size
-
getFontName
public java.lang.String getFontName()
Return the font name- Returns:
- the font name
-
getFontStyle
public java.lang.String getFontStyle()
Return the font style- Returns:
- the font style
-
getFontSize
public java.lang.String getFontSize()
Return the font name- Returns:
- the font name
-
getFontColorBlue
public java.lang.String getFontColorBlue()
Return the font color blue- Returns:
- the font color blue
-
getFontColorGreen
public java.lang.String getFontColorGreen()
Return the font color green- Returns:
- the font color green
-
getFontColorRed
public java.lang.String getFontColorRed()
Return the font color red- Returns:
- the font color red
-
getSectionFontSize
public static int getSectionFontSize(int sectionNumber)
Get a section font size depending the section number.- 0
- Chapter: font size = 24
- 1
- Section 1: font size = 22
- 2
- Section 2: font size = 20
- 3
- Section 3: font size = 18
- 4
- Section 4: font size = 16
- 5 ot otherwise
- Section 5: font size = 14
- Parameters:
sectionNumber
- a section number- Returns:
- a font size.
-
getMonoSpacedFont
public static com.lowagie.text.Font getMonoSpacedFont(int style, float size, java.awt.Color color)
Convenience method to get a defined MonoSpaced font depending the wanted style and size.- Parameters:
style
- the font style.size
- the font size.color
- the font color.- Returns:
- a font the font.
-
getFont
public static com.lowagie.text.Font getFont(int style, float size, java.awt.Color color)
Convenience method to get a defined font depending the wanted style and size.- Parameters:
style
- the font style.size
- the font size.color
- the font color.- Returns:
- a font the font.
-
-