From 5a5bac8479238ee016e2db2d049161a78eed1855 Mon Sep 17 00:00:00 2001 From: ohyzha Date: Sat, 18 Jan 2025 16:14:02 +0200 Subject: [PATCH] revert old changes --- .../Host/Linux/SystemFontResolver.cpp | 21 +++++++++++ openVulkanoCpp/Host/Linux/SystemInfo.cpp | 37 ------------------- .../Host/MacOS/SystemFontResolver.cpp | 21 +++++++++++ openVulkanoCpp/Host/MacOS/SystemInfo.mm | 5 --- .../Host/iOS/SystemFontResolver.cpp | 21 +++++++++++ openVulkanoCpp/Host/iOS/SystemInfo.mm | 5 --- 6 files changed, 63 insertions(+), 47 deletions(-) create mode 100644 openVulkanoCpp/Host/Linux/SystemFontResolver.cpp create mode 100644 openVulkanoCpp/Host/MacOS/SystemFontResolver.cpp create mode 100644 openVulkanoCpp/Host/iOS/SystemFontResolver.cpp diff --git a/openVulkanoCpp/Host/Linux/SystemFontResolver.cpp b/openVulkanoCpp/Host/Linux/SystemFontResolver.cpp new file mode 100644 index 0000000..f370d2c --- /dev/null +++ b/openVulkanoCpp/Host/Linux/SystemFontResolver.cpp @@ -0,0 +1,21 @@ +/* + * 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 "Host/SystemFontResolver.hpp" +#include + +namespace OpenVulkano +{ + std::string SystemFontResolver::GetSystemFontPath(const std::string& fontName) + { + return ""; + } + + std::map SystemFontResolver::ReadSystemFonts() + { + return {}; + } +} diff --git a/openVulkanoCpp/Host/Linux/SystemInfo.cpp b/openVulkanoCpp/Host/Linux/SystemInfo.cpp index a63d3f7..19fe0cf 100644 --- a/openVulkanoCpp/Host/Linux/SystemInfo.cpp +++ b/openVulkanoCpp/Host/Linux/SystemInfo.cpp @@ -16,9 +16,6 @@ #include #include #include -#include -#include -#include 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 fontFilesMapping; - if (fontFilesMapping.empty()) - { - const std::filesystem::path fontsDir = "/usr/share/fonts/truetype"; - std::function 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 ""; - } - } \ No newline at end of file diff --git a/openVulkanoCpp/Host/MacOS/SystemFontResolver.cpp b/openVulkanoCpp/Host/MacOS/SystemFontResolver.cpp new file mode 100644 index 0000000..f370d2c --- /dev/null +++ b/openVulkanoCpp/Host/MacOS/SystemFontResolver.cpp @@ -0,0 +1,21 @@ +/* + * 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 "Host/SystemFontResolver.hpp" +#include + +namespace OpenVulkano +{ + std::string SystemFontResolver::GetSystemFontPath(const std::string& fontName) + { + return ""; + } + + std::map SystemFontResolver::ReadSystemFonts() + { + return {}; + } +} diff --git a/openVulkanoCpp/Host/MacOS/SystemInfo.mm b/openVulkanoCpp/Host/MacOS/SystemInfo.mm index db95584..d404d08 100644 --- a/openVulkanoCpp/Host/MacOS/SystemInfo.mm +++ b/openVulkanoCpp/Host/MacOS/SystemInfo.mm @@ -202,9 +202,4 @@ namespace OpenVulkano { return InterfaceOrientation::Landscape; //TODO? } - - std::string SystemInfo::GetSystemFontPath(const std::string& fontName) - { - return ""; - } } diff --git a/openVulkanoCpp/Host/iOS/SystemFontResolver.cpp b/openVulkanoCpp/Host/iOS/SystemFontResolver.cpp new file mode 100644 index 0000000..f370d2c --- /dev/null +++ b/openVulkanoCpp/Host/iOS/SystemFontResolver.cpp @@ -0,0 +1,21 @@ +/* + * 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 "Host/SystemFontResolver.hpp" +#include + +namespace OpenVulkano +{ + std::string SystemFontResolver::GetSystemFontPath(const std::string& fontName) + { + return ""; + } + + std::map SystemFontResolver::ReadSystemFonts() + { + return {}; + } +} diff --git a/openVulkanoCpp/Host/iOS/SystemInfo.mm b/openVulkanoCpp/Host/iOS/SystemInfo.mm index 17b7855..f19455f 100644 --- a/openVulkanoCpp/Host/iOS/SystemInfo.mm +++ b/openVulkanoCpp/Host/iOS/SystemInfo.mm @@ -288,9 +288,4 @@ namespace OpenVulkano } return InterfaceOrientation::Landscape; } - - std::string SystemInfo::GetSystemFontPath(const std::string& fontName) - { - return ""; - } }