add monospaced font to devtools

This commit is contained in:
Vinicius Rangel 2024-10-02 01:36:24 -03:00
parent 964cbeb367
commit 4f76aa843d
No known key found for this signature in database
GPG key ID: A5B154D904B761D9
6 changed files with 15 additions and 2 deletions

View file

@ -74,6 +74,12 @@ precedence = "aggregate"
SPDX-FileCopyrightText = "2012 Google Inc. All Rights Reserved."
SPDX-License-Identifier = "OFL-1.1"
[[annotations]]
path = "src/imgui/renderer/fonts/ProggyVector-Regular.ttf"
precedence = "aggregate"
SPDX-FileCopyrightText = "Copyright (c) 2004, 2005 Tristan Grimmer"
SPDX-License-Identifier = "MIT"
[[annotations]]
path = "externals/gcn/include/**"
SPDX-FileCopyrightText = "NONE"

View file

@ -204,7 +204,7 @@ void L::Draw() {
}
if (show_advanced_debug) {
PushFont(io.Fonts->Fonts[0]);
PushFont(io.Fonts->Fonts[IMGUI_FONT_MONO]);
PushID("DevtoolsLayer");
DrawAdvanced();
PopID();

View file

@ -10,6 +10,9 @@
#define IM_COL32_GRAY(x) IM_COL32(x, x, x, 0xFF)
#define IMGUI_FONT_TEXT 0
#define IMGUI_FONT_MONO 1
namespace ImGui {
namespace Easing {

View file

@ -7,6 +7,7 @@ add_executable(Dear_ImGui_FontEmbed ${CMAKE_SOURCE_DIR}/externals/dear_imgui/mis
set(FONT_LIST
NotoSansJP-Regular.ttf
ProggyVector-Regular.ttf
)
set(OutputList "")

Binary file not shown.

View file

@ -17,6 +17,7 @@
#include "video_core/renderer_vulkan/renderer_vulkan.h"
#include "imgui_fonts/notosansjp_regular.ttf.g.cpp"
#include "imgui_fonts/proggyvector_regular.ttf.g.cpp"
static void CheckVkResult(const vk::Result err) {
LOG_ERROR(ImGui, "Vulkan error {}", vk::to_string(err));
@ -75,10 +76,12 @@ void Initialize(const ::Vulkan::Instance& instance, const Frontend::WindowSDL& w
ImFontConfig font_cfg{};
font_cfg.OversampleH = 2;
font_cfg.OversampleV = 1;
io.Fonts->AddFontDefault();
io.FontDefault = io.Fonts->AddFontFromMemoryCompressedTTF(
imgui_font_notosansjp_regular_compressed_data,
imgui_font_notosansjp_regular_compressed_size, 16.0f, &font_cfg, ranges.Data);
io.Fonts->AddFontFromMemoryCompressedTTF(imgui_font_proggyvector_regular_compressed_data,
imgui_font_proggyvector_regular_compressed_size,
16.0f);
StyleColorsDark();