[css-inline] Controlling half-leading

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[css-inline] Controlling half-leading

fantasai
One of the problems that keeps coming up for quality typesetting
is the way half-leading works in CSS. There are a handful of issues,
but one of the major ones is that authors cannot control the amount
of leading (which is effectively extra space between the content of
the line and the content edge of the box) at the top or bottom of
a box (particularly one which is made visible, e.g. through backgrounds
or borders) or fragmentainer.

[If I understand correctly, the half-leading model was chosen for CSS
in order to handle blocks that don't have such visible boundaries,
e.g. consecutive paragraphs.]

Dave Cramer and I discussed the possibility of adding a property to
control whether half-leading is added at the top/bottom of a block
so that authors can get the control they need at the top of the page
etc.

It would look something like

   leading: always | auto | never

where

   always - always add half-leading above/below the line box (default)
   never  - never add half-leading above the first line box or below
            the last line box
   auto   - as 'never' for boxes that establish a new formatting context
            (i.e. flex items or other BFC roots) or boxes that have
            borders or padding [similar rules to margin collapsing]

~fantasai


Reply | Threaded
Open this post in threaded view
|

Re: [css-inline] Controlling half-leading

Liam R. E. Quin
On Mon, 2016-05-09 at 23:40 -0700, fantasai wrote:
>
[...]
> It would look something like
>    leading: always | auto | never

Of course, "between" is the traditional value; "before" is what troff
used, and film typesetters generally used either before or between. But
it's a value that you specify.

The problem (as I'm sure you discussed) isn't that the line height is
larger than the type size - most fonts are still designed to be used
that way for historical reasons to do with physics. The problem is that
you can't control the vertical baseline spacing exactly, and can't
reliably align blocks of text side by side (in vertical block
progression mode).

Liam


--
Liam R. E. Quin <[hidden email]>
The World Wide Web Consortium (W3C)

Reply | Threaded
Open this post in threaded view
|

Re: [css-inline] Controlling half-leading

Dave Cramer
In reply to this post by fantasai
On Tue, May 10, 2016 at 2:40 AM, fantasai <[hidden email]> wrote:
One of the problems that keeps coming up for quality typesetting
is the way half-leading works in CSS. There are a handful of issues,
but one of the major ones is that authors cannot control the amount
of leading (which is effectively extra space between the content of
the line and the content edge of the box) at the top or bottom of
a box (particularly one which is made visible, e.g. through backgrounds
or borders) or fragmentainer.

[If I understand correctly, the half-leading model was chosen for CSS
in order to handle blocks that don't have such visible boundaries,
e.g. consecutive paragraphs.]

Dave Cramer and I discussed the possibility of adding a property to
control whether half-leading is added at the top/bottom of a block
so that authors can get the control they need at the top of the page
etc.

It would look something like

  leading: always | auto | never

where

  always - always add half-leading above/below the line box (default)
  never  - never add half-leading above the first line box or below
           the last line box
  auto   - as 'never' for boxes that establish a new formatting context
           (i.e. flex items or other BFC roots) or boxes that have
           borders or padding [similar rules to margin collapsing]


 InDesign offers several ways to define the position of the first line of text in a box. 

1. Ascent. The ascender of the box font aligns to the top of the box.
2. Cap height. The cap height of the box font aligns to the top of the box. 
3. X-height. The x-height of the box font aligns to the top of the box. 
4. Leading. The distance from the top of the box to the first text baseline is equal to the line height. 
5. Fixed. The user specifies a length from the top of the box to the first text baseline. 

Conveniently, CSS uses none of these. Being able to specify a fixed length (#5) would be really helpful for us, as visual alignment is so dependent on the baseline. 

Dave