From ba23bfa4716bed87ca1f21b8fb7045c75b1de236 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:55:19 +0200 Subject: [PATCH] Recast: set font to DroidSans The original font the navigation editor shipped with. --- src/naveditor/include/DroidSans.h | 4 ++-- src/naveditor/main.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/naveditor/include/DroidSans.h b/src/naveditor/include/DroidSans.h index bb1f2599..3679f7ba 100644 --- a/src/naveditor/include/DroidSans.h +++ b/src/naveditor/include/DroidSans.h @@ -3,8 +3,8 @@ // File: 'DroidSans.ttf' (108796 bytes) // Exported using binary_to_compressed_c.cpp -static const unsigned int droidsans_size = 108796; -static const unsigned int droidsans_data[108796 / 4] = +static const unsigned int g_droidSansDataSize = 108796; +static const unsigned int g_droidSansData[108796 / 4] = { 0x00000100, 0x00011100, 0x10000400, 0x4853544c, 0xcab629e9, 0x3c0b0000, 0x55020000, 0x322f534f, 0x5855839f, 0x98010000, 0x60000000, 0x70616d63, 0x22df2fb7, 0xd8390000, 0xf0030000, 0x20747663, 0xc03d9239, 0xb0470000, 0xfc010000, 0x6d677066, 0xb023d373, 0xc83d0000, 0x05070000, 0x70736167, diff --git a/src/naveditor/main.cpp b/src/naveditor/main.cpp index 20896ea2..308eaebf 100644 --- a/src/naveditor/main.cpp +++ b/src/naveditor/main.cpp @@ -205,6 +205,12 @@ bool imgui_init(SDL_Window* window, SDL_Renderer* /*renderer*/, SDL_GLContext co return false; } + ImFontConfig fontCfg; + ImGuiIO& imguiIo = ImGui::GetIO(); + + fontCfg.FontDataOwnedByAtlas = false; + imguiIo.Fonts->AddFontFromMemoryTTF((void*)g_droidSansData, g_droidSansDataSize, 15, &fontCfg); + return true; }