Class ITextFont
- java.lang.Object
-
- org.apache.maven.doxia.module.itext.ITextFont
-
public class ITextFont extends java.lang.ObjectiTextwrapper 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.StringBOLDA bold font stylestatic intDEFAULT_FONT_COLOR_BLUEA default Black color definitionstatic intDEFAULT_FONT_COLOR_GREENA default Black color definitionstatic intDEFAULT_FONT_COLOR_REDA default Black color definitionstatic java.lang.StringDEFAULT_FONT_NAMEA default font namestatic floatDEFAULT_FONT_SIZEA default font sizestatic java.lang.StringDEFAULT_FONT_STYLEA default font stylestatic java.lang.StringITALICA italic font stylestatic java.lang.StringNORMALA normal font stylestatic java.lang.StringUNDERLINEAn 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 voidaddBold()Add bold style to the current stylevoidaddItalic()Add italic style to the current stylevoidaddUnderlined()Add italic style to the current stylestatic com.lowagie.text.FontgetFont(int style, float size, java.awt.Color color)Convenience method to get a defined font depending the wanted style and size.java.lang.StringgetFontColorBlue()Return the font color bluejava.lang.StringgetFontColorGreen()Return the font color greenjava.lang.StringgetFontColorRed()Return the font color redjava.lang.StringgetFontName()Return the font namejava.lang.StringgetFontSize()Return the font namejava.lang.StringgetFontStyle()Return the font stylestatic com.lowagie.text.FontgetMonoSpacedFont(int style, float size, java.awt.Color color)Convenience method to get a defined MonoSpaced font depending the wanted style and size.static intgetSectionFontSize(int sectionNumber)Get a section font size depending the section number.voidremoveBold()Remove bold style to the current stylevoidremoveItalic()Remove italic style to the current stylevoidremoveUnderlined()Remove italic style to the current stylevoidsetColor(java.awt.Color color)Set a new font colorvoidsetMonoSpaced(boolean monoSpaced)Add monospaced style to the current stylevoidsetSize(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.
-
-