SpriteFont
The process-wide colour font whose glyphs are sprites. Every inline sprite of every component is a glyph of this runtime, so it takes a glyph's place in the text mesh — the layer stack in order, world-space text, effects through its silhouette field — while drawing from its own texture at native resolution through the sub-mesh its component keeps per texture; nothing is copied into an atlas. A silhouette field is derived from a read-back of the sprite's pixels only when an effect asks for one. Glyph ids are issued per Sprite object, hold until the sprite is unregistered and are never reissued. The nominal glyph box is 1 em tall on the baseline, its width the sprite's aspect.
public static SpriteFont Instance{ get }The singleton, created on first access. Main thread on creation.
public override UniTextFontError LoadFontFace()Retires every registration and drops the singleton, so Instance answers with a live font again.
public override bool HasGlyphInAtlas(uint glyphIndex, UniTextRenderMode mode)A registered sprite is always drawable: its pixels are its own texture.
public uint Register(Sprite sprite)Glyph id of a sprite, issued on first sight. The font holds the sprite and its texture until Unregister. Main thread — reads the sprite's rect, texture and mesh.
public bool Unregister(Sprite sprite)Releases the font's hold on a sprite and its texture, retiring its glyph id for good. Text still showing the sprite drops it on its next rebuild, and a catalog that still lists it registers it again under a new id — unregister only what the catalogs no longer name. False when the font does not hold the sprite.
public bool TryGetGlyph(Sprite sprite, out uint glyphId, out float aspect)Glyph id and width-over-height aspect of a registered sprite; false for one the font does not hold. Safe on worker threads.
protected override GlyphMetrics ComputeGlyphMetrics(uint glyphIndex, RenderedGlyphData rendered, bool renderedByCOLRv1 = false)A sprite glyph is its rect's aspect wide and one em tall, standing on the baseline.
