mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
The old logic was assuming that all whitespace was a break opportunity, and that no newlines would be preserved. Note that text shaping considers the advance of a newline to be the same as a space. This was problematic because if we have a segment with a preserved space and newline, only the advance of the space should contrinute to the size of the block container. Therefore, I'm changing the breaker logic in other to have newline characters in their own segment. Then glyph_run_is_whitespace_ending_with_preserved_newline can just be renamed to glyph_run_is_preserved_newline. This patch is still not perfect because it doesn't check allow_wrap(), so `nowrap` is treated like `normal`, and `pre-wrap` like `pre`. |
||
---|---|---|
.. | ||
shaping | ||
glyph.rs | ||
mod.rs | ||
text_run.rs | ||
util.rs |