MinecraftFontLoadLimits

data class MinecraftFontLoadLimits(val maxSources: Int = 256, val maxSourceEntries: Int, val maxEntries: Int, val maxPathLength: Int, val maxArchiveBytes: Long = 256L * 1024 * 1024, val maxAssetBytes: Int = 32 * 1024 * 1024, val maxDocumentBytes: Int = 2 * 1024 * 1024, val maxInputBytes: Long = 128L * 1024 * 1024, val maxDecompressedEntryBytes: Long = 32L * 1024 * 1024, val maxDecompressedBytes: Long = 128L * 1024 * 1024, val maxFontDocuments: Int, val maxProviders: Int, val maxGlyphs: Int, val maxGlyphRowBytes: Long = 128L * 1024 * 1024, val maxJsonDepth: Int = 64, val maxJsonValues: Int, val maxReferenceDepth: Int = 128, val maxResolvedProviders: Int, val maxImageDimension: Int, val maxImageBytes: Long = 64L * 1024 * 1024, val maxBitmapSheetBytes: Long = 8L * 1024 * 1024, val maxTrueTypeFaces: Int = 256, val maxTrueTypeInputBytes: Long = 128L * 1024 * 1024)(source)

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.

Throws

when a ceiling is negative or a depth or path ceiling is zero.

Constructors

Link copied to clipboard
constructor(maxSources: Int = 256, maxSourceEntries: Int, maxEntries: Int, maxPathLength: Int, maxArchiveBytes: Long = 256L * 1024 * 1024, maxAssetBytes: Int = 32 * 1024 * 1024, maxDocumentBytes: Int = 2 * 1024 * 1024, maxInputBytes: Long = 128L * 1024 * 1024, maxDecompressedEntryBytes: Long = 32L * 1024 * 1024, maxDecompressedBytes: Long = 128L * 1024 * 1024, maxFontDocuments: Int, maxProviders: Int, maxGlyphs: Int, maxGlyphRowBytes: Long = 128L * 1024 * 1024, maxJsonDepth: Int = 64, maxJsonValues: Int, maxReferenceDepth: Int = 128, maxResolvedProviders: Int, maxImageDimension: Int, maxImageBytes: Long = 64L * 1024 * 1024, maxBitmapSheetBytes: Long = 8L * 1024 * 1024, maxTrueTypeFaces: Int = 256, maxTrueTypeInputBytes: Long = 128L * 1024 * 1024)

Properties

Link copied to clipboard

maximum compressed ZIP or JAR file size before opening its directory.

Link copied to clipboard

maximum bytes returned for one encoded asset, also bounding all concurrently retained native face input payloads in one engine.

Link copied to clipboard

independent input ceiling for a bitmap provider's decoded sheet, unaffected by engine cache settings.

Link copied to clipboard

aggregate expanded Unihex and PNG image-data bytes plus PNG four-byte pixel payloads examined by a snapshot.

Link copied to clipboard

maximum expanded bytes in one Unihex ZIP entry or PNG image-data stream, including ignored ZIP entries.

Link copied to clipboard

maximum bytes in a font document, pack metadata, or asset index.

Link copied to clipboard

aggregate source paths and nested ZIP entries processed by one snapshot, including rejected sources.

Link copied to clipboard

total font document locations accepted across the source stack.

Link copied to clipboard

aggregate retained Unihex row payload, charged as sixteen Long values per record before allocation.

Link copied to clipboard

total explicit scalar records processed, including duplicate Unihex records, bitmap cells, advances, and skip lists.

Link copied to clipboard

maximum four-byte pixel payload of one decoded sheet or glyph image.

Link copied to clipboard

maximum width or height before allocating a decoded sheet or glyph image.

Link copied to clipboard

aggregate encoded bytes read while loading a snapshot or copying an in-memory source.

Link copied to clipboard

maximum JSON container nesting before tree parsing.

Link copied to clipboard

maximum JSON tokens examined in one document before tree parsing.

Link copied to clipboard

maximum UTF-16 length of one source-relative path or archive entry name.

Link copied to clipboard

total declared provider records processed across font documents.

Link copied to clipboard

maximum active font-reference recursion depth.

Link copied to clipboard

aggregate provider entries produced by reference expansion.

Link copied to clipboard

entries examined in one source or nested Unihex archive, including archive directories.

Link copied to clipboard

source count accepted by one snapshot invocation.

Link copied to clipboard

maximum distinct resource-and-settings descriptors examined by a snapshot, independent of provider skips and filters.

Link copied to clipboard

aggregate encoded face input charged once for every distinct resource-and-settings descriptor, before native work.

Functions

Link copied to clipboard

Checks recognizable PNG dimensions and inflates image data into a fixed scratch buffer before native decoding. No decoded pixels are retained, and malformed PNG data or excessive expansion fails before native allocation. Other encoded formats return false and remain subject to a decoder's own format and allocation contract.

Link copied to clipboard
fun requireBitmapSheetSize(width: Int, height: Int)

Applies generic image safety and the independent bitmap-sheet input ceiling before allocating a provider sheet. The default sheet ceiling allows the default raster cache to retain a sheet and its largest copied glyph together. Raising this input ceiling may cause repeated decoding under a smaller cache, but never changes provider selection between cache modes.

Link copied to clipboard
fun requireImageSize(width: Int, height: Int)

Rejects invalid or oversized image dimensions before native decoding or pixel-array allocation. Multiplication uses Long arithmetic; the four-byte payload must fit an Int-indexed native byte buffer even with larger custom limits.