From 74848fbd78f13dee525f3a2d814fa018e6a27a4b Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Thu, 17 Jul 2025 21:55:52 +0200 Subject: [PATCH] other font scaling --- src/td/input/Display.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/td/input/Display.cpp b/src/td/input/Display.cpp index ec3a2cc..ff37c6e 100644 --- a/src/td/input/Display.cpp +++ b/src/td/input/Display.cpp @@ -95,11 +95,16 @@ Display::Display(int a_Width, int a_Height, const std::string& a_Title) : // Setup scaling float main_scale = SDL_GetDisplayContentScale(SDL_GetPrimaryDisplay()); - ImGuiStyle& style = ImGui::GetStyle(); - style.ScaleAllSizes(main_scale); // Bake a fixed style scale. (until we have a solution for dynamic style scaling, changing this - // requires resetting Style + calling this again) - style.FontScaleDpi = main_scale; // Set initial font scale. (using io.ConfigDpiScaleFonts=true makes this unnecessary. We leave - // both here for documentation purpose) + // ImGuiStyle& style = ImGui::GetStyle(); + // style.ScaleAllSizes(main_scale); // Bake a fixed style scale. (until we have a solution for dynamic style scaling, changing this + // // requires resetting Style + calling this again) + // style.FontSizeBase = 13 * main_scale; // Set initial font scale. (using io.ConfigDpiScaleFonts=true makes this unnecessary. We leave + // // both here for documentation purpose) + + + ImFontConfig cfg; + cfg.SizePixels = 13 * main_scale * 2; + io.Fonts->AddFontDefault(&cfg); // Setup Platform/Renderer backends ImGui_ImplSDL3_InitForOpenGL(m_Window, m_GLContext);