1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

LibGfx: Add dummy Font::x_height() getter

Right now we just guess that the x-height is glyph_height/2, which is
obviously not accurate. We currently don't store the x-height in fonts,
so that's something we'll need to fix.
This commit is contained in:
Andreas Kling 2020-08-07 20:29:32 +02:00
parent fae9c9f81f
commit 0bbced444b
2 changed files with 7 additions and 0 deletions

View file

@ -137,6 +137,9 @@ Font::Font(const StringView& name, unsigned* rows, u8* widths, bool is_fixed_wid
, m_glyph_spacing(glyph_spacing)
, m_fixed_width(is_fixed_width)
{
// FIXME: This is just a dumb guess. It would be cool to know the actual x-height of the font!
m_x_height = glyph_height / 2;
m_glyph_count = glyph_count_by_type(m_type);
if (!m_fixed_width) {