Expand description
Glyphs test depth with LessEqual without writing depth, preserving smooth
alpha edges. Draw translucent text after opaque content, back to front.
GPU text rendering with shaping, alignment, and cached monochrome glyphs.
Load a Font once, rasterize it for a pixel size, and reuse the FontTexture
for labels. Cache unchanged Text objects outside the frame loop; recreate
size-dependent rasters after resizing when appropriate.
For HiDPI UI, rasterize at logical_size * scale_factor physical pixels and
draw text scaled by logical_size through a logical-pixel camera. Refresh
the raster and cached text when the scale factor changes; enlarging an old
raster alone reduces sharpness.
Text respects glyph placement offsets from wgame_typography; see that crate
for rasterization and layout limitations.
Structs§
- Font
- A font for GPU text rendering.
- Font
Atlas - Font
Data - A font loaded from font data.
- Font
Texture - Raster
Settings - Text
- Shaped text with a shared font raster and composable drawing transforms.
The default transform is normalized by font size; multiply by the raster size
for physical-pixel output.
TextAlignadjusts the horizontal origin relative to the measured advance width. - Text
Metrics - Typography
Library - Typography
State