Skip to main content

Module stroke

Module stroke 

Source
Expand description

Stroked / outlined text rendering (M-TEXT.7 / AUT-81).

Text that has to stay readable over a busy screen recording needs a high-contrast outline. The standard CSS-style technique — stamp the rendered text texture multiple times in the stroke color at small offsets around a center, then stamp the fill color on top — works without a shader change.

Output of stroked_text_sprites is a Vec<Sprite> ready to be attached to a crate::Container. The container’s transform handles position / scale; offsets are emitted in local NDC so the container scale doesn’t break stroke geometry.

Structs§

StrokedTextLayer
Builder for a stroked-text composition.

Constants§

STROKE_OFFSETS 🔒
Eight unit-vectors at 45° spacing — the offsets used to stamp the stroke ring. More directions = smoother edges but more sprite nodes per stroke.

Functions§

stroked_text_sprites
Produce a list of sprites that, when attached to a container, render the given text-texture with fill interior and stroke outline at the configured stroke_width_ndc.