You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The structural fix for dynamic text, split out of #1554's re-scope: instead of baking every Text string into its own canvas-backed texture (re-uploaded on every content change), rasterize glyphs on demand into a shared atlas and compose strings as per-glyph quads — changing a string then allocates nothing and uploads at most the few glyphs never seen before.
BitmapText already proves the compose-from-quads path in the engine, but requires pre-baked font assets. This ticket is the runtime-generated equivalent for system/web fonts: same rendering model, glyphs sourced from canvas rasterization on first use.
Sketch
A shared glyph atlas texture per (font, size, style, resolution) family, packed shelf-style; glyphs rasterized on demand via the existing canvas measurement/draw path.
Text.draw composes per-glyph quads through the quad batcher (multi-texture batching keeps several atlas pages in one draw on 20.0 backends).
Metrics/kerning from the existing TextMetrics; fallback to the current canvas bake for features the atlas can't compose (e.g. complex shaping), so the change is incremental.
Summary
The structural fix for dynamic text, split out of #1554's re-scope: instead of baking every
Textstring into its own canvas-backed texture (re-uploaded on every content change), rasterize glyphs on demand into a shared atlas and compose strings as per-glyph quads — changing a string then allocates nothing and uploads at most the few glyphs never seen before.Why
BitmapTextalready proves the compose-from-quads path in the engine, but requires pre-baked font assets. This ticket is the runtime-generated equivalent for system/web fonts: same rendering model, glyphs sourced from canvas rasterization on first use.Sketch
Text.drawcomposes per-glyph quads through the quad batcher (multi-texture batching keeps several atlas pages in one draw on 20.0 backends).TextMetrics; fallback to the current canvas bake for features the atlas can't compose (e.g. complex shaping), so the change is incremental.Non-goals
BitmapText(pre-baked fonts remain the zero-rasterization option).