From bd6bd6ec3dca03f0c2a86d8876642a2326966ad2 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Tue, 31 Jan 2023 13:28:52 +0100 Subject: [PATCH] Add checking that wx font face name is setabled(fix for MacOs where default font is not enumerated) --- src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index cd0c2cc20..9f2d46545 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -1038,6 +1038,13 @@ EmbossStyles GLGizmoEmboss::create_default_styles() // Not all predefined font for wx must be valid TTF, but at least one style must be loadable styles.erase(std::remove_if(styles.begin(), styles.end(), [](const EmbossStyle& style) { wxFont wx_font = WxFontUtils::create_wxFont(style); + + // check that face name is setabled + wxFont wx_font_temp; + if (!wx_font_temp.SetFaceName(wx_font.GetFaceName())) + return true; + + // Check that exsit valid TrueType Font for wx font return WxFontUtils::create_font_file(wx_font) == nullptr; }),styles.end() );