atlas factory Windows implementation
This commit is contained in:
34
tests/Host/Windows/SystemFontsSearchTests.cpp
Normal file
34
tests/Host/Windows/SystemFontsSearchTests.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "Base/Logger.hpp"
|
||||
#include "Host/SystemInfo.hpp"
|
||||
#include <filesystem>
|
||||
|
||||
#include "Scene/Text/FontAtlasFactory.hpp"
|
||||
#include "Host/ResourceLoader.hpp"
|
||||
|
||||
using namespace OpenVulkano;
|
||||
|
||||
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");
|
||||
REQUIRE(path.filename() == "arial.ttf");
|
||||
|
||||
// assume these fonts are present since they are default
|
||||
path = SystemInfo::GetSystemFontPath("Times New Roman");
|
||||
REQUIRE(path.filename() == "times.ttf");
|
||||
|
||||
path = SystemInfo::GetSystemFontPath("Arial Bold Italic");
|
||||
REQUIRE(path.filename() == "arialbi.ttf");
|
||||
|
||||
path = SystemInfo::GetSystemFontPath("NON-EXISTING Font");
|
||||
REQUIRE(path.empty());
|
||||
}
|
||||
Reference in New Issue
Block a user