T
- The image pixel typepublic class GeneralFontRenderer<T> extends FontRenderer<T,GeneralFontStyle<T>>
Constructor and Description |
---|
GeneralFontRenderer() |
Modifier and Type | Method and Description |
---|---|
static <T> Polygon[] |
getPolygons(char[] characters,
int x,
int y,
GeneralFontStyle<T> style)
Returns a list of polygons that represent the letters in the given text.
|
static <T> Polygon[] |
getPolygons(String text,
int x,
int y,
GeneralFontStyle<T> style)
Returns a list of polygons that represent the letters in the given text.
|
Rectangle |
getSize(String string,
GeneralFontStyle<T> style)
Calculate the bounding box of the rendered text with the given style.
|
static void |
main(String[] args)
Just for testing render quality against AWT
|
void |
renderText(ImageRenderer<T,?> renderer,
String text,
int x,
int y,
GeneralFontStyle<T> style)
Render the given text string to the image starting at (x, y) with the
given style.
|
getBounds, getBounds, renderText
public GeneralFontRenderer()
public void renderText(ImageRenderer<T,?> renderer, String text, int x, int y, GeneralFontStyle<T> style)
renderText
in class FontRenderer<T,GeneralFontStyle<T>>
renderer
- the renderertext
- the textx
- the x-ordinatey
- the y-ordinatestyle
- the styleFontRenderer.renderText(org.openimaj.image.renderer.ImageRenderer,
java.lang.String, int, int, org.openimaj.image.typography.FontStyle)
public static <T> Polygon[] getPolygons(String text, int x, int y, GeneralFontStyle<T> style)
text
- The text to render as a polygonx
- The x-coordinatey
- The y-coordinatestyle
- The font's stylepublic static <T> Polygon[] getPolygons(char[] characters, int x, int y, GeneralFontStyle<T> style)
characters
- The text to render as a polygonx
- The x-coordinatey
- The y-coordinatestyle
- The font's stylepublic Rectangle getSize(String string, GeneralFontStyle<T> style)
getSize
in class FontRenderer<T,GeneralFontStyle<T>>
string
- the textstyle
- the styleFontRenderer.getSize(java.lang.String,
org.openimaj.image.typography.FontStyle)