diff --git a/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf b/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf index 930e7cff..edb3d970 100644 --- a/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf +++ b/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf @@ -360,20 +360,20 @@ namespace Beefy.theme.dark mHeaderFont.AddAlternate(scope String(BFApp.sApp.mInstallDir, "fonts/seguihis.ttf"), 11.7f * sScale);*/ mHeaderFont.Load("Segoe UI", 11.7f * sScale); //8.8 - mHeaderFont.AddAlternate("Segoe UI Symbol", 11.7f * sScale); + mHeaderFont.AddAlternate("Segoe UI Symbol", 11.7f * sScale).IgnoreError(); mHeaderFont.AddAlternate("Segoe UI Historic", 11.7f * sScale).IgnoreError(); mHeaderFont.AddAlternate("Segoe UI Emoji", 11.7f * sScale).IgnoreError(); mSmallFont.Dispose(true); mSmallFont.Load("Segoe UI", 12.8f * sScale); // 10.0 - mSmallFont.AddAlternate("Segoe UI Symbol", 12.8f * sScale); + mSmallFont.AddAlternate("Segoe UI Symbol", 12.8f * sScale).IgnoreError(); mSmallFont.AddAlternate("Segoe UI Historic", 12.8f * sScale).IgnoreError(); mSmallFont.AddAlternate("Segoe UI Emoji", 12.8f * sScale).IgnoreError(); mSmallBoldFont.Dispose(true); mSmallBoldFont.Dispose(true); mSmallBoldFont.Load("Segoe UI Bold", 12.8f * sScale); // 10.0 - mSmallBoldFont.AddAlternate("Segoe UI Symbol", 12.8f * sScale); + mSmallBoldFont.AddAlternate("Segoe UI Symbol", 12.8f * sScale).IgnoreError(); mSmallBoldFont.AddAlternate("Segoe UI Historic", 12.8f * sScale).IgnoreError(); mSmallBoldFont.AddAlternate("Segoe UI Emoji", 12.8f * sScale).IgnoreError(); /*mSmallBoldFont.Load(StringAppend!(tempStr, BFApp.sApp.mInstallDir, "fonts/segoeuib.ttf"), 12.8f * sScale); // 10.0 diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index 7c7c2dd2..b66d2f23 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -4368,6 +4368,9 @@ namespace IDE void ShowPanel(Panel panel, String label, bool setFocus = true) { + if (!mInitialized) + return; + mLastActivePanel = panel; RecordHistoryLocation(); ShowTab(panel, label, false, setFocus); @@ -10646,19 +10649,22 @@ namespace IDE float fontSize = DarkTheme.sScale * mSettings.mEditorSettings.mFontSize; float tinyFontSize = fontSize * 8.0f/9.0f; - bool failed = false; + String err = scope String(); void FontFail(StringView name) { - String err = scope String()..AppendF("Failed to load font '{}'", name); - OutputErrorLine(err); - if (!failed) - Fail(err); - failed = true; + if (!err.IsEmpty) + err.Append("\n"); + err.AppendF("Failed to load font '{}'", name); } bool isFirstFont = true; - for (let fontName in mSettings.mEditorSettings.mFonts) + for (var fontName in mSettings.mEditorSettings.mFonts) + FontLoop: { + bool isOptional; + if (isOptional = fontName.StartsWith("?")) + fontName = scope:FontLoop String(fontName, "?".Length); + if (isFirstFont) { mTinyCodeFont.Dispose(true); @@ -10670,7 +10676,7 @@ namespace IDE else { mTinyCodeFont.AddAlternate(fontName, tinyFontSize).IgnoreError(); - if (mCodeFont.AddAlternate(fontName, fontSize) case .Err) + if ((mCodeFont.AddAlternate(fontName, fontSize) case .Err) && (!isOptional)) FontFail(fontName); } } @@ -10685,12 +10691,12 @@ namespace IDE if (mCodeFont.GetWidth('😊') == 0) { mCodeFont.AddAlternate("Segoe UI", fontSize); - mCodeFont.AddAlternate("Segoe UI Symbol", fontSize); + mCodeFont.AddAlternate("Segoe UI Symbol", fontSize).IgnoreError(); mCodeFont.AddAlternate("Segoe UI Historic", fontSize).IgnoreError(); mCodeFont.AddAlternate("Segoe UI Emoji", fontSize).IgnoreError(); mTinyCodeFont.AddAlternate("Segoe UI", tinyFontSize); - mTinyCodeFont.AddAlternate("Segoe UI Symbol", tinyFontSize); + mTinyCodeFont.AddAlternate("Segoe UI Symbol", tinyFontSize).IgnoreError(); mTinyCodeFont.AddAlternate("Segoe UI Historic", tinyFontSize).IgnoreError(); mTinyCodeFont.AddAlternate("Segoe UI Emoji", tinyFontSize).IgnoreError(); @@ -10703,6 +10709,12 @@ namespace IDE mTinyCodeFont.AddAlternate(new String("fonts/seguihis.ttf"), tinyFontSize);*/ } + if (!err.IsEmpty) + { + OutputErrorLine(err); + Fail(err); + } + //mTinyCodeFont.Load(scope String(BFApp.sApp.mInstallDir, "fonts/SourceCodePro-Regular.ttf"), fontSize); float squiggleScale = DarkTheme.sScale; diff --git a/IDE/src/Settings.bf b/IDE/src/Settings.bf index c8ed8b63..88519861 100644 --- a/IDE/src/Settings.bf +++ b/IDE/src/Settings.bf @@ -354,9 +354,9 @@ namespace IDE { mFonts.Add(new String("fonts/SourceCodePro-Regular.ttf")); mFonts.Add(new String("Segoe UI")); - mFonts.Add(new String("Segoe UI Symbol")); - mFonts.Add(new String("Segoe UI Historic")); - mFonts.Add(new String("Segoe UI Emoji")); + mFonts.Add(new String("?Segoe UI Symbol")); + mFonts.Add(new String("?Segoe UI Historic")); + mFonts.Add(new String("?Segoe UI Emoji")); } public void Apply()