Back to API Reference
Class

EmojiFont

Font asset specialized for color emoji rendering using FreeType or browser APIs.

Remarks

EmojiFont extends UniTextFont to provide native color emoji support across all platforms. It uses FreeType for desktop/mobile and browser Canvas API for WebGL. The class provides a singleton Instance that automatically loads the system emoji font. Custom emoji fonts can be created via factory methods. Key features: Automatic system emoji font detection on Windows, macOS, iOS, Android, Linux Dynamic atlas population with shelf-based packing Parallel glyph rendering using FreeType face pool WebGL support via browser Canvas 2D rendering
public static bool Disabled{ get; set }

Gets or sets whether emoji rendering is globally disabled.

public int AtlasSize{ get }

Gets the atlas texture size in pixels (square).

public int AtlasPadding{ get }

Atlas padding for emoji glyph UV sampling (gutter inside tile prevents bilinear bleeding).

public static Material Material{ get }

Gets the shared material for emoji rendering (Texture2DArray shader).

public static EmojiFont Instance{ get }

Gets the singleton emoji font instance, creating it if necessary.

public static bool IsAvailable{ get }

Returns true if emoji rendering is available on this platform.

public int EmojiPixelSize{ get }

Gets the pixel size used for rendering emoji glyphs.

public bool HasFontData{ get }
public int FontDataHash{ get }
public byte[] FontData{ get }
public static void EnsureInitialized()

Ensures the singleton instance and material are initialized.

public static EmojiFont CreateFromPath(string fontPath, int faceIndex, int pixelSize)

Creates an emoji font from a file path.

public static EmojiFont CreateFromData(byte[] fontData, int faceIndex, int pixelSize, string sourceName)

Creates an emoji font from raw font data bytes.

public override int GetCachedInstanceId()
public override UniTextFontError LoadFontFace()
public override long EstimateTileArea()
public override void ClearDynamicData()
public void DisposeFacePool()

Disposes the FreeType face pool and COLRv1 renderer pool used for parallel glyph rendering.

public static const int FontId

Reserved font ID for the emoji font (-1).

public static const int DefaultSize

Default emoji pixel size (128 on desktop/mobile, 64 on WebGL).

public static Action DisableChanged

Raised when the Disabled property changes.

See Also