From 220b08b8682b9a69a7363a002036b644f1334b12 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 26 May 2023 19:33:09 +0100 Subject: [PATCH] Change: Include font style in font name for Freetype. --- src/crashlog.cpp | 8 ++++---- src/fontcache/freetypefontcache.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/crashlog.cpp b/src/crashlog.cpp index c080ec241c..35f0076bde 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -185,10 +185,10 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const " Medium: %s\n" " Large: %s\n" " Mono: %s\n\n", - FontCache::Get(FS_SMALL)->GetFontName(), - FontCache::Get(FS_NORMAL)->GetFontName(), - FontCache::Get(FS_LARGE)->GetFontName(), - FontCache::Get(FS_MONO)->GetFontName() + FontCache::Get(FS_SMALL)->GetFontName().c_str(), + FontCache::Get(FS_NORMAL)->GetFontName().c_str(), + FontCache::Get(FS_LARGE)->GetFontName().c_str(), + FontCache::Get(FS_MONO)->GetFontName().c_str() ); buffer += seprintf(buffer, last, "AI Configuration (local: %i) (current: %i):\n", (int)_local_company, (int)_current_company); diff --git a/src/fontcache/freetypefontcache.cpp b/src/fontcache/freetypefontcache.cpp index 1bde653f94..0ff2a6eb66 100644 --- a/src/fontcache/freetypefontcache.cpp +++ b/src/fontcache/freetypefontcache.cpp @@ -41,7 +41,7 @@ public: ~FreeTypeFontCache(); void ClearFontCache() override; GlyphID MapCharToGlyph(WChar key) override; - std::string GetFontName() override { return face->family_name; } + std::string GetFontName() override { return fmt::format("{}, {}", face->family_name, face->style_name); } bool IsBuiltInFont() override { return false; } };