10 Commits

Author SHA1 Message Date
Laurenz
7f48e8fe66 Make user-facing "debug" representation use Debug instead of Display 2021-08-31 16:25:12 +02:00
Laurenz
7d15dc634b Move font family and refactor alignment 2021-07-29 12:28:54 +02:00
Martin Haug
e27f6c1014 Add hash impls for all nodes
This prepares the incremental PR.

Co-Authored-By: Laurenz <laurmaedje@gmail.com>
2021-05-26 22:57:29 +02:00
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
Laurenz
76fc4cca62 Refactor alignments & directions 📐
- Adds lang function
- Refactors execution context
- Adds StackChild and ParChild enums
2021-03-25 21:32:33 +01:00
Laurenz
584a43277d Rename ChildAlign to LayoutAligns ✏ 2021-03-12 14:12:30 +01:00
Laurenz
aae67bd572 Move and rename many things 🚛 2021-01-03 00:12:09 +01:00
Laurenz
91e5120693 BoxAlign and Flow aliases ✏ 2020-10-13 13:51:58 +02:00
Laurenz
8680fcd490 Rename geometric eval and apply to resolve ✏ 2020-10-13 13:24:33 +02:00
Laurenz
92c01da360 Switch back to custom geometry types, unified with layout primitives 🏞 2020-10-10 22:19:36 +02:00