From 1896dd5761fd3ddf5a831106bf38a2297c6081c9 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Wed, 21 Dec 2022 09:02:10 +0100 Subject: [PATCH] Disable italic font check for RaspberryPi(aka linux) --- tests/libslic3r/test_emboss.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/libslic3r/test_emboss.cpp b/tests/libslic3r/test_emboss.cpp index a045d49902..2aba5ef19a 100644 --- a/tests/libslic3r/test_emboss.cpp +++ b/tests/libslic3r/test_emboss.cpp @@ -381,9 +381,9 @@ TEST_CASE("triangle intersection", "[]") #if defined _WIN32 #define FONT_DIR_PATH "C:/Windows/Fonts"; -#elif defined __linux__ -#define FONT_DIR_PATH "/usr/share/fonts"; #endif +//#elif defined __linux__ +//#define FONT_DIR_PATH "/usr/share/fonts"; //#elif defined __APPLE__ //#define FONT_DIR_PATH "//System/Library/Fonts"; //#endif @@ -391,8 +391,10 @@ TEST_CASE("triangle intersection", "[]") #ifdef FONT_DIR_PATH #include #include -#include -namespace fs = std::filesystem; +#include +namespace fs = boost::filesystem; +//#include +//namespace fs = std::filesystem; // Check function Emboss::is_italic that exist some italic and some non-italic font. TEST_CASE("Italic check", "[Emboss]") { @@ -406,15 +408,15 @@ TEST_CASE("Italic check", "[Emboss]") dir_paths.pop(); for (const auto &entry : fs::directory_iterator(dir_path)) { const fs::path &act_path = entry.path(); - if (entry.is_directory()) { - dir_paths.push(act_path.u8string()); + if (fs::is_directory(entry)) { + dir_paths.push(act_path.string()); continue; } - std::string ext = act_path.extension().u8string(); + std::string ext = act_path.extension().string(); std::transform(ext.begin(), ext.end(), ext.begin(), [](unsigned char c) { return std::tolower(c); }); if (ext != ".ttf") continue; - std::string path_str = act_path.u8string(); + std::string path_str = act_path.string(); auto font_opt = Emboss::create_font_file(path_str.c_str()); if (font_opt == nullptr) continue;