Disable italic font check for RaspberryPi(aka linux)

This commit is contained in:
Filip Sykala - NTB T15p 2022-12-21 09:02:10 +01:00
parent a080e83e88
commit 1896dd5761

View File

@ -381,9 +381,9 @@ TEST_CASE("triangle intersection", "[]")
#if defined _WIN32 #if defined _WIN32
#define FONT_DIR_PATH "C:/Windows/Fonts"; #define FONT_DIR_PATH "C:/Windows/Fonts";
#elif defined __linux__
#define FONT_DIR_PATH "/usr/share/fonts";
#endif #endif
//#elif defined __linux__
//#define FONT_DIR_PATH "/usr/share/fonts";
//#elif defined __APPLE__ //#elif defined __APPLE__
//#define FONT_DIR_PATH "//System/Library/Fonts"; //#define FONT_DIR_PATH "//System/Library/Fonts";
//#endif //#endif
@ -391,8 +391,10 @@ TEST_CASE("triangle intersection", "[]")
#ifdef FONT_DIR_PATH #ifdef FONT_DIR_PATH
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <filesystem> #include <boost/filesystem.hpp>
namespace fs = std::filesystem; namespace fs = boost::filesystem;
//#include <filesystem>
//namespace fs = std::filesystem;
// Check function Emboss::is_italic that exist some italic and some non-italic font. // Check function Emboss::is_italic that exist some italic and some non-italic font.
TEST_CASE("Italic check", "[Emboss]") TEST_CASE("Italic check", "[Emboss]")
{ {
@ -406,15 +408,15 @@ TEST_CASE("Italic check", "[Emboss]")
dir_paths.pop(); dir_paths.pop();
for (const auto &entry : fs::directory_iterator(dir_path)) { for (const auto &entry : fs::directory_iterator(dir_path)) {
const fs::path &act_path = entry.path(); const fs::path &act_path = entry.path();
if (entry.is_directory()) { if (fs::is_directory(entry)) {
dir_paths.push(act_path.u8string()); dir_paths.push(act_path.string());
continue; continue;
} }
std::string ext = act_path.extension().u8string(); std::string ext = act_path.extension().string();
std::transform(ext.begin(), ext.end(), ext.begin(), std::transform(ext.begin(), ext.end(), ext.begin(),
[](unsigned char c) { return std::tolower(c); }); [](unsigned char c) { return std::tolower(c); });
if (ext != ".ttf") continue; 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()); auto font_opt = Emboss::create_font_file(path_str.c_str());
if (font_opt == nullptr) continue; if (font_opt == nullptr) continue;