mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
LibGfx: Skip old-style emoji lookup for fonts that have color bitmaps
Ultimately, we should find a way to route all emoji access through the font code, but for now, this patch adds a special case for fonts that are known to have embedded color bitmaps so we can test them.
This commit is contained in:
parent
924d23353e
commit
552895da60
2 changed files with 6 additions and 3 deletions
|
@ -107,8 +107,10 @@ float ScaledFont::glyph_width(u32 code_point) const
|
|||
template<typename CodePointIterator>
|
||||
static float glyph_or_emoji_width_impl(ScaledFont const& font, CodePointIterator& it)
|
||||
{
|
||||
if (auto const* emoji = Emoji::emoji_for_code_point_iterator(it))
|
||||
return font.pixel_size() * emoji->width() / emoji->height();
|
||||
if (!font.has_color_bitmaps()) {
|
||||
if (auto const* emoji = Emoji::emoji_for_code_point_iterator(it))
|
||||
return font.pixel_size() * emoji->width() / emoji->height();
|
||||
}
|
||||
|
||||
return font.glyph_width(*it);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue