From b0b9e01bb1111fa71450d7a2bffc7e116a7ca77e Mon Sep 17 00:00:00 2001 From: Daniel Bauer Date: Tue, 11 Aug 2026 21:19:49 +0200 Subject: [PATCH] FontManager: Don't warn of not found font if no filename was given. In some configurations the default font is simply specified by leaving the config field empty. The current behavior is warning about not having font file "" and informing of the default font being used. Imo the only usecase where this warning is useful if a fontfile was actually set. To prevent overexaustion of warnings not related this change only prints out a warning if the font to load is actually not empty. --- src/ngscopeclient/FontManager.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ngscopeclient/FontManager.cpp b/src/ngscopeclient/FontManager.cpp index 356aed27f..47b4c8845 100644 --- a/src/ngscopeclient/FontManager.cpp +++ b/src/ngscopeclient/FontManager.cpp @@ -95,11 +95,14 @@ bool FontManager::UpdateFonts(PreferenceCategory& root) fclose(fp); else { - LogWarning( - "Could not find font file \"%s\" requested in preferences database. " - "Using default font \"%s\" instead\n", - fname.c_str(), - defaultFontPath.c_str()); + // No need to warn the user if nothing is specified + if(fname.size() != 0) { + LogWarning( + "Could not find font file \"%s\" requested in preferences database. " + "Using default font \"%s\" instead\n", + fname.c_str(), + defaultFontPath.c_str()); + } fname = defaultFontPath; }