public class FontMetrics
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private float |
ascent
The distance from the baseline to the avg max character height.
|
private int |
baseline
The baseline is the imaginary line upon which letters without descenders
(for example, the lowercase letter "a") sits.
|
private float |
descent
The distance from the baseline down to the lowest avg.
|
private Font |
font
The font that was used to construct these metrics.
|
private float |
leading
The amount of space between lines of text in this font.
|
private float |
lineHeight
The maximum line height for a line of text in this font
|
private float |
maxAscent
The distance from the baseline to the max character height.
|
private float |
maxDescent
The distance from the baseline down to the absolute lowest descender.
|
private float |
xheight
The distance from the baseline to the top of the avg.
|
Constructor and Description |
---|
FontMetrics(float maxAscent,
float ascent,
float xheight,
float descent,
float maxDescent,
float leading,
Font font) |
Modifier and Type | Method and Description |
---|---|
float |
computeStringWidth(java.lang.String string)
Computes the width of the String when rendered with the font represented
by this FontMetrics instance.
|
float |
getAscent() |
int |
getBaseline() |
float |
getDescent() |
Font |
getFont() |
float |
getLeading() |
float |
getLineHeight() |
float |
getMaxAscent() |
float |
getMaxDescent() |
float |
getXheight() |
static FontMetrics |
impl_createFontMetrics(float maxAscent,
float ascent,
float xheight,
float descent,
float maxDescent,
float leading,
Font font) |
java.lang.String |
toString() |
private float maxAscent
private float ascent
private float xheight
private int baseline
private float descent
private float maxDescent
private float leading
private float lineHeight
private Font font
public FontMetrics(float maxAscent, float ascent, float xheight, float descent, float maxDescent, float leading, Font font)
public static FontMetrics impl_createFontMetrics(float maxAscent, float ascent, float xheight, float descent, float maxDescent, float leading, Font font)
public final float getMaxAscent()
public final float getAscent()
public final float getXheight()
public final int getBaseline()
public final float getDescent()
public final float getMaxDescent()
public final float getLeading()
public final float getLineHeight()
public final Font getFont()
public float computeStringWidth(java.lang.String string)
public java.lang.String toString()
toString
in class java.lang.Object