[csswg-drafts] [css-inline-3] The interaction of `text-edge` with `line-height` is not predictable by authors (#8476)

litherum has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-inline-3] The interaction of `text-edge` with `line-height` is not predictable by authors ==
[This is one of a series of issues we're filing about the design feedback of `leading-trim` and `text-edge`. As far as we know, these properties are unimplemented in any browser, which means now is a good time to give feedback on their overall design. For each of the issues we're filing, we don't have a fully-formed proposal that would solve the problem, but we do have some avenues of potential mitigation in mind, and we're offering these ideas as a starting point for further discussion.]

There’s a threshold, where if the `line-height` is above that threshold, it is ignored, but if it’s below that threshold, it’s applied.

The [spec says](http://w3c.github.io/csswg-drafts/css-inline-3/#inline-height):
> ... giving an effective ascent above the baseline of A′ = A + L/2, and an effective descent of D′ = D + L/2. However, if text-edge is not leading and this is not the root inline box, if the half-leading is positive, treat it as zero.

We’re assuming this indicates that, if the half-leading is negative, `text-edge` is disregarded.

However, negative half-leading is pretty common: authors don’t go so far as to make their lines collide, but most fonts are constructed such that the ink doesn’t actually reach all the way up to the top of the ascent for most text. In places where space is tight, it’s pretty common for an author to tighten up the line height more than the line gap metric so the lines are more snug.

An author writing a web page doesn’t know exactly where the ascent and descent metrics of their font lie. They don’t know whether or not their half-leading is positive or not. They just tweak line-height until the lines look good. It will be frustrating to an author to adjust their content’s line height, but their adjustments stop working at some magical value, because some other property (`text-edge`) was specified somewhere else. (Recall that `text-edge` is inherited.)

A potential solution is described in XYZW.



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8476 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 20 February 2023 02:57:10 UTC