ColorFontCore
Runtime for a color font (CBDT/sbix bitmap or COLRv0/COLRv1 vector). Plain UniTextFont.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. A glyph an effect decorates also gets a silhouette field in the SDF atlas, derived from the same bitmap's alpha when it is packed.
Derived Types(2)
Types that inherit from ColorFontCore.
Diagnostic name prefix for this runtime's UniTextFont.Core.Name. Lets the system emoji font keep its own label.
public static ColorFontCore CreateFromPath(string fontPath, int faceIndex = 0, int pixelSize = DefaultSize)Creates a color-font runtime from a font file path (.ttf,.ttc,.otf).
public static ColorFontCore CreateFromData(byte[] fontData, int faceIndex = 0, int pixelSize = DefaultSize, string sourceName = null)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(byte[] fontData, int faceIndex, int pixelSize, string sourceName = null)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(ColorFontCore font, int fontUpem, int pixelSize, int[] availableSizes, short fontAscender = 0, short fontDescender = 0)public override UniTextFontError LoadFontFace()public override bool HasGlyphInAtlas(uint glyphIndex, UniTextRenderMode mode)Returns whether the shared color atlas contains the glyph.
protected virtual GlyphMetrics ComputeGlyphMetrics(uint glyphIndex, ColorFontCore.RenderedGlyphData rendered, bool renderedByCOLRv1 = false)Design-unit metrics of a rendered bitmap. The bitmap's pixel-to-design ratio follows the colour format: the COLRv1 render size, the sbix strike, the CBDT advance, or the requested pixel size. The advance is the font's own, or the rasterizer's measured advance for a font with no face to measure.
protected void RegisterGlyphFromAtlas(uint glyphIndex, GlyphAtlas.GlyphEntry entry)