1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

LibGfx: Add ascent, descent and line gap to FontPixelMetrics

These are the main values we need in LibWeb to perform inline layout.
This commit is contained in:
Andreas Kling 2022-03-28 12:17:18 +02:00
parent 7850628ff1
commit 56a284713d
4 changed files with 27 additions and 10 deletions

View file

@ -379,6 +379,9 @@ FontPixelMetrics BitmapFont::pixel_metrics() const
.x_height = (float)x_height(),
.advance_of_ascii_zero = (float)glyph_width('0'),
.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.
};
}