|
fop 0.93 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.fonts.Font
This class holds font state information and provides access to the font metrics.
Field Summary | |
static int |
BOLD
Bold font weight |
static FontTriplet |
DEFAULT_FONT
Default fallback key |
static int |
NORMAL
Normal font weight |
Constructor Summary | |
Font(java.lang.String key,
FontTriplet triplet,
FontMetrics met,
int fontSize)
Main constructor |
Method Summary | |
int |
getAscender()
Returns the font's ascender. |
int |
getCapHeight()
Returns the font's CapHeight. |
int |
getCharWidth(char c)
Helper method for getting the width of a unicode char from the current fontstate. |
int |
getDescender()
Returns the font's Descender. |
java.lang.String |
getFontName()
Returns the font's name. |
int |
getFontSize()
Returns the font size |
FontTriplet |
getFontTriplet()
|
java.util.Map |
getKerning()
Returns the font's kerning table |
int |
getKernValue(char ch1,
char ch2)
Returns the amount of kerning between two characters. |
int |
getWidth(int charnum)
Returns the width of a character |
int |
getWordWidth(java.lang.String word)
Calculates the word width. |
int |
getXHeight()
Returns the XHeight |
boolean |
hasChar(char c)
Determines whether this font contains a particular character/glyph. |
boolean |
hasKerning()
|
char |
mapChar(char c)
Map a java character (unicode) to a font character. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final FontTriplet DEFAULT_FONT
public static final int NORMAL
public static final int BOLD
Constructor Detail |
public Font(java.lang.String key, FontTriplet triplet, FontMetrics met, int fontSize)
key
- key of the fonttriplet
- the font triplet that was used to lookup this font (may be null)met
- font metricsfontSize
- font sizeMethod Detail |
public int getAscender()
public int getCapHeight()
public int getDescender()
public java.lang.String getFontName()
public FontTriplet getFontTriplet()
public int getFontSize()
public int getXHeight()
public boolean hasKerning()
public java.util.Map getKerning()
public int getKernValue(char ch1, char ch2)
ch1
- first characterch2
- second character
public int getWidth(int charnum)
charnum
- character to look up
public char mapChar(char c)
c
- character to map
public boolean hasChar(char c)
c
- character to check
public java.lang.String toString()
Object.toString()
public int getCharWidth(char c)
c
- character to inspect
public int getWordWidth(java.lang.String word)
word
- text to get width for
|
fop 0.93 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |