Package-level declarations
Types
ZIP or JAR pack source that opens and closes an archive for each operation. Files are read directly and never extracted to the filesystem. The caller must not modify the archive during snapshot loading.
Optional streaming-capable source contract that enforces limits before allocating complete results. Existing MinecraftFontAssetSource implementations keep their original callbacks, including interception through Kotlin delegation. Implementations own and close their streams synchronously and retain no mutable loading counter.
Optional backend capability that inspects image dimensions before allocating native or JVM pixels. Ownership and owner-thread confinement follow MinecraftFontBackend; existing backends keep their original callbacks.
Directory-backed pack source that closes each enumeration and read before returning. Reads reject symbolic links whose resolved target escapes the selected directory. The caller must not modify the directory concurrently with snapshot loading.
Synchronous source of pack-relative files for an immutable font snapshot. Paths use forward slashes, including assets/namespace/path and optional pack.mcmeta. A loader retains neither this source nor any returned mutable collection or array. Implementations own no persistent open stream; callers must obey any source-specific thread contract. Custom sources must bound allocation inside their callbacks; loaders also validate returned sizes before copying. Implement MinecraftBoundedFontAssetSource to receive the current limits and stop while streaming or enumerating.
Owner-thread CPU image-decoding and TrueType services owned by one font engine. Implementations must not require Minecraft, a display, or a graphics context. Returned images and glyphs are detached, and close is idempotent. Custom decoders must bound their own allocations; MinecraftBoundedFontBackend receives each snapshot's explicit image ceilings.
Creates independent owner-thread CPU backends without retaining a game or graphics context.
Immutable resource-format and rasterization capabilities selected by the caller's release adapter. No game version is inferred from names or runtime strings.
Immutable diagnostic for a source, metadata section, font document, or provider excluded from a snapshot. Diagnostic strings describe external provenance and never select runtime behavior.
Owner-thread portable glyph engine for one immutable resource state. The engine owns its backend and native faces, while returned glyphs retain only detached pixels and metrics. Its access-ordered raster cache is bounded by both entry count and pixel bytes; large values bypass the cache. Sheets share detached resource identity; bitmap scans share resource, grid, and cell identity with one current metric result per cell. TrueType faces and glyphs share resource and exact settings, with provider skips checked before glyph lookup. Other glyphs use snapshot-local provider identities and Unicode scalars; changing resources, limits, or options requires a new engine. Decoded dimensions and detached failure messages are bounded by the current snapshot's resources and settings, even with raster caching disabled. Native faces have an independent entry bound of at most 16 and a combined encoded-input ceiling equal to the snapshot's maxAssetBytes. Eviction closes faces before opening replacements; successful descriptor checks survive eviction without retaining native state. Preallocation-limit failures occupy ordinary bounded glyph-cache entries and retain only a message. A backend returning an image beyond its allocation contract permanently disables that face descriptor and closes its live face. Closing clears snapshot, cache, and native references and never invalidates returned glyphs. Glyph selection, cache eviction, and terminal cleanup share this owner to preserve resource lifetime boundaries.
Immutable detached glyph pixels and native logical metrics. Ink bounds are relative to the same top-left logical origin supplied to Minecraft text drawing. The image contains the complete sampled glyph rectangle, ready for ordinary RGBA tint multiplication; intensity backends replicate coverage into every channel before returning it. A null image represents an advance without ink unless MinecraftFontGlyph.oversizedRasterSize records an atlas-rejected source raster. MinecraftFontGlyph.channel records provenance without requiring another shader conversion. MinecraftFontGlyph.orientation preserves reversed native source coordinates through normalized ink bounds without rearranging pixels. Advance and ink metrics may retain native NaN or infinity; callers must omit non-finite final quads before constructing portable geometry. Finite bounds remain normalized, while offsets stay finite and non-negative. Values are safe to retain after their engine and native face close.
Identifies a bounded-input rejection so source enumeration can exclude only the affected pack. Custom asset sources may throw this type when stopping enumeration at their supplied ceiling. The exception retains a detached explanation and no source, stream, or failed input.
Immutable input and allocation ceilings for one synchronous font snapshot and its image decoders. Counts include rejected records already processed, and byte ceilings describe payload rather than total JVM heap usage. Defaults accommodate the measured vanilla resources of every supported release; callers may choose tighter or larger finite budgets. No source, stream, mutable counter, or native resource is retained here, so limits may be shared across threads.
Immutable font-provider selections and fallback text direction captured with one resource snapshot.
Detached font-provider graph with read-only collections loaded directly from a resource-pack stack. All referenced bytes and sparse Unihex rows are owned snapshots; no source, stream, native face, or game object is retained. The same snapshot may be shared across threads and independent engines.
Describes the native text shader's interpretation of detached source texels.
Offline source for a Minecraft asset index and its already-downloaded object directory. Construction snapshots the index; object bytes are read synchronously without downloading or starting the game. Resolved object paths must remain inside the supplied object directory.
Immutable thread-safe in-memory pack source used by adapters and deterministic fixtures. Construction copies all bytes and paths; reads always return a fresh array.
Owner-thread native face borrowed only by one font engine. Every returned glyph is detached from the face; close releases all native handles and is idempotent.
Selects the native CPU rasterization contract supplied by a supported release adapter.
Immutable TrueType provider settings passed to a CPU backend. Signed sizes and oversampling, including either signed zero, preserve the selected native provider's numeric behavior. A backend may reject a native operation that cannot be executed safely, but these values do not make a font document malformed.
Immutable visual-order Unicode scalar associated with its original logical UTF-16 position. The position identifies the first contributing scalar before shaping and bidirectional reordering; a Lam-Alef ligature belongs to the Lam. This preserves the original font spans after contractions, deliberately correcting native text processing's shifted style lookup. Values contain no backend ownership and can be shared across threads.
Functions
Reads an encoded font asset with an inclusive byte ceiling, checking overflow before appending bytes. At most one byte beyond the ceiling is consumed to distinguish exact-size input from oversized input. This synchronous operation neither retains nor closes the stream; its caller owns closing on success and failure.