From fae3e7a86211417b4579490a7a66d4d24187bdd9 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 21 Dec 2024 14:52:03 +0100 Subject: [PATCH] fix: macos font multiplier (#5775) --- CHANGELOG.md | 1 + src/singletons/Fonts.cpp | 49 +++++++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5287388c..a6710e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unversioned - Bugfix: Fixed scrollbar highlights being visible in overlay windows. (#5769) +- Bugfix: Make macos fonts look the same as v2.5.1. (#5775) - Dev: Hard-code Boost 1.86.0 in macos CI builders. (#5774) ## 2.5.2-beta.1 diff --git a/src/singletons/Fonts.cpp b/src/singletons/Fonts.cpp index 7afe081e..343b3233 100644 --- a/src/singletons/Fonts.cpp +++ b/src/singletons/Fonts.cpp @@ -139,20 +139,43 @@ Fonts::FontData Fonts::createFontData(FontStyle type, float scale) // normal Ui font (use pt size) { -#ifdef Q_OS_MAC - constexpr float multiplier = 0.8f; -#else - constexpr float multiplier = 1.f; -#endif - static std::unordered_map defaultSize{ - {FontStyle::Tiny, {8, "Monospace", false, QFont::Normal}}, - {FontStyle::UiMedium, - {int(9 * multiplier), DEFAULT_FONT_FAMILY, false, QFont::Normal}}, - {FontStyle::UiMediumBold, - {int(9 * multiplier), DEFAULT_FONT_FAMILY, false, QFont::Bold}}, - {FontStyle::UiTabs, - {int(9 * multiplier), DEFAULT_FONT_FAMILY, false, QFont::Normal}}, + { + FontStyle::Tiny, + { + 8, + "Monospace", + false, + QFont::Normal, + }, + }, + { + FontStyle::UiMedium, + { + 9, + DEFAULT_FONT_FAMILY, + false, + QFont::Normal, + }, + }, + { + FontStyle::UiMediumBold, + { + 9, + DEFAULT_FONT_FAMILY, + false, + QFont::Bold, + }, + }, + { + FontStyle::UiTabs, + { + 9, + DEFAULT_FONT_FAMILY, + false, + QFont::Normal, + }, + }, }; UiFontData &data = defaultSize[type];