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

LibGfx+FontEditor+Fonts: Add "mean line" value to all fonts

The main inspiration behind this was to have a correct ex CSS unit.
The mean line is based off what it shows in the CSS Values and Units
Level 4 specification, section 6.1.1.

https://www.w3.org/TR/css-values-4/#font-relative-lengths
This commit is contained in:
Luke 2020-10-05 16:19:37 +01:00 committed by Andreas Kling
parent 043b31ad9a
commit 52c31bb743
19 changed files with 55 additions and 13 deletions

View file

@ -59,7 +59,8 @@ void GlyphEditorWidget::paint_event(GUI::PaintEvent& event)
painter.translate(-1, -1);
for (int y = 1; y < font().glyph_height(); ++y) {
bool bold_line = (y - 1) == font().baseline();
int y_below = y - 1;
bool bold_line = y_below == font().baseline() || y_below == font().mean_line();
painter.draw_line({ 0, y * m_scale }, { font().max_glyph_width() * m_scale, y * m_scale }, palette().threed_shadow2(), bold_line ? 2 : 1);
}