mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
cleanup font size
This commit is contained in:
@@ -705,8 +705,8 @@ void ImGuiToolkit::SetFont(ImGuiToolkit::font_style style, const std::string &tt
|
||||
ImFontConfig font_config;
|
||||
fontname.copy(font_config.Name, 40);
|
||||
font_config.FontDataOwnedByAtlas = false; // data will be copied in font atlas
|
||||
font_config.OversampleH = 7;
|
||||
font_config.OversampleV = 3;
|
||||
font_config.OversampleH = 5;
|
||||
font_config.OversampleV = 5;
|
||||
|
||||
// read font in Resource manager
|
||||
size_t data_size = 0;
|
||||
|
||||
@@ -376,6 +376,7 @@ float Rendering::MonitorHeight()
|
||||
GLFWmonitor *monitor = glfwGetWindowMonitor (main_window_);
|
||||
if (!monitor)
|
||||
monitor = glfwGetPrimaryMonitor ();
|
||||
// TODO : detect in which monitor is the main window and return the height for that monitor
|
||||
int xpos, ypos, width, height;
|
||||
glfwGetMonitorWorkarea(monitor, &xpos, &ypos, &width, &height);
|
||||
|
||||
|
||||
@@ -153,8 +153,9 @@ bool UserInterface::Init()
|
||||
// Setup Dear ImGui style
|
||||
ImGuiToolkit::SetAccentColor(static_cast<ImGuiToolkit::accent_color>(Settings::application.accent_color));
|
||||
|
||||
// Load Fonts (using resource manager, NB: a temporary copy of the raw data is necessary)
|
||||
// Estalish the base size from the resolution of the monitor
|
||||
float base_font_size = (Rendering::manager().MonitorHeight() * Rendering::manager().DPIScale()) / 100.f ;
|
||||
// Load Fonts (using resource manager, NB: a temporary copy of the raw data is necessary)
|
||||
ImGuiToolkit::SetFont(ImGuiToolkit::FONT_DEFAULT, "Roboto-Regular", int(base_font_size) );
|
||||
ImGuiToolkit::SetFont(ImGuiToolkit::FONT_BOLD, "Roboto-Bold", int(base_font_size) );
|
||||
ImGuiToolkit::SetFont(ImGuiToolkit::FONT_ITALIC, "Roboto-Italic", int(base_font_size) );
|
||||
@@ -164,8 +165,7 @@ bool UserInterface::Init()
|
||||
|
||||
// info
|
||||
Log::Info("Monitor (%.1f,%.1f)", Rendering::manager().MonitorWidth(), Rendering::manager().MonitorHeight());
|
||||
Log::Info("DPI Scale %.1f", Rendering::manager().DPIScale());
|
||||
Log::Info("Font size %.1f", base_font_size);
|
||||
Log::Info("Font size %df", int(base_font_size) );
|
||||
|
||||
// Style
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
|
||||
Reference in New Issue
Block a user