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

LibGfx: Introduce with_size method for Font

This commit is contained in:
Aliaksandr Kalenik 2023-02-09 11:55:05 +03:00 committed by Linus Groh
parent d910dd345e
commit 1cc8895e4b
5 changed files with 16 additions and 0 deletions

View file

@ -123,6 +123,11 @@ u8 ScaledFont::glyph_fixed_width() const
return glyph_metrics(glyph_id_for_code_point(' ')).advance_width;
}
RefPtr<Font> ScaledFont::with_size(float point_size) const
{
return adopt_ref(*new Gfx::ScaledFont(*m_font, point_size, point_size));
}
Gfx::FontPixelMetrics ScaledFont::pixel_metrics() const
{
return m_pixel_metrics;