mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 10:47:50 -06:00
FIX: German Umlaut's not usable (3D Text Tool) STUDIO-2515
Change-Id: I193cb00f86476ed9088d69426ed17816a9df8de5
This commit is contained in:
parent
24657f9145
commit
5bb35c3086
1 changed files with 10 additions and 3 deletions
|
@ -21,6 +21,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include <imgui/imgui_internal.h>
|
#include <imgui/imgui_internal.h>
|
||||||
#include "libslic3r/SVG.hpp"
|
#include "libslic3r/SVG.hpp"
|
||||||
|
#include <codecvt>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
@ -1378,6 +1379,11 @@ TriangleMesh GLGizmoText::get_text_mesh(const char* text_str, const Vec3d &posit
|
||||||
Vec3d new_text_dir = project_on_plane(text_up_dir, normal);
|
Vec3d new_text_dir = project_on_plane(text_up_dir, normal);
|
||||||
new_text_dir.normalize();
|
new_text_dir.normalize();
|
||||||
Geometry::rotation_from_two_vectors(old_text_dir, new_text_dir, rotation_axis, phi, &rotation_matrix);
|
Geometry::rotation_from_two_vectors(old_text_dir, new_text_dir, rotation_axis, phi, &rotation_matrix);
|
||||||
|
|
||||||
|
static double const PI = 3.141592653589793238;
|
||||||
|
if (abs(phi - PI) < EPSILON)
|
||||||
|
rotation_axis = normal;
|
||||||
|
|
||||||
mesh.rotate(phi, rotation_axis);
|
mesh.rotate(phi, rotation_axis);
|
||||||
|
|
||||||
const Selection & selection = m_parent.get_selection();
|
const Selection & selection = m_parent.get_selection();
|
||||||
|
@ -1439,10 +1445,11 @@ void GLGizmoText::generate_text_volume(bool is_temp)
|
||||||
if (text.empty())
|
if (text.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
std::wstring_convert<std::codecvt_utf8<wchar_t>> str_cnv;
|
||||||
|
std::wstring ws = boost::nowide::widen(m_text);
|
||||||
std::vector<std::string> alphas;
|
std::vector<std::string> alphas;
|
||||||
if (!get_utf8_sub_strings(m_text, strlen(m_text), alphas)) {
|
for (auto w : ws) {
|
||||||
BOOST_LOG_TRIVIAL(info) << boost::format("Text: input text is not utf8");
|
alphas.push_back(str_cnv.to_bytes(w));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update_text_positions(alphas);
|
update_text_positions(alphas);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue