org.writersforge.catalan.layout.style
Interface FontStyle

All Known Subinterfaces:
AllStyle
All Known Implementing Classes:
DatumStyleWrapper, DefaultStyle, FontStyleMetrics, StyleChain

public interface FontStyle

The font style for a span of text. Does not include spacing or alignment info, only simple font info. All values in this style can be accessed through the generic methods in RenderStyle, but convenience methods make this access cleaner and more type-safe.

Note: This interface echos some important methods from java.awt.FontMetrics and helps insulate the rendering system from the platform dependencies of the Java font implementation, in particular its reliance on obtaining a graphics context for all font metrics.

Author:
jsheets

Field Summary
static int FONT_STYLE_BOLD
          Enumeration value for specifying bold font style
static int FONT_STYLE_ITALIC
          Enumeration value for specifying italic font style
static int FONT_STYLE_PLAIN
          Enumeration value for specifying plain font style
static java.lang.String[] STYLE_ENUM
          Enumeration of font styles; uses constants from Style
 
Method Summary
 java.awt.Color getFontColor()
          Returns the color of this run of text.
 int getFontHeight()
          Estimates the height of the font in point size.
 java.lang.String getFontName()
          Returns the font name property of the style.
 int getFontSize()
          Returns the font size property of the style.
 int getFontStyle()
          Returns the font style property of the style.
 

Field Detail

FONT_STYLE_PLAIN

public static final int FONT_STYLE_PLAIN
Enumeration value for specifying plain font style

See Also:
Constant Field Values

FONT_STYLE_BOLD

public static final int FONT_STYLE_BOLD
Enumeration value for specifying bold font style

See Also:
Constant Field Values

FONT_STYLE_ITALIC

public static final int FONT_STYLE_ITALIC
Enumeration value for specifying italic font style

See Also:
Constant Field Values

STYLE_ENUM

public static final java.lang.String[] STYLE_ENUM
Enumeration of font styles; uses constants from Style

Method Detail

getFontName

public java.lang.String getFontName()
Returns the font name property of the style.

Returns:
the font name for this style

getFontStyle

public int getFontStyle()
Returns the font style property of the style.

Returns:
the font style for this style

getFontSize

public int getFontSize()
Returns the font size property of the style.

Returns:
the font size (in points) for this style

getFontHeight

public int getFontHeight()
Estimates the height of the font in point size. Not a true measure of the font height, but can be used for rough estimates.

Returns:
the height of the font in point size

getFontColor

public java.awt.Color getFontColor()
Returns the color of this run of text.

Returns:
the text color