From f5e18dda2b18885bb255a1148b2c45254eaab23f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 6 Jan 2023 11:53:39 +0100 Subject: [PATCH] LibGfx: Make BitmapFont's line gap be Gfx::Painter::LINE_SPACING This is the closest thing we have to the OpenType line gap metrics. Using it here will allow us to unify more of the text painting logic. --- Userland/Libraries/LibGfx/Font/BitmapFont.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Font/BitmapFont.cpp b/Userland/Libraries/LibGfx/Font/BitmapFont.cpp index 0975befe14..df3e04c023 100644 --- a/Userland/Libraries/LibGfx/Font/BitmapFont.cpp +++ b/Userland/Libraries/LibGfx/Font/BitmapFont.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include namespace Gfx { @@ -402,7 +403,7 @@ FontPixelMetrics BitmapFont::pixel_metrics() const .glyph_spacing = (float)glyph_spacing(), .ascent = (float)m_baseline, .descent = (float)(m_glyph_height - m_baseline), - .line_gap = (float)pixel_size() * 0.4f, // FIXME: Do something nicer here. + .line_gap = Gfx::Painter::LINE_SPACING, }; }