From 02822ba458b9670b6553d74371ea6411a7a933c5 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Fri, 7 Mar 2025 14:42:19 +0100 Subject: [PATCH] Fix loading glyphs for zh_TW --- client/render/imgui_impl.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/client/render/imgui_impl.cpp b/client/render/imgui_impl.cpp index edfcedce..c38be677 100644 --- a/client/render/imgui_impl.cpp +++ b/client/render/imgui_impl.cpp @@ -552,18 +552,17 @@ void imgui_context::initialize_fonts() ImWchar default_ranges[] = {0x20, 0x7f, 0xa0, 0xff, 0}; glyph_range_builder.AddRanges(default_ranges); - for (auto language = application::get_messages_info().language; language != ""; language = language.substr(0, language.size() - 1)) { - auto it = glyph_set_per_language.find(language); + const auto & locale = application::get_messages_info(); + auto it = glyph_set_per_language.find(locale.language + "_" + locale.country); if (it == glyph_set_per_language.end()) - continue; + it = glyph_set_per_language.find(locale.language); - for (ImWchar c: it->second) + if (it != glyph_set_per_language.end()) { - glyph_range_builder.AddChar(c); + for (ImWchar c: it->second) + glyph_range_builder.AddChar(c); } - - break; } glyph_range_builder.BuildRanges(&glyph_ranges);