[csswg-drafts] [css-inline] support the em-over and em-under baselines in `text-box-edge` (#9148)

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

== [css-inline] support the em-over and em-under baselines in `text-box-edge` ==
Setting `text-box-trim: both; text-box-edge: text` can yield very different results based on the metrics implemented in the font. Fonts set ascenders and descenders so that the height between ascenders and descenders is a size larger than 1em to [provide good default spacing](https://silnrsi.github.io/FDBP/en-US/Line_Metrics.html). 

In some cases it could be useful to trim to the [`em-over`](https://drafts.csswg.org/css-inline-3/#em-over-baseline) and [`em-under`](https://drafts.csswg.org/css-inline-3/#em-under-baseline) baselines, or even better user defined `N-em` baselines. This would give authors more flexibility in case the baselines provided by the font can not be used.

Use case:
A use case is aligning the first or last line of text with em-based decorations. Currently, this can be challenging due to font metric variations. By introducing support for trimming to em-over and em-under baselines, or even user-defined N-em baselines, authors can gain more control over the precise alignment.

<img width="756" alt="image" src="https://github.com/w3c/csswg-drafts/assets/175195/33f3a5dc-f163-4fa0-88d1-c7241af20249">


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


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

Received on Thursday, 3 August 2023 07:36:59 UTC