RenderingUtils
Inheritance: java.lang.Object
public class RenderingUtils
Provides utility methods for rendering.
Methods
Method | Description |
---|---|
drawText(Font font, String text, double fontSize) | Rendering text in BitMap. |
drawText(Font font, String text, double fontSize, RenderingUtils.LineSpacingType lineSpacingType, int lineSpacingValue, int maxWidth) | Rendering text in BitMap. |
drawText(Font font, GlyphId[] glyphIds, double fontSize) | Rendering text in BitMap. |
drawText(Font font, GlyphId[] glyphIds, double fontSize, RenderingUtils.LineSpacingType lineSpacingType, int lineSpacingValue, int maxWidth) | Rendering text in BitMap. |
drawText(Font font, String text, double fontSize)
public static InputStream drawText(Font font, String text, double fontSize)
Rendering text in BitMap.
Parameters:
Parameter | Type | Description |
---|---|---|
font | Font | The font. |
text | java.lang.String | The text. |
fontSize | double | The font size. |
Returns: java.io.InputStream - The PNG image with the text as a stream of bytes.
drawText(Font font, String text, double fontSize, RenderingUtils.LineSpacingType lineSpacingType, int lineSpacingValue, int maxWidth)
public static InputStream drawText(Font font, String text, double fontSize, RenderingUtils.LineSpacingType lineSpacingType, int lineSpacingValue, int maxWidth)
Rendering text in BitMap.
Parameters:
Parameter | Type | Description |
---|---|---|
font | Font | The font. |
text | java.lang.String | The text. |
fontSize | double | The font size. |
lineSpacingType | RenderingUtils.LineSpacingType | The type of line spacing. Number of pixels or percent of font height. |
lineSpacingValue | int | The value of line spacing. |
maxWidth | int | The maximum width in pixels for the resulting image. |
Returns: java.io.InputStream - The PNG image with the text as a stream of bytes.
drawText(Font font, GlyphId[] glyphIds, double fontSize)
public static InputStream drawText(Font font, GlyphId[] glyphIds, double fontSize)
Rendering text in BitMap. Return result in PNG-format as stream of bytes
Parameters:
Parameter | Type | Description |
---|---|---|
font | Font | Font |
glyphIds | GlyphId[] | Text represented as array of glyph identifiers |
fontSize | double | Font size |
Returns: java.io.InputStream - Image in PNG format as stream of bytes
drawText(Font font, GlyphId[] glyphIds, double fontSize, RenderingUtils.LineSpacingType lineSpacingType, int lineSpacingValue, int maxWidth)
public static InputStream drawText(Font font, GlyphId[] glyphIds, double fontSize, RenderingUtils.LineSpacingType lineSpacingType, int lineSpacingValue, int maxWidth)
Rendering text in BitMap. Return result in PNG-format as stream of bytes
Parameters:
Parameter | Type | Description |
---|---|---|
font | Font | Font |
glyphIds | GlyphId[] | Text represented as array of glyph identifiers |
fontSize | double | Font size |
lineSpacingType | RenderingUtils.LineSpacingType | Type of line spacing. Number of pixels or percent of font height |
lineSpacingValue | int | Value of line spacing |
maxWidth | int | Max width in pixels for image |
Returns: java.io.InputStream - Image in PNG format as stream of bytes