org.apache.maven.doxia.module.itext

Class ITextFont

public class ITextFont extends Object

iText wrapper object for font.

Version: $Id: ITextFont.java 496703 2007-01-16 14:27:31Z vsiveton $

Author: Vincent Siveton

See Also: com.lowagie.text.Font

Field Summary
static StringBOLD
A bold font style
static intDEFAULT_FONT_COLOR_BLUE
A default Black color definition
static intDEFAULT_FONT_COLOR_GREEN
A default Black color definition
static intDEFAULT_FONT_COLOR_RED
A default Black color definition
static StringDEFAULT_FONT_NAME
A default font name
static floatDEFAULT_FONT_SIZE
A default font size
static StringDEFAULT_FONT_STYLE
A default font style
static StringITALIC
A italic font style
static StringNORMAL
A normal font style
static StringUNDERLINE
An underline font style
Constructor Summary
ITextFont()
Default constructor
Method Summary
voidaddBold()
Add bold style to the current style
voidaddItalic()
Add italic style to the current style
voidaddUnderlined()
Add italic style to the current style
static FontgetFont(int style, float size, Color color)
Convenience method to get a defined font depending the wanted style and size.
StringgetFontColorBlue()
Return the font color blue
StringgetFontColorGreen()
Return the font color green
StringgetFontColorRed()
Return the font color red
StringgetFontName()
Return the font name
StringgetFontSize()
Return the font name
StringgetFontStyle()
Return the font style
static FontgetMonoSpacedFont(int style, float size, Color color)
Convenience method to get a defined MonoSpaced font depending the wanted style and size.
static intgetSectionFontSize(int sectionNumber)
Get a section font depending the section number.
voidremoveBold()
Remove bold style to the current style
voidremoveItalic()
Remove italic style to the current style
voidremoveUnderlined()
Remove italic style to the current style
voidsetColor(Color color)
Set a new font color
voidsetMonoSpaced(boolean monoSpaced)
Add monospaced style to the current style
voidsetSize(float size)
Set a new font color

Field Detail

BOLD

public static final String BOLD
A bold font style

DEFAULT_FONT_COLOR_BLUE

public static final int DEFAULT_FONT_COLOR_BLUE
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_RED

public static final int DEFAULT_FONT_COLOR_RED
A default Black color definition

DEFAULT_FONT_NAME

public static final String DEFAULT_FONT_NAME
A default font name

DEFAULT_FONT_SIZE

public static final float DEFAULT_FONT_SIZE
A default font size

DEFAULT_FONT_STYLE

public static final String DEFAULT_FONT_STYLE
A default font style

ITALIC

public static final String ITALIC
A italic font style

NORMAL

public static final String NORMAL
A normal font style

UNDERLINE

public static final String UNDERLINE
An underline font style

Constructor Detail

ITextFont

public ITextFont()
Default constructor

Method Detail

addBold

public void addBold()
Add bold style to the current style

addItalic

public void addItalic()
Add italic style to the current style

addUnderlined

public void addUnderlined()
Add italic style to the current style

getFont

public static Font getFont(int style, float size, Color color)
Convenience method to get a defined font depending the wanted style and size.

Parameters: style size color

Returns: a font

getFontColorBlue

public String getFontColorBlue()
Return the font color blue

Returns: the font color blue

getFontColorGreen

public String getFontColorGreen()
Return the font color green

Returns: the font color green

getFontColorRed

public String getFontColorRed()
Return the font color red

Returns: the font color red

getFontName

public String getFontName()
Return the font name

Returns: the font name

getFontSize

public String getFontSize()
Return the font name

Returns: the font name

getFontStyle

public String getFontStyle()
Return the font style

Returns: the font style

getMonoSpacedFont

public static Font getMonoSpacedFont(int style, float size, Color color)
Convenience method to get a defined MonoSpaced font depending the wanted style and size.

Parameters: style size color

Returns: a font

getSectionFontSize

public static int getSectionFontSize(int sectionNumber)
Get a section font 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

removeBold

public void removeBold()
Remove bold style to the current style

removeItalic

public void removeItalic()
Remove italic style to the current style

removeUnderlined

public void removeUnderlined()
Remove italic style to the current style

setColor

public void setColor(Color color)
Set a new font color

Parameters: color a new color

setMonoSpaced

public void setMonoSpaced(boolean monoSpaced)
Add monospaced style to the current style

Parameters: monoSpaced true for monospaced style

setSize

public void setSize(float size)
Set a new font color

Parameters: size a new size

Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.