LibGfx: Always scale emojis to fit font height

This commit is contained in:
Maciej 2022-01-21 18:48:47 +01:00 committed by Linus Groh
commit 8542d1da5a
Notes: sideshowbarker 2024-07-17 20:29:49 +09:00
2 changed files with 8 additions and 12 deletions

View file

@ -314,7 +314,7 @@ int BitmapFont::glyph_or_emoji_width_for_variable_width_font(u32 code_point) con
auto* emoji = Emoji::emoji_for_code_point(code_point);
if (emoji == nullptr)
return glyph_width(0xFFFD);
return emoji->size().width();
return glyph_height() * emoji->width() / emoji->height();
}
int BitmapFont::width(StringView view) const { return unicode_view_width(Utf8View(view)); }