FontImageMapDrawer

The FontImageMapDrawer class facilitates rendering of text based on a font image map. It handles generating text vertex data, applying draw styles, and efficiently managing resources like vertex buffers for text rendering tasks.

This class is designed to support optimized operations such as batching text quads for rendering, efficient memory management, and high-quality glyph rendering with proper kerning and positioning.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun drawText(context: DrawContext, drawStyle: DrawStyle, text: String, x: Double, y: Double): List<List<GlyphRectangle>>

Draws a single line of text at the specified position using the provided drawing context and style.

Link copied to clipboard
fun drawTexts(context: DrawContext, drawStyle: DrawStyle, texts: List<String>, positions: List<Vector2>): List<List<GlyphRectangle>>

Draws multiple text strings at specified positions using the provided drawing context and style. The method aligns text with precise position information and applies kerning and text settings based on the given draw style.

Link copied to clipboard
fun flush(context: DrawContext, drawStyle: DrawStyle, vertices: VertexBuffer)

Flushes the currently queued drawing commands and renders them using the specified context, style, and vertex buffer. This method ensures that the queued vertex data is uploaded, the appropriate shader is applied, and the rendering pipeline is executed.

Link copied to clipboard

Retrieves a vertex buffer based on the specified size.

Link copied to clipboard
fun queueText(    fontMap: FontMap,     text: String,     x: Double,     y: Double,     tracking: Double = 0.0,     kerning: KernMode,     textSetting: TextSettingMode,     vertices: VertexBuffer)

Queues a single line of text for rendering at the specified position with the given font and settings.