diff --git a/scwx-qt/source/scwx/qt/manager/font_manager.cpp b/scwx-qt/source/scwx/qt/manager/font_manager.cpp index 05d9e79e..8472b69f 100644 --- a/scwx-qt/source/scwx/qt/manager/font_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/font_manager.cpp @@ -261,10 +261,24 @@ FontManager::LoadImGuiFont(const std::string& family, return it->second; } + // Define a name for the ImGui font + std::string fontName; + try + { + fontName = fmt::format( + "{}:{}", + std::filesystem::path(fontRecord.filename_).filename().string(), + imFontSize.value()); + } + catch (const std::exception& ex) + { + logger_->warn(ex.what()); + fontName = fmt::format("{}:{}", fontRecord.filename_, imFontSize.value()); + } + // Create an ImGui font std::shared_ptr imguiFont = - std::make_shared( - fontRecord.filename_, rawFontData, imFontSize); + std::make_shared(fontName, rawFontData, imFontSize); // Store the ImGui font p->imguiFonts_.insert_or_assign(imguiFontKey, imguiFont);