T
- type of image pixelsQ
- type of FontStyle
public abstract class FontRenderer<T,Q extends FontStyle<T>> extends Object
Constructor and Description |
---|
FontRenderer() |
Modifier and Type | Method and Description |
---|---|
static <T> Rectangle |
getBounds(AttributedString text,
ImageRenderer<T,?> imageRenderer)
Calculate the bounding box of the given
AttributedString . |
Rectangle |
getBounds(String string,
int x,
int y,
Q sty)
Calculate the bounding box of the rendered text with the given style.
|
abstract Rectangle |
getSize(String string,
Q style)
Calculate the bounding box of the rendered text with the given style.
|
static <T> void |
renderText(ImageRenderer<T,?> renderer,
AttributedString text,
int x,
int y)
Render the given
AttributedString to the image starting at (x,y). |
abstract void |
renderText(ImageRenderer<T,?> renderer,
String text,
int x,
int y,
Q style)
Render the given text string to the image starting at (x, y) with the
given style.
|
public FontRenderer()
public abstract void renderText(ImageRenderer<T,?> renderer, String text, int x, int y, Q style)
renderer
- the renderertext
- the textx
- the x-ordinatey
- the y-ordinatestyle
- the stylepublic abstract Rectangle getSize(String string, Q style)
string
- the textstyle
- the stylepublic Rectangle getBounds(String string, int x, int y, Q sty)
string
- the textx
- the x to render the fonty
- the y to render the fontsty
- the stylepublic static <T> void renderText(ImageRenderer<T,?> renderer, AttributedString text, int x, int y)
AttributedString
to the image starting at (x,y).T
- the pixel type of the imagerenderer
- the image renderertext
- the textx
- the x-ordinatey
- the y-ordinatepublic static <T> Rectangle getBounds(AttributedString text, ImageRenderer<T,?> imageRenderer)
AttributedString
. The image
will not be modified by this call, but is used to properly configure the styles
for bounds estimation.T
- the pixel typetext
- the textimageRenderer
- the target image renderer