Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LocalizedFont

A serializable reference to a localized font asset.
Read time 2 minutesLast updated 12 days ago

Definition

public class LocalizedFont : LocalizedAsset<Font>

Remarks

A LocalizedFont is a LocalizedAsset<TObject> specialized for Font, so it can be serialized and shown in the Inspector. Use it to switch typeface with the locale, which a language with a different script needs.
Load a localized font.

Examples

using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class LocalizedFontExample { public async Awaitable Load() { var localizedFont = new LocalizedFont(); localizedFont.SetReference("My Assets", "UI FONT"); Font font = await localizedFont.GetLocalizedAssetAsync(); if (font != null) Debug.Log(font.name); } }}

Inheritance