diff --git a/src/qt/dash.cpp b/src/qt/dash.cpp index e22daa30a4ea..fd0e31715b09 100644 --- a/src/qt/dash.cpp +++ b/src/qt/dash.cpp @@ -272,9 +272,6 @@ bool BitcoinCore::baseInitialize() { return false; } - if (!GUIUtil::loadFonts()) { - return false; - } return true; } @@ -693,7 +690,12 @@ int main(int argc, char *argv[]) app.parameterSetup(); // Load GUI settings from QSettings app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false)); - + // Load custom application fonts and setup font management + if (!GUIUtil::loadFonts()) { + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QObject::tr("Error: Failed to load application fonts.")); + return EXIT_FAILURE; + } // Validate/set font family if (gArgs.IsArgSet("-font-family")) { GUIUtil::FontFamily family; diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 6d75c56c52a6..99773d28498c 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -1183,7 +1183,7 @@ bool loadFonts() // Fail if an added id is -1 which means QFontDatabase::addApplicationFont failed. if (std::find(vecFontIds.begin(), vecFontIds.end(), -1) != vecFontIds.end()) { - return InitError("Font loading failed."); + return false; } // Print debug logs for added fonts fetched by the added ids