Back to API Reference
Struct

FontFamily

sealed
Implements:IStateSnapshot<FontFamily>

A font family: primary font plus optional variant faces (Bold, Italic, Variable, etc.).

public ReadOnlyArray<UniTextFont> Faces{ get }

Additional faces such as bold, italic, and variable variants.

[ctor]public FontFamily()

Creates a family with detached face storage.

public FontFamily WithFaces()

Returns a copy of this family with detached replacement faces.

public FontFamily CaptureStateSnapshot()

Captures the family and its face-array storage without retaining mutable aliases.

public bool StateEquals()

Compares serialized family configuration while ignoring the derived runtime lookup.

public string name

Optional identifier referenced by <font=...> rich-text tags. Case-sensitive; duplicates across a stack trigger a warning and first-wins lookup. Leave empty for families that should not be addressable by name.

public UniTextFont primary

Primary font asset. Provides strut metrics (if first family) and codepoint lookup.

public string preferredLanguage

Optional BCP 47 language hint (e.g. zh-Hans, ja, en-GB). When a text run carries a matching language tag, this family is preferred during codepoint-to-font resolution. Use for single-stack multi-locale setups; leave empty for locale-agnostic families.