/* * 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 #include "Host/SystemFontResolver.hpp" #include "Base/Logger.hpp" #include using namespace OpenVulkano; TEST_CASE("Search system fonts") { Logger::SetupLogger("", "tests.log"); // assume these fonts are present since they are default std::string path = SystemFontResolver::GetSystemFontPath("Ubuntu Regular"); REQUIRE(path == "/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf"); path = SystemFontResolver::GetSystemFontPath("ubuntu regular"); REQUIRE(path == "/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf"); path = SystemFontResolver::GetSystemFontPath("Ubuntu Mono Bold Italic"); REQUIRE(path == "/usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf"); path = SystemFontResolver::GetSystemFontPath("ubuntu mono bold italic"); REQUIRE(path == "/usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf"); path = SystemFontResolver::GetSystemFontPath("NON-EXISTING Font"); REQUIRE(path.empty()); }