Docsv2.12.12
Back to API Reference
Class

UniTextFontVariant

Inherits:UniTextFont

A UniTextFont that takes only the raw font bytes from a Source font and defines everything else itself — face metrics, units-per-em, render settings and glyph overrides are fully independent and overridable. Use to render the same TTF/OTF with a different look or metrics without duplicating the bytes. Each variant has its own atlas and shaper cache (the base mixes the asset instance id into FontDataHash), so variants and their source coexist without overwriting each other's glyphs. On first assignment the face metrics are seeded from the source font; after that they are owned by the variant.

public UniTextFont Source{ get; set }

Source font this variant takes its raw bytes from. Assigning a source seeds the variant's face metrics from the selected FaceIndex, then rebuilds the runtime.

public int FaceIndex{ get; set }

Which face of the source's font file this variant renders. 0 is the first face; collections (.ttc) expose their other cuts at 1..N-1. Changing it re-reads that face's metrics and rebuilds.

public byte[] FontData{ get }
public bool HasFontData{ get }
protected override Core CreateRuntime()
protected override void OnEnable()
protected override void OnDisable()