Skip to main content

Crate wgame_gfx_typography

Crate wgame_gfx_typography 

Source
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.
FontAtlas
FontData
A font loaded from font data.
FontTexture
RasterSettings
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. TextAlign adjusts the horizontal origin relative to the measured advance width.
TextMetrics
TypographyLibrary
TypographyState

Enums§

TextAlign