org.odftoolkit.simple.style
Class Font

java.lang.Object
  extended by org.odftoolkit.simple.style.Font

public class Font
extends Object

This class represents the font style settings, including font family name, font style, size, front color.

Since:
0.3

Constructor Summary
Font(String fontFamilyName, StyleTypeDefinitions.FontStyle simpleFontStyle, double fontSize)
          Create a font with specific family name, font style, and size.
Font(String fontFamilyName, StyleTypeDefinitions.FontStyle simpleFontStyle, double fontSize, Color color)
          Create a font with specific family name, style, size, and front color.
Font(String fontFamilyName, StyleTypeDefinitions.FontStyle simpleFontStyle, double fontSize, Color color, Locale language)
          Create a font with specific family name, style, size, and color for a specific character.
Font(String fontFamilyName, StyleTypeDefinitions.FontStyle simpleFontStyle, double fontSize, Color color, StyleTypeDefinitions.TextLinePosition textLinePosition)
          Create a font with specific family name, style, size, front color and line position
Font(String fontFamilyName, StyleTypeDefinitions.FontStyle simpleFontStyle, double fontSize, Color color, StyleTypeDefinitions.TextLinePosition textLinePosition, Locale language)
          Create a font with specific family name, style, size, color, and line position for a specific character.
Font(String fontFamilyName, StyleTypeDefinitions.FontStyle simpleFontStyle, double fontSize, Locale language)
          Create a font with specific family name, style, size for a specific character.
Font(String fontFamilyName, StyleTypeDefinitions.FontStyle simpleFontStyle, double fontSize, StyleTypeDefinitions.TextLinePosition textLinePosition)
          Create a font with specific family name, font style, size and line position.
 
Method Summary
 boolean equals(Object o)
           
 Color getColor()
          Return the font color
 String getFamilyName()
          Return the font family
protected  String getFontName()
          Return the font name
 StyleTypeDefinitions.FontStyle getFontStyle()
          Get the font style
 double getSize()
          Return the font size in measurement point(PT).
 StyleTypeDefinitions.TextLinePosition getTextLinePosition()
          Get the font text line position
 void setColor(Color color)
          Set the font color
 void setFamilyName(String familyName)
          Set the font family.
protected  void setFontName(String fontName)
          Set the font name
 void setFontStyle(StyleTypeDefinitions.FontStyle simpleFontStyle)
          Set the font style
 void setSize(double size)
          Set the font size.
 void setTextLinePosition(StyleTypeDefinitions.TextLinePosition textLinePosition)
          Set the font text line position
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Font

public Font(String fontFamilyName,
            StyleTypeDefinitions.FontStyle simpleFontStyle,
            double fontSize)
Create a font with specific family name, font style, and size.

Parameters:
fontFamilyName - - the family name
simpleFontStyle - - the font style
fontSize - - the size

Font

public Font(String fontFamilyName,
            StyleTypeDefinitions.FontStyle simpleFontStyle,
            double fontSize,
            StyleTypeDefinitions.TextLinePosition textLinePosition)
Create a font with specific family name, font style, size and line position.

Parameters:
fontFamilyName - - the family name
simpleFontStyle - - the font style
fontSize - - the size
textLinePosition - - the line position

Font

public Font(String fontFamilyName,
            StyleTypeDefinitions.FontStyle simpleFontStyle,
            double fontSize,
            Color color)
Create a font with specific family name, style, size, and front color.

Parameters:
fontFamilyName - - the family name
simpleFontStyle - - the font style
fontSize - - the size
color - - the front color

Font

public Font(String fontFamilyName,
            StyleTypeDefinitions.FontStyle simpleFontStyle,
            double fontSize,
            Color color,
            StyleTypeDefinitions.TextLinePosition textLinePosition)
Create a font with specific family name, style, size, front color and line position

Parameters:
fontFamilyName - - the family name
simpleFontStyle - - the font style
fontSize - - the size
color - - the front color
textLinePosition - - the line position

Font

public Font(String fontFamilyName,
            StyleTypeDefinitions.FontStyle simpleFontStyle,
            double fontSize,
            Locale language)
Create a font with specific family name, style, size for a specific character. For example, a font style setting for English character.

Parameters:
fontFamilyName - - the family name
simpleFontStyle - - the font style
fontSize - - the font size
language - - the character information

Font

public Font(String fontFamilyName,
            StyleTypeDefinitions.FontStyle simpleFontStyle,
            double fontSize,
            Color color,
            Locale language)
Create a font with specific family name, style, size, and color for a specific character. For example, a font style setting for English character.

Parameters:
fontFamilyName - - the family name
simpleFontStyle - - the font style
fontSize - - the size
color - - the front color
language - - the character information

Font

public Font(String fontFamilyName,
            StyleTypeDefinitions.FontStyle simpleFontStyle,
            double fontSize,
            Color color,
            StyleTypeDefinitions.TextLinePosition textLinePosition,
            Locale language)
Create a font with specific family name, style, size, color, and line position for a specific character. For example, a font style setting for English character.

Parameters:
fontFamilyName - - the family name
simpleFontStyle - - the font style
fontSize - - the size
color - - the front color
textLinePosition - - the line position
language - - the character information
Method Detail

getFamilyName

public String getFamilyName()
Return the font family

Returns:
the font family

setFamilyName

public void setFamilyName(String familyName)
Set the font family.

Font family name is what you get from the font list in ODF editors.

Parameters:
familyName - - the font family name

getFontName

protected String getFontName()
Return the font name

Note the font name might be different from font family name. A font family may have different font name definitions.

Returns:
the font name

setFontName

protected void setFontName(String fontName)
Set the font name

Note the font name might be different from font family name. A font family may have different font name definitions.

Parameters:
fontName - - the font name

getFontStyle

public StyleTypeDefinitions.FontStyle getFontStyle()
Get the font style

Returns:
the font style

setFontStyle

public void setFontStyle(StyleTypeDefinitions.FontStyle simpleFontStyle)
Set the font style

Parameters:
simpleFontStyle - - the font style

getTextLinePosition

public StyleTypeDefinitions.TextLinePosition getTextLinePosition()
Get the font text line position

Returns:
the font text line position

setTextLinePosition

public void setTextLinePosition(StyleTypeDefinitions.TextLinePosition textLinePosition)
Set the font text line position

Parameters:
textLinePosition - - the font text line position

getSize

public double getSize()
Return the font size in measurement point(PT).

Returns:
- the font size in measurement point(PT)

setSize

public void setSize(double size)
Set the font size. The font size is in measurement point(PT).

Parameters:
size - - the font size

getColor

public Color getColor()
Return the font color

Returns:
the font color

setColor

public void setColor(Color color)
Set the font color

Parameters:
color - - the font color

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.