fix font resolution when not explicitly adding regular
This commit is contained in:
@@ -17,8 +17,12 @@ namespace OpenVulkano
|
||||
// fontName -> fontPath
|
||||
static std::map<std::string, std::string> fontFilesMapping = ReadSystemFonts();
|
||||
static std::string fallbackString;
|
||||
auto it = fontFilesMapping.find(Utils::ToLower(fontName));
|
||||
return it == fontFilesMapping.end() ? fallbackString : it->second;
|
||||
std::string fontNameLower = Utils::ToLower(fontName);
|
||||
auto it = fontFilesMapping.find(fontNameLower);
|
||||
if (it != fontFilesMapping.end()) return it->second;
|
||||
it = fontFilesMapping.find(fontNameLower + " regular");
|
||||
if (it != fontFilesMapping.end()) return it->second;
|
||||
return fallbackString;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> SystemFontResolver::ReadSystemFonts()
|
||||
|
||||
Reference in New Issue
Block a user