Enable better font, increase oversampling and allow user scaling
@@ -315,8 +315,16 @@ bool D3D12::InitializeImGui(size_t aBuffersCounts)
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
ImGui::StyleColorsDark();
- io.Fonts->AddFontDefault();
- io.IniFilename = NULL;
+ io.IniFilename = nullptr;
+ io.FontAllowUserScaling = true;
+ ImFontConfig fontCfg{};
+ fontCfg.SizePixels = 20.0f;
+ fontCfg.OversampleH = 5;
+ fontCfg.OversampleV = 5;
+ if (std::filesystem::exists(_T("C:\\Windows\\Fonts\\SegoeUI.ttf")))
+ io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\SegoeUI.ttf", 20.0f, &fontCfg);
+ else
+ io.Fonts->AddFontDefault(&fontCfg);
}
if (!ImGui_ImplWin32_Init(Window::Get().GetWindow()))
