Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LocalizedFontAsset

A serializable reference to a localized font asset for UI Toolkit text.
Read time 2 minutesLast updated 5 days ago

Definition

public class LocalizedFontAsset : LocalizedAsset<FontAsset>

Remarks

A LocalizedFontAsset is a LocalizedAsset<TObject> specialized for FontAsset, so it can be serialized and shown in the Inspector. Use it for UI Toolkit text, and LocalizedFont for legacy text.
Load a localized font asset.

Examples

using Unity.Localization;using UnityEngine;using UnityEngine.TextCore.Text;namespace Unity.Localization.Samples{ public class LocalizedFontAssetExample { public async Awaitable Load() { var localizedFontAsset = new LocalizedFontAsset(); localizedFontAsset.SetReference("My Assets", "UI FONT ASSET"); FontAsset fontAsset = await localizedFontAsset.GetLocalizedAssetAsync(); if (fontAsset != null) Debug.Log(fontAsset.name); } }}

Inheritance