mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-29 12:49:05 +00:00
LibGfx: Remove unused ScaledFont::glyph_or_emoji_width()
This commit is contained in:
parent
8502420401
commit
eb7e12887e
Notes:
github-actions[bot]
2024-09-06 19:43:39 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: eb7e12887e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1300
3 changed files with 0 additions and 16 deletions
|
@ -77,7 +77,6 @@ public:
|
|||
|
||||
virtual u32 glyph_id_for_code_point(u32 code_point) const = 0;
|
||||
virtual float glyph_width(u32 code_point) const = 0;
|
||||
virtual float glyph_or_emoji_width(Utf8CodePointIterator&) const = 0;
|
||||
virtual int x_height() const = 0;
|
||||
virtual float preferred_line_height() const = 0;
|
||||
|
||||
|
|
|
@ -68,20 +68,6 @@ float ScaledFont::glyph_width(u32 code_point) const
|
|||
return measure_text_width(Utf8View(string), *this);
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
return font.glyph_width(*it);
|
||||
}
|
||||
|
||||
float ScaledFont::glyph_or_emoji_width(Utf8CodePointIterator& it) const
|
||||
{
|
||||
return glyph_or_emoji_width_impl(*this, it);
|
||||
}
|
||||
|
||||
NonnullRefPtr<ScaledFont> ScaledFont::scaled_with_size(float point_size) const
|
||||
{
|
||||
if (point_size == m_point_height && point_size == m_point_width)
|
||||
|
|
|
@ -30,7 +30,6 @@ public:
|
|||
virtual u16 weight() const override { return m_typeface->weight(); }
|
||||
virtual bool contains_glyph(u32 code_point) const override { return m_typeface->glyph_id_for_code_point(code_point) > 0; }
|
||||
virtual float glyph_width(u32 code_point) const override;
|
||||
virtual float glyph_or_emoji_width(Utf8CodePointIterator&) const override;
|
||||
virtual u32 glyph_id_for_code_point(u32 code_point) const override { return m_typeface->glyph_id_for_code_point(code_point); }
|
||||
virtual float preferred_line_height() const override { return metrics().height() + metrics().line_gap; }
|
||||
virtual int x_height() const override { return m_point_height; } // FIXME: Read from font
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue