Fix of #8171: Two Chinese characters added into the range to load for ImGui

This commit is contained in:
Lukas Matena 2022-04-08 16:32:38 +02:00
parent ed71887e35
commit 6288ec4bf0

View File

@ -1066,6 +1066,15 @@ void ImGuiWrapper::init_font(bool compress)
ImVector<ImWchar> ranges; ImVector<ImWchar> ranges;
ImFontAtlas::GlyphRangesBuilder builder; ImFontAtlas::GlyphRangesBuilder builder;
builder.AddRanges(m_glyph_ranges); builder.AddRanges(m_glyph_ranges);
if (m_font_cjk) {
// This is a temporary fix of https://github.com/prusa3d/PrusaSlicer/issues/8171. The translation
// contains characters not in the ImGui ranges for simplified Chinese. For now, just add them manually.
// In future, it might be worth to parse the dictionary and add all the necessary characters.
builder.AddChar(ImWchar(0x5ED3));
builder.AddChar(ImWchar(0x8F91));
}
#ifdef __APPLE__ #ifdef __APPLE__
if (m_font_cjk) if (m_font_cjk)
// Apple keyboard shortcuts are only contained in the CJK fonts. // Apple keyboard shortcuts are only contained in the CJK fonts.