typst/src
Laurenz d74c9378b8 New paragraph layout 🚀
The previous paragraph layout algorithm had a couple of flaws:
- It always produced line break opportunities between runs although on
  the textual level there might have been none.
- It didn't handle trailing spacing correctly in some cases.
- It wouldn't have been easily adaptable to Knuth-Plass style optimal
  line breaking because it was fundamentally structured first-fit
  run-by-run.

The new paragraph layout algorithm fixes these flaws. It proceeds
roughly in the following stages:
1. Collect all text in the paragraph.
2. Compute BiDi embedding levels.
3. Shape all runs, layout all children and store the resulting items in
   a reusable (possibly even cacheable) `ParLayout`.
3. Iterate over all line breaks in the concatenated text.
4. Construct lightweight `LineLayout` objects for full lines instead of
   runs. These mostly borrow from the `ParLayout` and only reshape the
   first and last run if necessary. The design allows to use Harfbuzz's
   UNSAFE_TO_BREAK mechanism to make reshaping more efficient. The size
   of a `LineLayout` can be measured without building the line's frame.
5. Build only the selected line's frames and stack them.
2021-04-03 21:09:17 +02:00
..
eval Refactor alignments & directions 📐 2021-03-25 21:32:33 +01:00
exec New paragraph layout 🚀 2021-04-03 21:09:17 +02:00
geom New paragraph layout 🚀 2021-04-03 21:09:17 +02:00
layout New paragraph layout 🚀 2021-04-03 21:09:17 +02:00
library Baseline alignment ⏏ 2021-03-30 21:43:12 +02:00
parse Syntax functions 🚀 2021-03-21 17:50:56 +01:00
pdf Make pdf module top-level 🧱 2021-03-24 21:48:25 +01:00
syntax Syntax functions 🚀 2021-03-21 17:50:56 +01:00
color.rs Fixes in TextMate grammar 2021-03-17 14:47:11 +01:00
diag.rs Documentation fixes ✔ 2021-03-03 23:32:29 +01:00
env.rs Text shaping 🚀 2021-03-24 17:12:34 +01:00
font.rs Make pdf module top-level 🧱 2021-03-24 21:48:25 +01:00
lib.rs Make pdf module top-level 🧱 2021-03-24 21:48:25 +01:00
main.rs Make pdf module top-level 🧱 2021-03-24 21:48:25 +01:00
paper.rs Fixes in TextMate grammar 2021-03-17 14:47:11 +01:00
pretty.rs Syntax functions 🚀 2021-03-21 17:50:56 +01:00