LibGfx: Remove code point parameter from Gfx::Font::Metrics

Everyone was asking for the glyph width of 'M' anyway. We can just make
that request implicit and simplify the API.
This commit is contained in:
Andreas Kling 2022-03-28 11:57:44 +02:00
commit 2f7b6af87e
Notes: sideshowbarker 2024-07-17 22:41:14 +09:00
5 changed files with 9 additions and 9 deletions

View file

@ -372,12 +372,12 @@ Font const& Font::bold_variant() const
return *m_bold_variant;
}
FontMetrics Font::metrics(u32 code_point) const
FontMetrics Font::metrics() const
{
return FontMetrics {
.size = (float)presentation_size(),
.x_height = (float)x_height(),
.glyph_width = (float)glyph_width(code_point),
.glyph_width = (float)glyph_width('M'),
.glyph_spacing = (float)glyph_spacing(),
};
}