1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

LibGfx: Inline BitmapFont::glyph_or_emoji_width() for fixed-width fonts

This commit is contained in:
Andreas Kling 2021-06-14 11:20:39 +02:00
parent 6e0e8a8242
commit add3d6e9d7
2 changed files with 8 additions and 5 deletions

View file

@ -242,7 +242,7 @@ Glyph BitmapFont::glyph(u32 code_point) const
m_glyph_height);
}
int BitmapFont::glyph_or_emoji_width(u32 code_point) const
int BitmapFont::glyph_or_emoji_width_for_variable_width_font(u32 code_point) const
{
if (code_point < m_glyph_count) {
if (m_glyph_widths[code_point] > 0)
@ -251,9 +251,6 @@ int BitmapFont::glyph_or_emoji_width(u32 code_point) const
return glyph_width('?');
}
if (m_fixed_width)
return m_glyph_width;
auto* emoji = Emoji::emoji_for_code_point(code_point);
if (emoji == nullptr)
return glyph_width('?');