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:
parent
043b31ad9a
commit
52c31bb743
19 changed files with 55 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue