Add font fallback

Note: All the `First()` in the code are temperary workarounds to make it work and require refractoring
This commit is contained in:
ExMatics HydrogenC
2023-11-28 07:17:46 +08:00
parent b3a18883ca
commit 47a25c7828
47 changed files with 787 additions and 87 deletions

View File

@@ -237,12 +237,18 @@ namespace FlaxEditor.Options
public int NumberOfGameClientsToLaunch = 1;
private static FontAsset DefaultFont => FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.PrimaryFont);
private static FontAsset _cjkFont => FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.CJKFont);
private FontReference _titleFont = new FontReference(DefaultFont, 18);
private FontReference _largeFont = new FontReference(DefaultFont, 14);
private FontReference _mediumFont = new FontReference(DefaultFont, 9);
private FontReference _smallFont = new FontReference(DefaultFont, 9);
private FontReference _outputLogFont = new FontReference(FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.InconsolataRegularFont), 10);
public FontReference CJKFont
{
get => new FontReference(_cjkFont, 9);
}
/// <summary>
/// Gets or sets the title font for editor UI.
/// </summary>