From 8700c12cc0e92f603e4e3505e70072aa4c89e789 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Fri, 6 Sep 2024 14:03:48 +0200 Subject: [PATCH] Fix for: https://github.com/prusa3d/PrusaSlicer/commit/70a9520cc3e2caf5f9062eac565cc3a297b881a5#r146291258 --- src/libslic3r/Emboss.cpp | 2 +- tests/libslic3r/test_emboss.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Emboss.cpp b/src/libslic3r/Emboss.cpp index ad4093e43c..8613682bbf 100644 --- a/src/libslic3r/Emboss.cpp +++ b/src/libslic3r/Emboss.cpp @@ -1090,7 +1090,7 @@ std::unique_ptr Emboss::create_font_file( std::unique_ptr Emboss::create_font_file(const char *file_path) { - FILE *file = std::fopen(file_path, "rb"); + FILE *file = boost::nowide::fopen(file_path, "rb"); if (file == nullptr) { assert(false); BOOST_LOG_TRIVIAL(error) << "Couldn't open " << file_path << " for reading."; diff --git a/tests/libslic3r/test_emboss.cpp b/tests/libslic3r/test_emboss.cpp index df5a80dc04..40f448f732 100644 --- a/tests/libslic3r/test_emboss.cpp +++ b/tests/libslic3r/test_emboss.cpp @@ -103,12 +103,13 @@ std::string get_font_filepath() { // Explicit horror include (used to be implicit) - libslic3r "officialy" does not depend on imgui. #include "../../bundled_deps/imgui/imgui/imstb_truetype.h" // stbtt_fontinfo +#include "boost/nowide/cstdio.hpp" TEST_CASE("Read glyph C shape from font, stb library calls ONLY", "[Emboss]") { std::string font_path = get_font_filepath(); char letter = 'C'; // Read font file - FILE *file = fopen(font_path.c_str(), "rb"); + FILE *file = boost::nowide::fopen(font_path.c_str(), "rb"); REQUIRE(file != nullptr); // find size of file REQUIRE(fseek(file, 0L, SEEK_END) == 0);