|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.fop.render.awt.AWTFontMetrics
This is a FontMetrics to be used for AWT rendering. It instanciates a font, depening on famil and style values. The java.awt.FontMetrics for this font is then created to be used for the actual measurement. Since layout is word by word and since it is expected that two subsequent words often share the same style, the Font and FontMetrics is buffered and only changed if needed.
Since FontState and FontInfo multiply all factors by size, we assume a "standard" font of FONT_SIZE.
Field Summary | |
static int |
FONT_FACTOR
This factor multiplies the calculated values to scale to FOP internal measurements |
static int |
FONT_SIZE
Font size standard used for metric measurements |
Constructor Summary | |
AWTFontMetrics(java.awt.Graphics2D graphics)
Constructs a new Font-metrics. |
Method Summary | |
java.awt.Font |
createFont(java.lang.String family,
int style,
int size)
create Font to draw. |
int |
getAscender(java.lang.String family,
int style,
int size)
Determines the font ascent of the Font described by this FontMetrics object |
int |
getCapHeight(java.lang.String family,
int style,
int size)
The size of a capital letter measured from the font's baseline |
int |
getDescender(java.lang.String family,
int style,
int size)
Determines the font descent of the Font described by this FontMetrics object |
java.awt.Font |
getFont(java.lang.String family,
int style,
int size)
Returns a java.awt.Font instance for the desired family, style and size type. |
int[] |
getWidths(java.lang.String family,
int style,
int size)
Return widths (in 1/1000ths of point size) of all characters |
int |
getXHeight(java.lang.String family,
int style,
int size)
Determines the typical font height of a small cap letter FontMetrics object |
void |
setEmbedFont(java.lang.String family,
int style,
java.net.URL fontURL)
set embed font. |
int |
width(int i,
java.lang.String family,
int style,
int size)
Returns width (in 1/1000ths of point size) of character at code point i |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FONT_SIZE
public static final int FONT_FACTOR
Constructor Detail |
public AWTFontMetrics(java.awt.Graphics2D graphics)
parent
- an temp graphics object - this is needed so
that we can get an instance of
java.awt.FontMetricsMethod Detail |
public int getAscender(java.lang.String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usepublic int getCapHeight(java.lang.String family, int style, int size)
public int getDescender(java.lang.String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usepublic int getXHeight(java.lang.String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usepublic int width(int i, java.lang.String family, int style, int size)
i
- the character for which to get the widthfamily
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- the of the fontpublic int[] getWidths(java.lang.String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usepublic void setEmbedFont(java.lang.String family, int style, java.net.URL fontURL)
family
- font-family namestyle
- font stylefontURL
- URL to physical fontpublic java.awt.Font createFont(java.lang.String family, int style, int size)
family
- font-family namestyle
- font stylesize
- font sizepublic java.awt.Font getFont(java.lang.String family, int style, int size)
family
- font family (jave name) to usestyle
- font style (jave def.) to usesize
- font size
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |