[css-inline] constant leading and dominant baselines

There's a discussion of line layout at the CSS F2F tomorrow in Sydney so I
thought I would suggest a couple simple properties that I think would
improve the quality of CSS line layout.

One of these is the ability to fix the leading between lines.  Even when a
fixed line-height value is specified, the actual height of the linebox may
change due to variations in the fonts or content included in a line or due
to alignment variations. Common examples in existing web content are the
use of HTML synthetic superscripts or lines involving multiple fonts with
different line metrics. The benefit of this variable line height model is
that the contents of one line never collide with the contents of the lines
above or below it. The downside is that when line placement varies it often
does so in ways that are unnecessary and detract from the readability.

To allow high quality, constant leading, a 'line-height-style' property
would be very useful:

  line-height-style: variable | fixed

The initial value would be 'variable' and would represent current behavior.
Lines would be placed based at the maximum of the line-height value and the
height of the current linebox. The 'fixed' value would specify that lines
would always be placed a constant distance apart, independent of the height
of the linebox.

Using the 'fixed' value would allow authors to have fixed spacing of lines
as is used traditionally in publishing. In extreme cases, collisions
between lines might occur.

It would also be useful to have a property to specify the dominant
baseline. This is a reduced version of the property proposed in an older
draft of the line layout spec:

  dominant-baseline: auto | alphabetic | ideographic | hanging | central

Here 'auto' would mean alphabetic for horizontal writing modes and central
for vertical writing modes. For fonts with baseline information (e.g. a
BASE table or it's equivalent) that information would be used to place text
with respect to that baseline. For fonts lacking this information,
appropriate defaults would be defined.

Beyond this I think you'd need to define precisely how the baseline grid
interacted with this but I think both of these properties would mesh nicely
with baseline grid behavior (e.g. if defined, a baseline grid overrides the
value of the 'line-height-style' property).

Cheers,

John Daggett
Mozilla Japan

Received on Monday, 9 February 2015 12:22:14 UTC