mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-08 20:19:04 +03:00
fix (fonts): load exact match
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
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();
|
||||
} // namespace clrsync::core
|
||||
|
||||
@@ -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::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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user