different improvements

This commit is contained in:
ohyzha
2025-01-18 13:26:37 +02:00
parent dbc52eff42
commit a5a1fd99d5
9 changed files with 168 additions and 137 deletions

View File

@@ -6,7 +6,7 @@
#include <catch2/catch_all.hpp>
#include "Base/Logger.hpp"
#include "Host/SystemInfo.hpp"
#include "Host/SystemFontResolver.hpp"
#include <filesystem>
#include "Scene/Text/FontAtlasFactory.hpp"
@@ -18,16 +18,16 @@ TEST_CASE("Search system fonts")
Logger::SetupLogger("", "tests.log");
// assume these fonts are present since they are default
std::filesystem::path path = SystemInfo::GetSystemFontPath("Arial");
std::filesystem::path path = SystemFontResolver::GetSystemFontPath("Arial");
REQUIRE(path.filename() == "arial.ttf");
// assume these fonts are present since they are default
path = SystemInfo::GetSystemFontPath("Times New Roman");
path = SystemFontResolver::GetSystemFontPath("Times New Roman");
REQUIRE(path.filename() == "times.ttf");
path = SystemInfo::GetSystemFontPath("Arial Bold Italic");
path = SystemFontResolver::GetSystemFontPath("Arial Bold Italic");
REQUIRE(path.filename() == "arialbi.ttf");
path = SystemInfo::GetSystemFontPath("NON-EXISTING Font");
path = SystemFontResolver::GetSystemFontPath("NON-EXISTING Font");
REQUIRE(path.empty());
}