add fallback strings
This commit is contained in:
@@ -11,7 +11,8 @@ namespace OpenVulkano
|
||||
{
|
||||
const std::string& SystemFontResolver::GetSystemFontPath(const std::string& fontName)
|
||||
{
|
||||
return "";
|
||||
static std::string fallbackString;
|
||||
return fallbackString;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> SystemFontResolver::ReadSystemFonts()
|
||||
|
||||
@@ -17,8 +17,9 @@ namespace OpenVulkano
|
||||
{
|
||||
// font name -> filename
|
||||
static std::map<std::string, std::string> fontFileMapping = ReadSystemFonts();
|
||||
static std::string fallbackString;
|
||||
auto it = fontFileMapping.find(Utils::ToLower(fontName));
|
||||
return it == fontFileMapping.end() ? "" : it->second;
|
||||
return it == fontFileMapping.end() ? fallbackString : it->second;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> SystemFontResolver::ReadSystemFonts()
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
|
||||
namespace OpenVulkano
|
||||
{
|
||||
std::string SystemFontResolver::GetSystemFontPath(const std::string& fontName)
|
||||
const std::string& SystemFontResolver::GetSystemFontPath(const std::string& fontName)
|
||||
{
|
||||
return "";
|
||||
static std::string fallbackString;
|
||||
return fallbackString;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> SystemFontResolver::ReadSystemFonts()
|
||||
|
||||
Reference in New Issue
Block a user