1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Merge pull request #4633 from Laserlicht/xbrz_fix

fix xbrz font fallback
This commit is contained in:
Ivan Savenko 2024-09-21 17:46:12 +03:00 committed by GitHub
commit 8a18d92a8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,7 +96,7 @@ size_t CTrueTypeFont::getGlyphWidth(const char *data) const
size_t CTrueTypeFont::getStringWidth(const std::string & data) const
{
if (fallbackFont && fallbackFont->canRepresentString(data))
return fallbackFont->getStringWidth(data) / getScalingFactor();
return fallbackFont->getStringWidth(data);
int width;
TTF_SizeUTF8(font.get(), data.c_str(), &width, nullptr);