mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 02:15:55 +08:00
Automatic addition of missing glyphs: require extra frame when chars are added
This commit is contained in:
parent
ccd8910442
commit
5fac6934ec
@ -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
|
||||
|
||||
|
@ -32,7 +32,6 @@ namespace GUI {
|
||||
class ImGuiWrapper
|
||||
{
|
||||
std::vector<std::tuple<std::string, const ImWchar*, bool>> 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 };
|
||||
|
Loading…
x
Reference in New Issue
Block a user