Interface RasterFont
- All Known Implementing Classes:
TrueTypeFont
public interface RasterFont
The seam through which RasterGraphics.drawString(String, double, double)
draws text: a font turns a string into an outline, and the graphics fills
it like any other path.
TrueTypeFont is the implementation that ships: TrueType fonts read from
bytes, with an embedded default. Another font engine plugs in here
without any change to the graphics.
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the distance from the top of the line to the baseline.doubleReturns the distance from the baseline to the bottom of the line.getOutline(String text, double x, double y) Returns the outline oftextwith its baseline starting at(x, y).doublestringWidth(String text) Returns the advance width oftext.
-
Method Details
-
getOutline
Returns the outline of
textwith its baseline starting at(x, y).Parameters
text: the string to lay outx: left end of the baseliney: the baseline
Returns
the glyph outlines, filled with the non-zero rule
-
stringWidth
Returns the advance width of
text.Parameters
text: the string
Returns
the width in user-space units
-
getAscent
double getAscent()Returns the distance from the top of the line to the baseline.
Returns
the ascent in user-space units
-
getDescent
double getDescent()Returns the distance from the baseline to the bottom of the line.
Returns
the descent in user-space units
-