diff --git a/rtgui/rtscalable.h b/rtgui/rtscalable.h index a182dd2e0..e6180eaa1 100644 --- a/rtgui/rtscalable.h +++ b/rtgui/rtscalable.h @@ -42,9 +42,11 @@ public: #ifdef __APPLE__ static constexpr double baseDPI = 72.; static constexpr double baseHiDPI = 144.; + static constexpr int baseFontSize = 12; #else static constexpr double baseDPI = 96.; static constexpr double baseHiDPI = 192.; + static constexpr int baseFontSize = 9; #endif static void init(Gtk::Window *window); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index ce1d5151a..4e5c6f753 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -170,7 +170,7 @@ RTWindow::RTWindow () css = Glib::ustring::compose ("* { font-family: %1; font-size: %2pt}", options.fontFamily, options.fontSize * (int)initialGdkScale); #endif //GTK318 - fontScale = options.fontSize / 9.f; + fontScale = options.fontSize / (float)RTScalable::baseFontSize; if (options.rtSettings.verbose) { printf("\"Non-Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", options.fontSize, (int)initialGdkScale, fontScale); } @@ -192,12 +192,12 @@ RTWindow::RTWindow () // 1pt = 1/72in @ 96 ppi // HOMBRE: If the font unit is px, is it already scaled up to match the resolution ? // px >inch >pt >"scaled pt" - pt = (int)(double(fontSize) / RTScalable::baseDPI * 72. * (RTScalable::baseDPI / resolution) + 0.49); + pt = (int)(double(fontSize) / RTScalable::baseDPI * 72. * (96. / (double)resolution) + 0.49); } else { pt = fontSize / Pango::SCALE; } - fontScale = (float)pt / 9.f; - if ((int)initialGdkScale > 1 || pt != 9) { + fontScale = (float)pt / (float)RTScalable::baseFontSize; + if ((int)initialGdkScale > 1 || pt != RTScalable::baseFontSize) { css = Glib::ustring::compose ("* { font-size: %1pt}", pt * (int)initialGdkScale); if (options.rtSettings.verbose) { printf("\"Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", pt, (int)initialGdkScale, fontScale);