org.apache.maven.doxia.module.itext
Class ITextFont

java.lang.Object
  extended by org.apache.maven.doxia.module.itext.ITextFont

public class ITextFont
extends Object

iText wrapper object for font.

Version:
$Id: ITextFont.java 763762 2009-04-09 18:19:56Z ltheussl $
Author:
Vincent Siveton
See Also:
Font

Field Summary
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 Summary
ITextFont()
          Default constructor
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL

public static final String NORMAL
A normal font style

See Also:
Constant Field Values

BOLD

public static final String BOLD
A bold font style

See Also:
Constant Field Values

ITALIC

public static final String ITALIC
A italic font style

See Also:
Constant Field Values

UNDERLINE

public static final String UNDERLINE
An underline font style

See Also:
Constant Field Values

DEFAULT_FONT_NAME

public static final 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 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

Constructor Detail

ITextFont

public ITextFont()
Default constructor

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(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 String getFontName()
Return the font name

Returns:
the font name

getFontStyle

public String getFontStyle()
Return the font style

Returns:
the font style

getFontSize

public String getFontSize()
Return the font name

Returns:
the font name

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

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,
                                                      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,
                                            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.


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.