TtfReader

class TtfReader(val bytes: ByteArray)

Big-endian binary reader for SFNT / TrueType / OpenType tables.

All multi-byte fields in those formats are big-endian (network order), so we deliberately avoid the platform's NIO ByteBuffer (which is little-endian by default on x86 and not common-source available anyway).

Methods read at the current position and advance. Seeking is supported so the parser can jump to a table by offset.

Constructors

Link copied to clipboard
constructor(bytes: ByteArray)

Properties

Link copied to clipboard
Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
fun pos(): Int
Link copied to clipboard
fun s16(): Int
Link copied to clipboard
fun s32(): Int
Link copied to clipboard
fun s8(): Int
Link copied to clipboard
fun seek(offset: Int)
Link copied to clipboard
fun skip(n: Int)
Link copied to clipboard
fun slice(offset: Int, length: Int): ByteArray

Read a byte range as a fresh array without advancing position.

Link copied to clipboard
fun tag(): String

Read a fixed-length ASCII tag (4 bytes) — table tags, version markers.

Link copied to clipboard
fun u16(): Int
Link copied to clipboard
fun u32(): Long
Link copied to clipboard
fun u8(): Int