1 runtime ui fonts and localized text presentation
forgejo-actions edited this page 2026-07-15 12:43:13 +00:00

Runtime UI Fonts And Localized Text Presentation

Runtime UI fonts and localized text presentation resolve authored font kinds, localization keys, fallback text, template arguments, and display durations into concrete UI text.

How It Works

UiFonts maps authored layout font kinds to Bevy font handles and egui families. LocalizationCatalog loads baked cache, local bake output, or fallback-only data. TextPresentationResolver applies fallback behavior, {arg} replacement, duration metadata, and fallback_used diagnostics.

How To Use It

Use authored localization keys for user-facing text and include fallback text for recovery. Use font kinds rather than hard-coded font handles. When adding a text surface, decide whether duration and template args are part of the presentation contract.

Invariants

Missing localization should fall back visibly. Duplicate or empty localization entries should be validation issues. Font descriptors must cover every layout font kind used by authored UI.

Debugging

Wrong cache schema, missing cache, duplicate keys, missing font descriptors, and unfilled template args are common causes of odd UI text. Check fallback_used before assuming the localization asset loaded correctly.

Examples

A loading-screen message can use a localization key with fallback text and a duration hint. If the fallback appears in a shipped build, inspect the baked localization cache path and schema.