Back to API Reference
Class

ColorFontCore

Inherits:Core

Runtime for a color font (CBDT/sbix bitmap or COLRv0/COLRv1 vector). Plain Core subclass — not a ScriptableObject; constructable on worker threads. Owns the color-glyph rasterization pipeline: color-format detection, FreeType/Blend2D rendering into the shared color atlas, and color glyph metrics. The system emoji font (EmojiFont) and the UniTextColorFont asset are both built on this base.

Derived Types(1)

Types that inherit from ColorFontCore.

public int AtlasSize{ get }

Color atlas page side in pixels (square).

public int AtlasPadding{ get }
public bool IsColor{ get }
public int ColorPixelSize{ get }

Pixel size at which color glyphs are rasterised.

protected string DiagnosticNamePrefix{ get }

Diagnostic name prefix for this runtime's Name. Lets the system emoji font keep its own label.

public int FontDataHash{ get }

Process-unique runtime identity used by the shared color atlas and shaper registries.

public static ColorFontCore CreateFromPath()

Creates a color-font runtime from a font file path (.ttf,.ttc,.otf).

protected bool LoadFromPath()

Maps a font file and loads it into this runtime. Returns false if the file cannot be opened or decoded. Shared by the system emoji font and the color-font factory.

public static ColorFontCore CreateFromData()

Creates a color-font runtime from raw font file bytes. Detects the colour format (sbix, CBDT, COLRv0/v1) and picks the closest bitmap strike to pixelSize.

protected bool LoadFromData()

Loads and configures this runtime from raw font bytes: detects the colour format (sbix, CBDT, COLRv0/v1), picks the closest bitmap strike to pixelSize, builds face metrics, and creates the shared color atlas. Returns false when the bytes cannot be loaded. Shared by the system emoji font and the color-font asset.

protected static void ConfigureFont()
public override UniTextFontError LoadFontFace()
public override bool HasGlyphInAtlas()

Returns whether the shared color atlas contains the glyph.

protected GlyphMetrics ComputeGlyphMetrics()
protected void RegisterGlyphFromAtlas()
public override void ClearDynamicData()
public override void Dispose()

Releases color-renderer face pools together with the base runtime's shaping, FreeType and atlas resources.

public void DisposeFacePool()

Releases the parallel color-renderer pool and the shared sequential FreeType face when it currently represents this font.

public static const int DefaultSize

Default color-glyph pixel size — 128 on desktop/mobile, 64 on WebGL.

protected int colorPixelSize