Text LOD
Zoom out of a text-heavy canvas to see ordinary labels become one solid proxy per nonempty line. This example explicitly enables LOD; the library default remains off.
- Visible labels
- 0
- Full text
- 0
- Proxy text
- 0
- Base font on screen
- 18.0 CSS px
This demo explicitly enables LOD; the library default is off. Below 6 CSS px, text becomes a line proxy; above 8 CSS px, full text returns. Enter the 7 px band from Overview and from Detail to see hysteresis.
Click or hover to restore full glyphs; double-click to edit. Use Pan canvas to drag, or scroll to zoom. Selection and picking use the original text geometry. Counts describe visible text objects, not drawcalls or benchmark timings.
Preparing text scene…
Try the transition
- Start with Overview. Toggle Text LOD to compare proxies and full glyphs at the same camera zoom.
- From Overview, enter the 7 px hysteresis band: the labels remain proxies. Choose Detail, then return to 7 px: they remain full text. Text enters proxy mode below 6 CSS px and returns to full above 8 CSS px.
- Select a visible label or hover it to force full glyphs. Clear the selection to allow LOD again. Double-click a label to edit it.
- Change the label count, pan, or resize the page. The counters report visible text objects using the original viewport culling result, including interaction overrides.
Screen font size is the 18 px font projected through this example's camera zoom, in CSS pixels, independently of device pixel ratio. The counts are text objects, not drawcalls, GPU timings or a performance claim. This first slice reduces glyph work; text proxies still use independent drawcalls.
Enable it in your canvas
api.setTextLODEnabled(true);
// Restore the existing full text rendering path.
api.setTextLODEnabled(false);The setting belongs to this canvas at runtime and does not change document JSON, undo history or collaboration data. Selection, hovering and editing restore full text; picking and snapping retain the original geometry. Raster exports always use full glyphs. Complex styles, effects, clipping and unsupported text safely stay full.
Both text LOD (#674) and the ordered solid-shape batching improvements (#675) are implemented in packages/ecs. Batching applies to eligible simple solid SDF shapes with batchable: true; it does not yet batch text proxies.
This demo uses the ECS renderer. The older Core SDF text example has a separate rendering path; this switch does not configure it.