From d912270c74a283b37580902292d55dbf0c53674e Mon Sep 17 00:00:00 2001 From: ohyzha Date: Mon, 20 Jan 2025 13:17:32 +0200 Subject: [PATCH] remove unnecessary try catch block --- .../Scene/Text/FontAtlasFactory.cpp | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/openVulkanoCpp/Scene/Text/FontAtlasFactory.cpp b/openVulkanoCpp/Scene/Text/FontAtlasFactory.cpp index 5b60fbc..d28c5d9 100644 --- a/openVulkanoCpp/Scene/Text/FontAtlasFactory.cpp +++ b/openVulkanoCpp/Scene/Text/FontAtlasFactory.cpp @@ -88,21 +88,19 @@ namespace OpenVulkano::Scene Array FontAtlasFactory::FindFont(const std::string& fontIdentifier) const { - try + Array resource = ResourceLoader::GetInstance().GetResource(fontIdentifier); + if (resource.Empty()) { - return ResourceLoader::GetInstance().GetResource(fontIdentifier); - } - catch (...) - { - } - if (!std::filesystem::exists(fontIdentifier)) - { - if (!m_allowSystemFonts) + if (!std::filesystem::exists(fontIdentifier)) { - return {}; + if (!m_allowSystemFonts) + { + return {}; + } + return Utils::ReadFile(SystemFontResolver::GetSystemFontPath(fontIdentifier), true); } - return Utils::ReadFile(SystemFontResolver::GetSystemFontPath(fontIdentifier), true); + return Utils::ReadFile(fontIdentifier); } - return Utils::ReadFile(fontIdentifier); + return resource; } }