From 5fac6934ec9d3707cb60590bc10683ab4eef5db2 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 6 Jun 2024 13:15:10 +0200 Subject: [PATCH] Automatic addition of missing glyphs: require extra frame when chars are added --- src/slic3r/GUI/ImGuiWrapper.cpp | 11 +---------- src/slic3r/GUI/ImGuiWrapper.hpp | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index bd513bc1d7..d0b0ea9c3b 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -407,6 +407,7 @@ void ImGuiWrapper::render() // If there were some characters that ImGui was unable to render, we will destroy current font. // It will be rebuilt in the next call of new_frame including these. destroy_font(); + this->set_requires_extra_frame(); } } @@ -1176,16 +1177,6 @@ void ImGuiWrapper::init_font(bool compress) } } -#ifdef __APPLE__ - ImFontConfig config; - config.MergeMode = true; - if (! m_font_cjk) { - // Apple keyboard shortcuts are only contained in the CJK fonts. - [[maybe_unused]]ImFont *font_cjk = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/NotoSansCJK-Regular.ttc").c_str(), m_font_size, &config, ranges_keyboard_shortcuts); - assert(font_cjk != nullptr); - } -#endif - float font_scale = m_font_size/15; int icon_sz = lround(16 * font_scale); // default size of icon is 16 px diff --git a/src/slic3r/GUI/ImGuiWrapper.hpp b/src/slic3r/GUI/ImGuiWrapper.hpp index 9873318099..37c1bec55f 100644 --- a/src/slic3r/GUI/ImGuiWrapper.hpp +++ b/src/slic3r/GUI/ImGuiWrapper.hpp @@ -32,7 +32,6 @@ namespace GUI { class ImGuiWrapper { std::vector> m_lang_glyphs_info; // language prefix, ranges, whether it needs CLK font - const ImWchar* m_notosans_regular_ranges; const ImWchar* m_glyph_ranges{ nullptr }; // Chinese, Japanese, Korean float m_font_size{ 18.0 };