fix (fonts): load exact match

This commit is contained in:
2025-12-17 08:32:56 +03:00
parent 89888adf8d
commit 10516212bf
2 changed files with 7 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
namespace clrsync::core namespace clrsync::core
{ {
const std::string GIT_SEMVER = "0.1.4+git.g659c5f2"; const std::string GIT_SEMVER = "0.1.4+git.g89888ad";
const std::string version_string(); const std::string version_string();
} // namespace clrsync::core } // namespace clrsync::core

View File

@@ -41,7 +41,12 @@ static std::string search_registry_for_font(HKEY root_key, const char* subkey, c
std::string reg_font_name = value_name; std::string reg_font_name = value_name;
std::transform(reg_font_name.begin(), reg_font_name.end(), reg_font_name.begin(), ::tolower); std::transform(reg_font_name.begin(), reg_font_name.end(), reg_font_name.begin(), ::tolower);
if (reg_font_name.find(font_name_lower) != std::string::npos) std::string reg_font_name_clean = reg_font_name;
size_t type_pos = reg_font_name_clean.find(" (");
if (type_pos != std::string::npos)
reg_font_name_clean = reg_font_name_clean.substr(0, type_pos);
if (reg_font_name_clean == font_name_lower)
{ {
std::string font_file = reinterpret_cast<char*>(value_data); std::string font_file = reinterpret_cast<char*>(value_data);