1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

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
parent 7a92842017
commit 8542d1da5a
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)); }