LazyBitmapFont

class LazyBitmapFont(val font: VectorFont, val fontSize: Double, val distanceField: String? = null) : BitmapFont, Extra

Constructors

Link copied to clipboard
constructor(font: VectorFont, fontSize: Double, distanceField: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val anyGlyph: BitmapFont.Glyph
Link copied to clipboard
Link copied to clipboard
open override val base: Double
Link copied to clipboard
open val baseBmp: Bitmap
Link copied to clipboard
open override val distanceField: String? = null
Link copied to clipboard
open override var extra: ExtraType
Link copied to clipboard
Link copied to clipboard
open override val fontSize: Double
Link copied to clipboard
open override val glyphs: IntMap<BitmapFont.Glyph>
Link copied to clipboard
open override val invalidGlyph: BitmapFont.Glyph
Link copied to clipboard
open override val kernings: IntMap<BitmapFont.Kerning>
Link copied to clipboard

Gets a BitmapFont from the font, that is going to be computed lazily as glyphs are required.

Link copied to clipboard
open override val lineHeight: Double
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val naturalFontMetrics: FontMetrics
Link copied to clipboard

Functions

Link copied to clipboard
fun <T> Font.drawText(ctx: Context2d?, size: Double, text: T, paint: Paint?, pos: Point = Point.ZERO, fill: Boolean = true, renderer: TextRenderer<T> = DefaultStringTextRenderer as TextRenderer<T>, align: TextAlignment = TextAlignment.BASELINE_LEFT, outMetrics: TextMetricsResult? = null, fillStyle: Paint? = null, stroke: Stroke? = null, textRangeStart: Int = 0, textRangeEnd: Int = Int.MAX_VALUE, placed: TextRendererActions.(codePoint: Int, Point, size: Double, metrics: GlyphMetrics, fmetrics: FontMetrics, transform: Matrix) -> Unit? = null): TextMetricsResult?
Link copied to clipboard
fun ensureCharacterSet(characterSet: CharacterSet)
Link copied to clipboard
fun ensureChars(chars: String)
Link copied to clipboard
fun ensureCodePoints(codePoints: IntArray)
Link copied to clipboard
fun ensureRange(codePoint: Int, range: IntRange)
Link copied to clipboard
open operator fun get(char: Char): BitmapFont.Glyph
open operator fun get(charCode: Int): BitmapFont.Glyph
open suspend override fun get(): Font
Link copied to clipboard
open override fun getFontMetrics(size: Double, metrics: FontMetrics): FontMetrics
Link copied to clipboard
open fun getGlyph(char: Char): BitmapFont.Glyph
open fun getGlyph(codePoint: Int): BitmapFont.Glyph
Link copied to clipboard
open override fun getGlyphMetrics(size: Double, codePoint: Int, metrics: GlyphMetrics, reader: WStringReader?): GlyphMetrics
Link copied to clipboard
open fun getKerning(first: Char, second: Char): BitmapFont.Kerning?
open override fun getKerning(size: Double, leftCodePoint: Int, rightCodePoint: Int): Double
open override fun getKerning(first: Int, second: Int): BitmapFont.Kerning?
Link copied to clipboard
open override fun getOrNull(): Font
open override fun getOrNull(codePoint: Int): BitmapFont.Glyph?
Link copied to clipboard
fun <T> Font.getTextBounds(size: Double, text: T, out: TextMetrics = TextMetrics(), renderer: TextRenderer<T> = DefaultStringTextRenderer as TextRenderer<T>, align: TextAlignment = TextAlignment.TOP_LEFT): TextMetrics
Link copied to clipboard
fun <T> Font.getTextBoundsWithGlyphs(size: Double, text: T, renderer: TextRenderer<T> = DefaultStringTextRenderer as TextRenderer<T>, align: TextAlignment = TextAlignment.BASELINE_LEFT): TextMetricsResult
Link copied to clipboard
open fun getTextScale(size: Double): Double
Link copied to clipboard
open fun measureWidth(text: String): Int
Link copied to clipboard
inline suspend fun <T> Font.registerTemporarily(name: String = this.name, block: () -> T): T
inline fun <T> Font.registerTemporarily(registry: DefaultFontRegistry, name: String = this.name, block: () -> T): T
Link copied to clipboard
open override fun renderGlyph(ctx: Context2d, size: Double, codePoint: Int, pos: Point, fill: Boolean?, metrics: GlyphMetrics, reader: WStringReader?, beforeDraw: () -> Unit?): Boolean
Link copied to clipboard
fun Font.renderGlyphToBitmap(size: Double, codePoint: Int, paint: Paint = DefaultPaint, fill: Boolean = true, effect: BitmapEffect? = null, border: Int = 1, nativeRendering: Boolean = true, reader: WStringReader? = null): TextToBitmapResult
Link copied to clipboard
fun <T> Font.renderTextToBitmap(size: Double, text: T, paint: Paint = DefaultPaint, background: Paint = NonePaint, fill: Boolean = true, border: Int = 0, renderer: TextRenderer<T> = DefaultStringTextRenderer as TextRenderer<T>, returnGlyphs: Boolean = true, nativeRendering: Boolean = true, drawBorder: Boolean = false): TextToBitmapResult
Link copied to clipboard
inline fun Font.toBitmapFont(fontSize: Number, chars: CharacterSet = CharacterSet.LATIN_ALL, fontName: String = this.name, paint: Paint = Colors.WHITE, mipmaps: Boolean = true, effect: BitmapEffect? = null): BitmapFont
Link copied to clipboard
suspend fun BitmapFont.writeToFile(out: VfsFile, writeBitmap: Boolean = true)