WithFont

data class WithFont(val text: UiText, val font: ResourceId) : UiText(source)

Text carrying a resource-pack font identifier without resolving or owning the font resource.

The immutable wrapper is safe to retain and share across threads under the wrapped text's ownership contract. Runtime adapters resolve UiText.WithFont.font against their pinned resource state when measuring and drawing UiText.WithFont.text. The font is inherited by the wrapped text; a nested WithFont takes precedence over this outer selection.

Constructors

Link copied to clipboard
constructor(text: UiText, font: ResourceId)

Properties

Link copied to clipboard

structural resource identifier of the font definition.

Link copied to clipboard

unresolved text to render with the selected font.

Functions

Link copied to clipboard

Retains this text with a resource-pack font identifier without loading resources or changing its content.