From ea04c746fd5ac561be2da4702b1e77116172b627 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Tue, 7 May 2024 21:17:23 +0300 Subject: [PATCH] Fix Editor not launching if custom interface fonts are missing --- Source/Editor/Options/OptionsModule.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/Editor/Options/OptionsModule.cs b/Source/Editor/Options/OptionsModule.cs index debc0a663..5a7aa886f 100644 --- a/Source/Editor/Options/OptionsModule.cs +++ b/Source/Editor/Options/OptionsModule.cs @@ -255,6 +255,17 @@ namespace FlaxEditor.Options } } + // Ensure custom fonts are valid, reset if not + var defaultInterfaceOptions = new InterfaceOptions(); + if (Style.Current.FontTitle == null) + Style.Current.FontTitle = defaultInterfaceOptions.TitleFont.GetFont(); + if (Style.Current.FontSmall == null) + Style.Current.FontSmall = defaultInterfaceOptions.SmallFont.GetFont(); + if (Style.Current.FontMedium == null) + Style.Current.FontMedium = defaultInterfaceOptions.MediumFont.GetFont(); + if (Style.Current.FontLarge == null) + Style.Current.FontLarge = defaultInterfaceOptions.LargeFont.GetFont(); + // Set fallback fonts var fallbackFonts = Options.Interface.FallbackFonts; if (fallbackFonts == null || fallbackFonts.Length == 0 || fallbackFonts.All(x => x == null))