Repository navigation
Add conditional whitespace hanging explanation - #831
Conversation
This explains the reading of the spec, and explains our model based on that. Wrote this as an explanation in linebender#790 (comment), and figured it may be useful in the docs for posterity.
DJMcNab
left a comment
There was a problem hiding this comment.
As it's internal only docs, I'm happy enough just moving forward with this.
| //! | ||
| //! # Conditional vs. unconditional whitespace hanging | ||
| //! | ||
| //! Under CSS Text 4 § 4.3.2, some whitespace hangs, and some may hang *conditionally*. |
There was a problem hiding this comment.
I think what's missing here is a definition of what hanging actually means. To be completely honest, I still haven't got my head around what the behavioural difference is, if we're not actually omitting the glyphs. Is it mostly/entirely the impact on alignment?
There was a problem hiding this comment.
That's fair! This was mostly copied from my comment that really just focused on the conditional vs unconditional aspect of it.
When measuring the line width hanging clusters/glyphs are not included, so yes: it impacts alignment. We currently only hang whitespace, but e.g. punctuation could also hang, in which case you could see the glyphs go outside the line box.
LLM Contributions: Review.
This explains the reading of the spec, and explains our model based on that. Wrote this as an explanation in
#790 (comment), and figured it may be useful in the docs for posterity.
HTML sample
https://developer.mozilla.org/en-US/play?id=Xvs2WibuByVkeRPwc7hAy%2BfYc%2B5W6ZVidyHcfdDy1%2F%2F41DBLRABlyaBHukdkDbLhL4%2BnN5%2FL5YHGdy5B
Changelog: None