Skip to content

[css2][css-inline] Definition of line-height calculations contradicts itself #391

Open
@fantasai

Description

@fantasai

I'm having a little trouble with the CSS2.1 spec.
https://drafts.csswg.org/css2/visudet.html#line-height

for each glyph, determine the A and D. Note that glyphs in a single element may come from different fonts and thus need not all have the same A and D. [...]

Still for each glyph, determine the leading L to add, where L = 'line-height' - AD. Half the leading is added above A and the other half below D, giving the glyph and its leading a total height above the baseline of A' = A + L/2 and a total depth of D' = D + L/2.

So, let's suppose the line-height is 1. The leading is zero, right? So we end up with some glyphs with ascenders A1, A2, etc. and descenders D1, D2, etc. The As are not all identical. Neither are the Ds. When we align them all along the baseline, we get a set of boxes that are 1em tall, but are slightly shifted up and down.

The height of the inline box encloses all glyphs and their half-leading on each side and is thus exactly 'line-height'.

If we draw the bounding box of the boxes described above, the height of that bounding box is more than 1em, right?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions