Docsv3.31.0
Back to API Reference
Class

GlyphAtlas

sealed
Inherits:GpuAtlas<GlyphAtlas.GlyphEntry>

GPU-resident glyph tile cache over the GpuAtlas<TEntry> engine: Burst CPU rasterization directly into acquired GpuUploadSlot memory for SDF/MSDF glyphs, ready color pixels for emoji/color fonts. This class owns everything glyph-shaped — pad tiers, tile-size classification, the GlyphTransformTable rows, raster jobs — while storage, delivery, slots, eviction, compaction and recovery live in the engine. The atlas is a disposable cache: on AnyAtlasContentLost consumers re-collect from font data.

Nested Types

protected bool HasConsumerPendingWork{ get }
public static GlyphAtlas GetInstance(UniTextRenderMode mode)

Returns the process-wide atlas; GPU initialization remains deferred to the main thread.

public static long MakeKey(long varHash48, uint glyphIndex)

Atlas and glyph-table key of a glyph under a 48-bit variation hash.

public static long DefaultVarHash(int fontDataHash)

Computes default varHash48 for a non-variable font.

public static long ComputeVarHash48(int fontDataHash, ReadOnlySpan<float> axisValues)

Computes varHash48 for a variable font with specific axis values. Uses FNV-1a to mix fontDataHash with axis values. Returns DefaultVarHash if axisValues is empty.

protected override void OnEntryDropped(in GlyphAtlas.GlyphEntry entry)
protected override void OnTilePlaced(long key, in GlyphAtlas.GlyphEntry entry)
protected override void OnRemoveSweep(Func<GlyphAtlas.GlyphEntry,bool> match)
protected override void OnAtlasStateCleared()
protected override bool OnCompactionRelocated()
public override void Dispose()
protected override bool FlushPendingWork(ref FlushTransaction transaction)
public static const float Pad

SDF distance scale: the atlas stores signed distance in em, clamped to ±this, and effect widths convert em→field units through it (the shader's DILATE_SCALE). NOT the tile rim — see TileFitPad.

public static const float TileFitPad

Tight-fit rim for an effect-free glyph, in glyph-height units — pad tier 0 (see PadTierToNorm). Small enough that the glyph nearly fills its tile, large enough for edge AA (must exceed the face SDF padding). Effects grow the tier per-glyph via re-rasterization, up to the full Pad/glyphH spread.