UniTextFont
Serialized font definition that owns face and rendering metadata and resolves its immutable source lazily. Embedded sources stay in the asset in the Editor and WebGL; other players resolve build-generated disk-backed sources. The Core materializes only when glyph or shaping work first needs this face.
Derived Types(3)
Types that inherit from UniTextFont.
Nested Types
public UniTextFont.Core Runtime{ get }Lazy-built runtime that owns the FT face, glyph tables and atlas pipeline. First access after creation or source invalidation must occur on the main thread unless a provider has already captured the worker-safe slot.
public FaceInfo FaceInfo{ get; set }Font face metrics (ascender, descender, line height, etc.); their units per em is always UnitsPerEm.
Synthetic italic slant in percent of height (30 leans the top right by 0.30 of the height, ≈16.7°, not 30°), applied as a horizontal skew when an italic tag is set. 0 falls back to DefaultItalicStyle.
Native pixel grid of a pixel-art font in pixels per em; 0 for a distance-field font. Glyphs of a pixel font rasterize once, one atlas texel per font pixel, and render with nearest sampling and hard edges; text sizes that are integer multiples of this value render pixel-exact.
Whether a pixel font's glyph origins, and every translation an effect or animation applies to its quads, round to whole font pixels. No effect when PixelsPerEm is 0.
public Dictionary<long,Glyph> GlyphLookupTable{ get }(varHash48, glyphIndex) → atlas-resident Glyph. Null until the font's lookup tables are built.
Tears down the current runtime; next Runtime access rebuilds.
public virtual UniTextFontError LoadFontFace()Loads the underlying FreeType face. Returns the resulting error code, or UniTextFontError.Success if already loaded.
public bool HasGlyphInAtlas(uint glyphIndex, UniTextRenderMode mode)Returns whether the glyph has a committed or pending entry in the selected distance-field atlas for this font's default variation.
public static UniTextFont CreateFontAsset(byte[] fontBytes)Builds a runtime UniTextFont from font file bytes, taking FaceInfo, units-per-em and the pixel grid from face 0.
Builds a font asset of the given UniTextFont subtype from font file bytes, populating its source, hash, units-per-em and face metrics identically to CreateFontAsset.
