From 4bac9aee8df26df78514d80b807069a9b0cad262 Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 4 Feb 2022 23:07:30 -0500 Subject: [PATCH] feat: reset font if fallback triggered --- ChatTwo/PluginUi.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ChatTwo/PluginUi.cs b/ChatTwo/PluginUi.cs index c293343..2f0ffa1 100755 --- a/ChatTwo/PluginUi.cs +++ b/ChatTwo/PluginUi.cs @@ -128,7 +128,9 @@ internal sealed class PluginUi : IDisposable { } if (fontData == null) { - PluginLog.Warning("global fallback"); + this.Plugin.Config.GlobalFont = Fonts.GlobalFonts[0].Name; + this.Plugin.SaveConfig(); + var globalFont = Fonts.GlobalFonts[0]; fontData = new FontData(this.GetResource(globalFont.ResourcePath), this.GetResource(globalFont.ResourcePathItalic)); } @@ -164,7 +166,9 @@ internal sealed class PluginUi : IDisposable { // } if (jpFontData == null) { - PluginLog.Warning("jp fallback"); + this.Plugin.Config.JapaneseFont = Fonts.JapaneseFonts[0].Item1; + this.Plugin.SaveConfig(); + var jpFont = Fonts.JapaneseFonts[0]; jpFontData = new FontData(this.GetResource(jpFont.Item2), Array.Empty()); }