reimplement system fonts retrieval for Linux using fontconfig
This commit is contained in:
@@ -5,9 +5,8 @@
|
||||
*/
|
||||
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "Host/SystemFontResolver.hpp"
|
||||
#include "Base/Logger.hpp"
|
||||
#include "Host/SystemInfo.hpp"
|
||||
#include "Scene/Text/FontAtlasFactory.hpp"
|
||||
#include <filesystem>
|
||||
|
||||
using namespace OpenVulkano;
|
||||
@@ -17,12 +16,12 @@ TEST_CASE("Search system fonts")
|
||||
Logger::SetupLogger("", "tests.log");
|
||||
|
||||
// assume these fonts are present since they are default
|
||||
std::filesystem::path path = SystemInfo::GetSystemFontPath("Ubuntu-R");
|
||||
std::string path = SystemFontResolver::GetSystemFontPath("Ubuntu Regular");
|
||||
REQUIRE(path == "/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf");
|
||||
|
||||
path = SystemInfo::GetSystemFontPath("UbuntuMono-BI");
|
||||
REQUIRE(!path.empty());
|
||||
path = SystemFontResolver::GetSystemFontPath("Ubuntu Mono Bold Italic");
|
||||
REQUIRE(path == "/usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf");
|
||||
|
||||
path = SystemInfo::GetSystemFontPath("NON-EXISTING Font");
|
||||
path = SystemFontResolver::GetSystemFontPath("NON-EXISTING Font");
|
||||
REQUIRE(path.empty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user