Package-level declarations

Types

Link copied to clipboard
data class GlyphUpload(val x: Int, val y: Int, val width: Int, val height: Int, val data: ByteArray)

Represents a pending glyph upload from native engine. Contains RGBA pixel data for a region of the atlas.

Link copied to clipboard
actual class NativeTextEngine
expect class NativeTextEngine

Native text engine for SDF glyph generation and text layout.

actual class NativeTextEngine
Link copied to clipboard
actual class SdfAtlasManager(atlasWidth: Int, atlasHeight: Int)

Android implementation of SDF atlas manager for text rendering.

expect class SdfAtlasManager(atlasWidth: Int, atlasHeight: Int)

Manages the SDF atlas texture for text rendering. This is a platform-specific implementation that handles:

actual class SdfAtlasManager(atlasWidth: Int, atlasHeight: Int)

JVM/Desktop implementation of SDF atlas manager for text rendering.

Functions

Link copied to clipboard
fun NativeTextEngine.loadFallbackFontFromAsset(context: Context, assetPath: String): Boolean

Loads a fallback font from Android assets using zero-copy file descriptor. More memory efficient than loading entire font into ByteArray.

Link copied to clipboard

Loads a fallback font from a file path using zero-copy file descriptor.

Link copied to clipboard

Parses the JSON string from NativeTextEngine.getPendingUploads() into a list of GlyphUpload. JSON format: {"x":0,"y":0,"width":32,"height":32,"data":"base64..."},...

Link copied to clipboard
fun rememberSdfAtlasManager(atlasWidth: Int, atlasHeight: Int): SdfAtlasManager

Composable to remember an SdfAtlasManager instance.

Link copied to clipboard
suspend fun warmupAscii(nativeEngine: NativeTextEngine, atlasManager: SdfAtlasManager, fontSize: Float, fontWeight: Float = 400.0f)

Pre-caches printable ASCII characters (32-126) for faster rendering. Should be called during app initialization or when fonts are loaded.