Skip to content

[css-inline-3] consistent baseline-to-baseline spacing vs line gaps #5564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fantasai opened this issue Sep 30, 2020 · 0 comments
Open

[css-inline-3] consistent baseline-to-baseline spacing vs line gaps #5564

fantasai opened this issue Sep 30, 2020 · 0 comments

Comments

@fantasai
Copy link
Collaborator

fantasai commented Sep 30, 2020

(Issue from discussions with @kojiishi... I thought I'd filed the issue, but apparently not.)

Imagine a paragraph with one main font and one secondary font (e.g. for code snippets). Under the CSS Inline Layout 3 model (and setting text-edge: text), 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant