Incremental single-channel SDF glyph atlas for LabelBatch3D. More...
| Import Statement: | import Clayground.Canvas3D |
LabelGlyphAtlas rasterizes each needed glyph once (TinySDF: a QPainter coverage raster followed by an exact Euclidean distance transform), packs it into a growing R8 atlas texture, and keeps per-glyph metrics (UV rect, advance, label-local quad). New strings add only their missing glyphs; the atlas never rebuilds existing texels. One atlas covers one font config (family + weight + base size); LabelBatch3D owns one per instance.
This type is used internally by LabelBatch3D. The same object is handed to both the glyph shaper (LabelBatch3D shaping) and the material's Texture, so the shaper's UVs always match the committed atlas.
See also LabelBatch3D.
baseSize : int |
Rasterization size in pixels. Higher = crisper when magnified, larger atlas. Changing it clears the atlas.
fontFamily : string |
Font family baked into the atlas. Changing it clears the atlas.
fontWeight : int |
Font weight (e.g. 400 normal, 700 bold). Changing it clears the atlas.