RenderingUtils

Inheritance: java.lang.Object

public class RenderingUtils

Provides utility methods for rendering.

Methods

MethodDescription
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:

ParameterTypeDescription
fontFontThe font.
textjava.lang.StringThe text.
fontSizedoubleThe 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:

ParameterTypeDescription
fontFontThe font.
textjava.lang.StringThe text.
fontSizedoubleThe font size.
lineSpacingTypeRenderingUtils.LineSpacingTypeThe type of line spacing. Number of pixels or percent of font height.
lineSpacingValueintThe value of line spacing.
maxWidthintThe 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:

ParameterTypeDescription
fontFontFont
glyphIdsGlyphId[]Text represented as array of glyph identifiers
fontSizedoubleFont 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:

ParameterTypeDescription
fontFontFont
glyphIdsGlyphId[]Text represented as array of glyph identifiers
fontSizedoubleFont size
lineSpacingTypeRenderingUtils.LineSpacingTypeType of line spacing. Number of pixels or percent of font height
lineSpacingValueintValue of line spacing
maxWidthintMax width in pixels for image

Returns: java.io.InputStream - Image in PNG format as stream of bytes