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
#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 <string>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
//#include <filesystem>
//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;