[csswg-drafts] [css-inline-3] consistent baseline-to-baseline spacing vs line gaps (#5564)

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

== [css-inline-3] consistent baseline-to-baseline spacing vs line gaps ==
Issue from discussions with @kojiishi:

Imagine a paragraph with one main font and one secondary font (e.g. for code snippets). Under the CSS Inline Layout 3 model, we would use the main font to determine the spacing and the position of the baseline, and we would align the secondary font by its baseline. 

Suppose, for simplicity, the font ascent + descent = 1em exactly ;) and the first font has its baseline at 0.2em and the second one at 0.25em. 

---- <- top edge 

     <- 0.8em vs 0.75em 

-----<- baseline 
     <- 0.2em vs 0.25em 
-----<- bottom edge 

If we are double-spacing the paragraph, the gaps will be 1em. The second font's top and bottom edges will be shifted 0.05em down from the first font wherever it appears on a line. But it's OK, 0.05em fits within the gap, so under our new model, the spacing remains consistent, no problem. 

But now imagine we have an entire second paragraph where the main font is the secondary font. It has consistent 2em spacing between baselines within itself, no problem. But between the primary-font paragraph and the secondary-font paragraph we have two incompatible choices: 

- A) Maintain exactly 1em between the bottom edge of the first paragraph and the top edge of the second paragraph. 
- B) Maintain exactly 2em between the last baseline of the first paragraph and the first baseline of the second paragraph. 

Because of the differences in the font metrics, we cannot have both things. The current model gives us A, but not B. Do we need to make B possible? If so, how should we do it? 

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

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

Received on Wednesday, 30 September 2020 20:04:03 UTC