LocalizedFont
A serializable reference to a localized font asset.
Read time 2 minutesLast updated 12 days ago
Definition
- Type: Class
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
- Inherits from: LocalizedAsset<Font>
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.
Additional Resources: LocalizedAsset<TObject>, ResourceDatabase
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); } }}