UI: font assets

Goal

Introduce fonts as first-class project assets instead of relying on hardcoded or system font names. This enables projects to package fonts, reference them from themes and UI documents, and build a complete asset pipeline for typography.

Context / integration points

  • MVP uses fonts defined directly in the active Theme.
  • Turian currently has no asset type representing font resources.
  • UI themes, text components, and future localization systems will require reusable font assets.
  • The Asset Database should manage fonts identically to textures, materials, and other resources.

Design

Create a dedicated Font asset responsible for importing and exposing font files.

The asset should:

  • Import common font formats (TTF, OTF initially).
  • Store import metadata separately from the original file.
  • Generate any runtime data required by DVUI.
  • Be referenceable by Theme assets and future UI components.
  • Support hot reload during development.

Future extensions may include:

  • Font atlases.
  • Variable fonts.
  • Multiple weights/styles.
  • Fallback font chains.
  • CJK font support.
  • Signed-distance-field (SDF/MSDF) generation.
  • Automatic atlas packing.

Tasks

  • Define the Font asset type.
  • Implement importing for TTF/OTF.
  • Store import metadata.
  • Generate runtime font representation.
  • Integrate with the Asset Database.
  • Create Inspector UI showing preview and metadata.
  • Support hot reload.
  • Allow Theme assets to reference Font assets.

Acceptance criteria

  • Font files can be imported into the project.
  • Imported fonts appear in the Asset Browser.
  • Fonts display preview text inside the Inspector.
  • Theme assets reference Font assets instead of raw names.
  • Runtime loads fonts through the Asset Database.

Dependencies

Can be implemented independently.

Later consumed by Theme assets and UI text components.

Out of scope

  • Automatic font fallback.
  • Font subsetting.
  • Variable fonts.
  • SDF/MSDF generation.
  • Dynamic glyph streaming.
Edited by Bruno Massa