|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.layout.style.FontStyleMetrics
Wrapper class to calculate font metrics based on a FontStyle object. Echoes the critical methods from FontMetrics.
| Field Summary | |
static double |
FIXED_CHAR_MULT
Default multiplier for converting font point size into character width. |
| Fields inherited from interface org.writersforge.catalan.layout.style.FontStyle |
FONT_STYLE_BOLD, FONT_STYLE_ITALIC, FONT_STYLE_PLAIN, STYLE_ENUM |
| Constructor Summary | |
FontStyleMetrics(FontStyle fontStyle)
Creates a new instance of FontStyleMetrics from the FontStyle. |
|
FontStyleMetrics(java.lang.String fontName,
int fontStyle,
int fontSize)
Creates a new instance of FontStyleMetrics with the explicit font parameters and a calculated font height. |
|
FontStyleMetrics(java.lang.String fontName,
int fontStyle,
int fontSize,
int fontHeight)
Creates a new instance of FontStyleMetrics with the explicit font parameters. |
|
| Method Summary | |
int |
charWidth(char ch)
Estimates the width of the given character in this style. |
int |
getAscent()
Returns the ascent for this font. |
int |
getDescent()
Returns the descent for this font. |
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()
Getter for property name, the name of the font. |
int |
getFontSize()
Getter for property size, the point size of the font. |
int |
getFontStyle()
Getter for property style: plain, bold, or italic. |
int |
getLeading()
Returns the leading for this font. |
int |
stringWidth(java.lang.String str)
Estimates the width of the given string if rendered in this style. |
java.lang.String |
toString()
Returns this object as a String |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final double FIXED_CHAR_MULT
| Constructor Detail |
public FontStyleMetrics(FontStyle fontStyle)
fontStyle - FontStyle to wrap
public FontStyleMetrics(java.lang.String fontName,
int fontStyle,
int fontSize)
fontName - the name of the fontfontStyle - the plain/italic/bold style of the fontfontSize - the point size of the font
public FontStyleMetrics(java.lang.String fontName,
int fontStyle,
int fontSize,
int fontHeight)
fontName - the name of the fontfontStyle - the plain/italic/bold style of the fontfontSize - the point size of the fontfontHeight - the height of the font in points| Method Detail |
public java.lang.String getFontName()
getFontName in interface FontStylepublic int getFontStyle()
getFontStyle in interface FontStylepublic int getFontSize()
getFontSize in interface FontStylepublic int getFontHeight()
getFontHeight in interface FontStylepublic int getAscent()
public int getDescent()
public int getLeading()
public int charWidth(char ch)
ch - the character to check
public int stringWidth(java.lang.String str)
str - the String to check
public java.lang.String toString()
Object.toString()public java.awt.Color getFontColor()
getFontColor in interface FontStyle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||