LibGfx: Don't crash on Typeface::get_font() with size 0

If someone wants a zero-sized font, we can just give it to them instead
of making a fuss.
This commit is contained in:
Andreas Kling 2023-09-04 18:38:00 +02:00
parent 589a1e9325
commit 6a32634440

View file

@ -61,7 +61,7 @@ void Typeface::set_vector_font(RefPtr<VectorFont> font)
RefPtr<Font> Typeface::get_font(float point_size, Font::AllowInexactSizeMatch allow_inexact_size_match) const
{
VERIFY(point_size > 0);
VERIFY(point_size >= 0);
if (m_vector_font)
return adopt_ref(*new Gfx::ScaledFont(*m_vector_font, point_size, point_size));