|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WFontMetrics
public class WFontMetrics
A value class that describes font metrics for a font.
This class provides font metrics for a given font. It is returned by an
implementation of WPaintDevice#getFontMetrics(), and may differ between devices.
All methods return pixel dimensions.
WPaintDevice| Constructor Summary | |
|---|---|
WFontMetrics(WFont font,
double leading,
double ascent,
double descent)
Creates a font metrics information object. |
|
| Method Summary | |
|---|---|
double |
getAscent()
Returns the font ascent length. |
double |
getDescent()
Returns the font descent length. |
WFont |
getFont()
Returns the font for which these font metrics were computed. |
double |
getHeight()
Returns the font height. |
double |
getLeading()
Returns the font leading length. |
double |
getSize()
Returns the font size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WFontMetrics(WFont font,
double leading,
double ascent,
double descent)
| Method Detail |
|---|
public WFont getFont()
public double getSize()
This is the same as:
font().size().sizeLength()
e.g.~for a font with size set to 16px, this returns 16.
public double getHeight()
The font height is the total height of a text line. It is usually a bit bigger than the font size to have natural line spacing.
public double getLeading()
This is vertical space provided on top of the ascent (empty space which serves as natural line spacing).
public double getAscent()
This is vertical space which corresponds to the maximum height of a character over the baseline (although many fonts violate this for some glyphs).
public double getDescent()
This is vertical space which corresponds to the maximum height of a character under the baseline (although many fonts violate this for some glyphs).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||