MinecraftFontEngine
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.
Parameters
immutable font definitions and resource bytes, safely reusable by other engines.
creates the independently owned CPU backend.
maximum combined cached glyph or cell results and decoded bitmap sheets; zero disables raster caching.
maximum retained raster pixel bytes; zero disables pixel caching.
maximum concurrently retained native faces, from 1 through 16.
Throws
when a raster cache bound is negative or the face bound is outside 1 through 16.
when the backend cannot be opened.
Constructors
Properties
Immutable release capabilities captured by this still-open owner-thread engine.
Detached resource and provider-load diagnostics accumulated by this owner-thread engine.
Immutable selection options captured by this still-open owner-thread engine.
Number of currently retained native faces; zero after close.
Total copied pixel payload retained by the cache, excluding caller-owned returned runs.
Number of cached glyph results and bitmap sheets; readable after owner-thread close.
Functions
Resolves the first applicable provider for one Unicode scalar. Every provider is preflighted before filtering, so a failed disabled provider still invalidates its bundle. Unknown fonts and missing glyphs return the native missing-glyph shape instead of silently selecting the default font. Atlas-rejected rasters use the missing shape with the selected release's advance behavior. Successful providers retain native non-finite metrics without permitting them into portable drawing geometry. This operation performs only derived work and never calls a tree or mutates application state.
Shapes and orders a complete logical line while retaining original UTF-16 scalar positions for font inheritance. Positions precede shaping and bidirectional reordering; contractions belong to their first contributing scalar. No input or derived run is retained by the engine.
Uses the selected backend's native-compatible text ordering without retaining the input string.