diff --git a/BeefySysLib/gfx/FTFont.cpp b/BeefySysLib/gfx/FTFont.cpp index 49a4b55f..36460849 100644 --- a/BeefySysLib/gfx/FTFont.cpp +++ b/BeefySysLib/gfx/FTFont.cpp @@ -143,19 +143,19 @@ bool FTFont::Load(const StringImpl& fileName, float pointSize) *facePtr = face; face->mFileName = fileName; - FT_Face ftFace; - auto error = FT_New_Face(gFTLibrary, fileName.c_str(), 0, &ftFace); - if (error != FT_Err_Ok) - return false; + FT_Face ftFace = NULL; + auto error = FT_New_Face(gFTLibrary, fileName.c_str(), 0, &ftFace); face->mFTFace = ftFace; } else { face = *facePtr; } - mFace = face; + if (face->mFTFace == NULL) + return false; - + mFace = face; + FTFontManager::FaceSize** faceSizePtr = NULL; if (face->mFaceSizes.TryAdd(pointSize, NULL, &faceSizePtr)) { diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index fe11002f..05814c7f 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -7893,7 +7893,7 @@ namespace IDE } else // Actual build { - if ((projectSource.HasChangedSinceLastCompile) || (forceQueue)) + if ((projectSource.HasChangedSinceLastCompile) || (projectSource.mLoadFailed) || (forceQueue)) { // mHasChangedSinceLastCompile is safe to set 'false' here since it just determines whether or not // we rebuild the TypeDefs from the sources. It isn't affected by any compilation errors. @@ -10517,6 +10517,16 @@ namespace IDE float fontSize = DarkTheme.sScale * mSettings.mEditorSettings.mFontSize; float tinyFontSize = fontSize * 8.0f/9.0f; + bool failed = false; + void FontFail(StringView name) + { + String err = scope String()..AppendF("Failed to load font '{}'", name); + OutputErrorLine(err); + if (!failed) + Fail(err); + failed = true; + } + bool isFirstFont = true; for (let fontName in mSettings.mEditorSettings.mFonts) { @@ -10525,12 +10535,14 @@ namespace IDE mTinyCodeFont.Dispose(true); isFirstFont = !mTinyCodeFont.Load(fontName, tinyFontSize); mCodeFont.Dispose(true); - mCodeFont.Load(fontName, fontSize); + if (!mCodeFont.Load(fontName, fontSize)) + FontFail(fontName); } else { mTinyCodeFont.AddAlternate(fontName, tinyFontSize).IgnoreError(); - mCodeFont.AddAlternate(fontName, fontSize).IgnoreError(); + if (mCodeFont.AddAlternate(fontName, fontSize) case .Err) + FontFail(fontName); } } @@ -11118,7 +11130,7 @@ namespace IDE msg.Clear(); if (!mBfBuildCompiler.PopMessage(msg)) break; - OutputLine(msg); + OutputLineSmart(msg); } if (mBfResolveSystem != null)