Tweak imgui font size & hinting

This commit is contained in:
Luke Street 2022-02-09 02:08:07 -05:00
parent bd6aaddf1a
commit 339d2a9d5e
4 changed files with 5 additions and 12 deletions

View File

@ -627,7 +627,7 @@ void ImGuiConsole::ShowAboutWindow(bool canClose, std::string_view errorString)
ImGui::PopStyleColor();
ImGui::Dummy(padding);
}
ImGuiTextCenter("2015-2021");
ImGuiTextCenter("2015-2022");
ImGui::BeginGroup();
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 255, 255, 200));
ImGuiStringViewText("Development & Research");

View File

@ -23,7 +23,7 @@ target_link_libraries(imgui PRIVATE boo hecl-light RetroDataSpec aurora)
find_package(Freetype)
if (FREETYPE_FOUND)
target_sources(imgui PRIVATE ../extern/imgui/misc/freetype/imgui_freetype.cpp)
target_compile_definitions(imgui PUBLIC IMGUI_ENABLE_FREETYPE)
target_compile_definitions(imgui PRIVATE IMGUI_ENABLE_FREETYPE)
target_link_libraries(imgui PRIVATE Freetype::Freetype)
endif ()

View File

@ -36,15 +36,13 @@ void ImGuiEngine_Initialize(float scale) {
ImFontConfig fontConfig{};
fontConfig.FontData = fontData;
fontConfig.FontDataSize = int(NOTO_MONO_FONT_DECOMPRESSED_SZ);
fontConfig.SizePixels = std::floor(14.f * scale);
#ifdef IMGUI_ENABLE_FREETYPE
fontConfig.FontBuilderFlags = ImGuiFreeTypeBuilderFlags_LightHinting;
#endif
fontConfig.SizePixels = std::floor(15.f * scale);
snprintf(static_cast<char*>(fontConfig.Name), sizeof(fontConfig.Name), "Noto Mono Regular, %dpx",
static_cast<int>(fontConfig.SizePixels));
ImGuiEngine::fontNormal = io.Fonts->AddFont(&fontConfig);
fontConfig.FontDataOwnedByAtlas = false; // first one took ownership
fontConfig.SizePixels = std::floor(24.f * scale);
fontConfig.SizePixels = std::floor(26.f * scale);
#ifdef IMGUI_ENABLE_FREETYPE
fontConfig.FontBuilderFlags |= ImGuiFreeTypeBuilderFlags_Bold;
snprintf(static_cast<char*>(fontConfig.Name), sizeof(fontConfig.Name), "Noto Mono Bold, %dpx",

View File

@ -4,12 +4,7 @@
#include "misc/cpp/imgui_stdlib.h"
#include <memory>
//#include <boo/IWindow.hpp>
//#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
namespace metaforce {
constexpr inline int TranslateBooSpecialKey(boo::ESpecialKey key) { return 256 + static_cast<int>(key); }
class ImGuiEngine {
public:
static ImFont* fontNormal;