diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 44e6c8f022..24e2ed62d8 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1822,11 +1822,13 @@ void EmuScreen::runImDebugger() { imDebugger_ = std::make_unique(); // Read the TTF font - size_t size = 0; - uint8_t *fontData = g_VFS.ReadFile("Roboto-Condensed.ttf", &size); + size_t propSize = 0; + uint8_t *propFontData = g_VFS.ReadFile("Roboto-Condensed.ttf", &propSize); + size_t fixedSize = 0; + uint8_t *fixedFontData = g_VFS.ReadFile("Inconsolata-Medium.ttf", &fixedSize); // This call works even if fontData is nullptr, in which case the font just won't get loaded. // This takes ownership of the font array. - ImGui_ImplThin3d_Init(draw, fontData, size); + ImGui_ImplThin3d_Init(draw, propFontData, propSize, fixedFontData, fixedSize); imguiInited_ = true; } diff --git a/UI/ImDebugger/ImDebugger.cpp b/UI/ImDebugger/ImDebugger.cpp index 62afba4405..3e39e2888a 100644 --- a/UI/ImDebugger/ImDebugger.cpp +++ b/UI/ImDebugger/ImDebugger.cpp @@ -381,6 +381,9 @@ void WaitIDToString(WaitType waitType, SceUID waitID, char *buffer, size_t bufSi case WAITTYPE_MICINPUT: truncate_cpy(buffer, bufSize, "-"); return; + case WAITTYPE_CTRL: + snprintf(buffer, bufSize, "ctrl: %d", waitID); + return; default: truncate_cpy(buffer, bufSize, "(unimpl)"); return; diff --git a/assets/Inconsolata-Medium.ttf b/assets/Inconsolata-Medium.ttf new file mode 100644 index 0000000000..258e6db68d Binary files /dev/null and b/assets/Inconsolata-Medium.ttf differ diff --git a/ext/imgui/imgui_impl_thin3d.cpp b/ext/imgui/imgui_impl_thin3d.cpp index 75335a2457..4bef970ed8 100644 --- a/ext/imgui/imgui_impl_thin3d.cpp +++ b/ext/imgui/imgui_impl_thin3d.cpp @@ -290,15 +290,25 @@ void ImGui_ImplThin3d_DestroyDeviceObjects() { } } -bool ImGui_ImplThin3d_Init(Draw::DrawContext *draw, const uint8_t *ttf_font, size_t size) { +bool ImGui_ImplThin3d_Init(Draw::DrawContext *draw, + const uint8_t *ttf_font_proportional, size_t proportional_size, + const uint8_t *ttf_font_fixed, size_t fixed_size) { ImGuiIO& io = ImGui::GetIO(); - if (ttf_font) { - g_proportionalFont = io.Fonts->AddFontFromMemoryTTF((void *)ttf_font, (int)size, 21.0f / g_display.dpi_scale_x, nullptr, io.Fonts->GetGlyphRangesDefault()); + g_proportionalFont = nullptr; + if (ttf_font_proportional) { + g_proportionalFont = io.Fonts->AddFontFromMemoryTTF((void *)ttf_font_proportional, (int)proportional_size, 21.0f / g_display.dpi_scale_x, nullptr, io.Fonts->GetGlyphRangesDefault()); + } + if (ttf_font_fixed) { + g_fixedFont = io.Fonts->AddFontFromMemoryTTF((void *)ttf_font_fixed, (int)fixed_size, 20.0f / g_display.dpi_scale_x, nullptr, io.Fonts->GetGlyphRangesDefault()); } else { - // fallback + g_fixedFont = io.Fonts->AddFontDefault(); + } + + if (!g_proportionalFont) { g_proportionalFont = g_fixedFont; } - g_fixedFont = io.Fonts->AddFontDefault(); + + // g_fixedFont = io.Fonts->AddFontDefault(); ImGui::GetStyle().ScaleAllSizes(1.0f / g_display.dpi_scale_x); ImGui::GetStyle().Colors[ImGuiCol_Border] = ImColor(IM_COL32(0x2A, 0x2F, 0x3B, 0xFF)); diff --git a/ext/imgui/imgui_impl_thin3d.h b/ext/imgui/imgui_impl_thin3d.h index ab42c8168d..26f8386d59 100644 --- a/ext/imgui/imgui_impl_thin3d.h +++ b/ext/imgui/imgui_impl_thin3d.h @@ -34,7 +34,9 @@ #include "Common/Math/lin/matrix4x4.h" // Called by user code. Takes ownership of the font buffer and later deletes it. -IMGUI_IMPL_API bool ImGui_ImplThin3d_Init(Draw::DrawContext *draw, const uint8_t *ttf_font, size_t size); +IMGUI_IMPL_API bool ImGui_ImplThin3d_Init(Draw::DrawContext *draw, + const uint8_t *ttf_font_proportional, size_t proportional_size, + const uint8_t *ttf_font_fixed, size_t fixed_size); IMGUI_IMPL_API void ImGui_ImplThin3d_Shutdown(); IMGUI_IMPL_API void ImGui_ImplThin3d_NewFrame(Draw::DrawContext *draw, Lin::Matrix4x4 drawMatrix); IMGUI_IMPL_API void ImGui_ImplThin3d_RenderDrawData(ImDrawData* draw_data, Draw::DrawContext *draw);