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

LibHTML: Add StyleProperties::line_height()

We currently hard-code the line height to 140% of the font glyph height
and this patch doesn't fix the hard-coding, but at least moves it out
of LayoutText and into StyleProperties where it can be re-used until
the day we go and do a proper implementation of CSS line-height. :^)
This commit is contained in:
Andreas Kling 2019-10-12 13:42:58 +02:00
parent 3cef6a5cac
commit 92b6a7a18f
3 changed files with 9 additions and 2 deletions

View file

@ -91,3 +91,9 @@ void StyleProperties::load_font() const
m_font = Font::load_from_file(String::format("/res/fonts/%s", file_name.characters()));
}
int StyleProperties::line_height() const
{
// FIXME: Allow overriding the line-height. We currently default to 140% which seems to look nice.
return (int)(font().glyph_height() * 1.4f);
}