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
+2 -1
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FlaxEditor.GUI.Tabs;
using FlaxEditor.Modules;
using FlaxEditor.SceneGraph.Actors;
@@ -147,7 +148,7 @@ namespace FlaxEditor.Tools.Foliage
Parent = _noFoliagePanel,
Enabled = false
};
var textSize = Style.Current.FontMedium.MeasureText(buttonText);
var textSize = Style.Current.FontMedium.First().MeasureText(buttonText);
if (_createNewFoliage.Width < textSize.X)
{
_createNewFoliage.LocalX -= (textSize.X - _createNewFoliage.Width) / 2;
+2 -1
View File
@@ -1,6 +1,7 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
using FlaxEditor.GUI.Tabs;
using FlaxEditor.Modules;
using FlaxEditor.SceneGraph.Actors;
@@ -105,7 +106,7 @@ namespace FlaxEditor.Tools.Terrain
Parent = _noTerrainPanel,
Enabled = false
};
var textSize = Style.Current.FontMedium.MeasureText(buttonText);
var textSize = Style.Current.FontMedium.First().MeasureText(buttonText);
if (_createTerrainButton.Width < textSize.X)
{
_createTerrainButton.LocalX -= (textSize.X - _createTerrainButton.Width) / 2;