diff --git a/src/libslic3r/Emboss.cpp b/src/libslic3r/Emboss.cpp index dc4c33e4a..e67bf4d8e 100644 --- a/src/libslic3r/Emboss.cpp +++ b/src/libslic3r/Emboss.cpp @@ -750,9 +750,17 @@ std::string Emboss::create_range_text(const std::string &text, ws.erase(std::remove_if(ws.begin(), ws.end(), [&prev_unicode, font_info, exist_unknown](wchar_t wc) -> bool { int unicode = static_cast(wc); - // is duplicit + + // skip white spaces + if (unicode == '\n' || + unicode == '\r' || + unicode == '\t') return true; + + // is duplicit? if (prev_unicode == unicode) return true; prev_unicode = unicode; + + // can find in font? bool is_unknown = !stbtt_FindGlyphIndex(font_info, unicode); if (is_unknown && exist_unknown != nullptr) *exist_unknown = true; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index 08d08ec48..c5fa0010b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -990,6 +990,10 @@ void GLGizmoEmboss::draw_text_input() tool_tip += t; } }; + if (m_text.empty() || + m_text.find_first_not_of(" \n\t\r") == std::string::npos) + append_warning(_u8L("Empty"), + _u8L("Embossed text can NOT contain only white spaces.")); if (m_text_contain_unknown_glyph) append_warning(_u8L("Bad symbol"), _u8L("Text contain character glyph (represented by '?') unknown by font."));