BaseTtfFont
abstract class BaseTtfFont(s: FastByteArrayInputStream, extName: String? = null, onlyReadMetadata: Boolean = false, enableLigatures: Boolean = true) : VectorFont, Extra
Inheritors
Types
Link copied to clipboard
data class BitmapGlyphInfo(val glyphID: Int, val imageFormat: Int = 0, val offset: Int = 0, val size: Int = 0, val info: BaseTtfFont.ColorBitmapInfo, var height: Int = 0, var width: Int = 0, var horiBearingX: Int = 0, var horiBearingY: Int = 0, var horiAdvance: Int = 0, var vertBearingX: Int = 0, var vertBearingY: Int = 0, var vertAdvance: Int = 0)
Link copied to clipboard
inner class CFFGlyph(val index: Int, val xMin: Int, val yMin: Int, val xMax: Int, val yMax: Int, val advanceWidth: Int, val path: BaseTtfFont.GlyphGraphicsPath) : BaseTtfFont.Glyph
Link copied to clipboard
data class ColorBitmapInfo(val indexSubTableArrayOffset: Int = 0, val indexTablesSize: Int = 0, val numberofIndexSubTables: Int = 0, val colorRef: Int = 0, val hori: BaseTtfFont.SbitLineMetrics = SbitLineMetrics(), val vert: BaseTtfFont.SbitLineMetrics = SbitLineMetrics(), val startGlyphIndex: Int = 0, val endGlyphIndex: Int = 0, val ppemX: Int = 0, val ppemY: Int = 0, val bitDepth: Int = 0, val flags: Int = 0)
Link copied to clipboard
Link copied to clipboard
interface ColrGlyphInfo
Link copied to clipboard
inner class ColrGlyphInfoV0(val glyphID: Int, val firstLayerIndex: Int, val numLayers: Int) : BaseTtfFont.ColrGlyphInfo
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class COLRv1(var layerList: IntArray = intArrayOf(), var s: FastByteArrayInputStream = FastByteArrayInputStream(byteArrayOf()), var sBaseOffset: FastByteArrayInputStream = FastByteArrayInputStream(byteArrayOf()), var sLayerOffset: FastByteArrayInputStream = FastByteArrayInputStream(byteArrayOf()), var sClipOffset: FastByteArrayInputStream? = null)
Link copied to clipboard
Link copied to clipboard
inner class CompositeGlyph(val index: Int, val xMin: Int, val yMin: Int, val xMax: Int, val yMax: Int, val refs: List<BaseTtfFont.GlyphReference>, val advanceWidth: Int) : BaseTtfFont.Glyph
Link copied to clipboard
Link copied to clipboard
data class GlyphReference(val glyph: BaseTtfFont.Glyph, val x: Int, val y: Int, val scaleX: Float, val scale01: Float, val scale10: Float, val scaleY: Float)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class SbitLineMetrics(val ascender: Int = 0, val descender: Int = 0, val widthMax: Int = 0, val caretSlopeNumerator: Int = 0, val caretSlopeDenominator: Int = 0, val caretOffset: Int = 0, val minOriginSB: Int = 0, val minAdvanceSB: Int = 0, val maxBeforeBL: Int = 0, val minAfterBL: Int = 0, val pad1: Int = 0, val pad2: Int = 0)
Link copied to clipboard
Link copied to clipboard
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
GlyphID -> GlyphID
Link copied to clipboard
Link copied to clipboard
Gets a BitmapFont from the font, that is going to be computed lazily as glyphs are required.
Returns, creates and caches a LazyBitmapFont instance from the VectorFont that will generate and cache glyphs as required.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Functions
Link copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getGlyphByReader(reader: WStringReader?, codePoint: Int, cache: Boolean = true): BaseTtfFont.Glyph?
Link copied to clipboard
Link copied to clipboard
open override fun getGlyphMetrics(size: Double, codePoint: Int, metrics: GlyphMetrics, reader: WStringReader?): GlyphMetrics
Link copied to clipboard
open override fun getGlyphPath(size: Double, codePoint: Int, path: GlyphPath, reader: WStringReader?): GlyphPath?
Link copied to clipboard
fun getGlyphsByReader(reader: WStringReader, out: MutableList<BaseTtfFont.Glyph> = arrayListOf()): List<BaseTtfFont.Glyph>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard
inline fun <T> FastByteArrayInputStream.readArrayOf16(block: FastByteArrayInputStream.(index: Int) -> T): Array<T>
Link copied to clipboard
inline fun <T> FastByteArrayInputStream.readArrayOf32(block: FastByteArrayInputStream.(index: Int) -> T): Array<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun FastByteArrayInputStream.readColorStop(out: BaseTtfFont.ColorStop = ColorStop(0.0, 0, 0.0)): BaseTtfFont.ColorStop
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard