revert old changes
This commit is contained in:
@@ -16,9 +16,6 @@
|
||||
#include <sys/utsname.h>
|
||||
#include <unistd.h>
|
||||
#include <thread>
|
||||
#include <filesystem>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
|
||||
namespace OpenVulkano
|
||||
{
|
||||
@@ -397,38 +394,4 @@ namespace OpenVulkano
|
||||
{
|
||||
return InterfaceOrientation::Landscape; // TODO?
|
||||
}
|
||||
|
||||
std::string SystemInfo::GetSystemFontPath(const std::string& fontName)
|
||||
{
|
||||
// fontName -> fontPath
|
||||
static std::map<std::string, std::string> fontFilesMapping;
|
||||
if (fontFilesMapping.empty())
|
||||
{
|
||||
const std::filesystem::path fontsDir = "/usr/share/fonts/truetype";
|
||||
std::function<void(const std::filesystem::path)> GetFontFiles;
|
||||
GetFontFiles = [&](const std::filesystem::path& dir)
|
||||
{
|
||||
for (const auto& file : std::filesystem::directory_iterator(dir))
|
||||
{
|
||||
if (file.is_directory())
|
||||
{
|
||||
GetFontFiles(dir / file);
|
||||
}
|
||||
else if (file.path().extension() == ".ttf")
|
||||
{
|
||||
// store font name without extension
|
||||
fontFilesMapping[file.path().stem()] = file.path();
|
||||
}
|
||||
}
|
||||
};
|
||||
GetFontFiles(fontsDir);
|
||||
}
|
||||
|
||||
if (fontFilesMapping.contains(fontName))
|
||||
{
|
||||
return fontFilesMapping.at(fontName);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user