impr: Remove (TrueType) from the end of all font names on windows

This commit is contained in:
WerWolv
2025-07-26 16:00:25 +02:00
parent a67788ac52
commit a8d61ed534

View File

@@ -379,6 +379,11 @@ namespace hex {
if (fontPath.is_relative())
fontPath = std::fs::path("C:\\Windows\\Fonts") / fontPath;
// Windows appends (TrueType) to all font names for some reason. Remove it
if (fontName.ends_with(" (TrueType)")) {
fontName = fontName.substr(0, fontName.size() - 12);
}
registerFont(fontName.c_str(), wolv::util::toUTF8String(fontPath).c_str());
}