Add system font matcher.

This commit is contained in:
2023-02-02 18:35:18 +08:00
parent bd256ba1a6
commit b407ba88c4
17 changed files with 792 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
using Cryville.Audio;
using Cryville.Audio.Source;
using Cryville.Common;
using Cryville.Common.Font;
using Cryville.Common.Unity;
using Cryville.Common.Unity.Input;
using Cryville.Common.Unity.UI;
@@ -128,7 +129,16 @@ namespace Cryville.Crtr {
Settings.Default.LastRunVersion = Application.version;
Settings.Default.Save();
Logger.Log("main", 1, "UI", "Initializing font manager");
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
TMPAutoFont.FontManager = new FontManagerWindows();
TMPAutoFont.DefaultShader = Resources.Load<Shader>("TextMesh Pro/Shaders/TMP_SDF SSD");
#elif UNITY_ANDROID
TMPAutoFont.FontManager = new FontManagerAndroid();
TMPAutoFont.DefaultShader = Resources.Load<Shader>("TextMesh Pro/Shaders/TMP_SDF-Mobile SSD");
#else
#error No font manager initialization logic.
#endif
Logger.Log("main", 1, "Game", "Initialized");
}