Skip to content

Commit

Permalink
fix: Support cyrillic text in the ImGui debug menu
Browse files Browse the repository at this point in the history
  • Loading branch information
miredirex committed Apr 28, 2024
1 parent 129396f commit a7ba8e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Code/client/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ target(name)
"mem",
"xbyak")

add_cxxflags("/utf-8")

if has_config("vivox") then
add_files("Services/Vivox/**.cpp")
add_headerfiles("Services/Vivox/**.h")
Expand Down
7 changes: 5 additions & 2 deletions Code/components/imgui/ImGuiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ void ImGuiDriver::Initialize(void* apHandle)
// 1920 =
// https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-how-should-i-handle-dpi-in-my-application
auto& io = ImGui::GetIO();
io.Fonts->AddFontFromMemoryCompressedBase85TTF(Roboto_compressed_data_base85,
20.f * scaleFactor); //->Scale = scaleFactor;

auto* extraGlyphRanges = io.Fonts->GetGlyphRangesCyrillic(); // Includes Latin
io.Fonts->AddFontFromMemoryCompressedBase85TTF(Roboto_compressed_data_base85,
20.f * scaleFactor, //->Scale = scaleFactor;
nullptr, extraGlyphRanges);

ImGui::GetStyle().ScaleAllSizes(scaleFactor);
}
Expand Down

0 comments on commit a7ba8e9

Please sign in to comment.