67 Commits

Author SHA1 Message Date
Laurenz
4017b5a9f6 Push some nodes directly into the stack 2021-06-11 14:42:20 +02:00
Laurenz
bce553a991 Tidy up 2021-06-09 22:44:40 +02:00
Laurenz
b886ced408 Switch to N64 type alias 2021-05-27 14:48:45 +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
6472c1e425 Rename areas to regions 2021-05-21 12:55:36 +02:00
Laurenz
c975d0d5e9 Tidy up layouting code 2021-05-17 22:55:31 +02:00
Laurenz
24c4a746bc Move aspect ratio into stack 2021-05-17 15:23:04 +02:00
Laurenz
1003d320d4 Rename expand to fixed and switch to bools 2021-05-17 15:00:29 +02:00
Laurenz
9014e83478 Fix multi-page paragraph bugs 🐞 2021-04-03 21:12:32 +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
8245b7b736 Baseline alignment ⏏ 2021-03-30 21:43:12 +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
898728f260 Square, circle and ellipse 🔵 2021-03-20 20:19:30 +01:00
Laurenz
264a7dedd4 Scheduled maintenance 🔨
- New naming scheme
  - TextNode instead of NodeText
  - CallExpr instead of ExprCall
  - ...
- Less glob imports
- Removes Value::Args variant
- Removes prelude
- Renames Layouted to Fragment
- Moves font into env
- Moves shaping into layout
- Moves frame into separate module
2021-03-19 17:57:31 +01:00
Laurenz
584a43277d Rename ChildAlign to LayoutAligns ✏ 2021-03-12 14:12:30 +01:00
Laurenz
c1b1dbcc09 Better expansion behaviour 🐪
This makes expansion behaviour inheritable by placing it into the area and passing it down during layouting instead of computing some approximation of what we want during execution.
2021-03-11 10:48:29 +01:00
Laurenz
84ba547c7c If expressions 🔀 2021-01-20 21:33:13 +01:00
Laurenz
272a4c2289 Unbounded pages 🌌 2021-01-13 23:19:44 +01:00
Laurenz
2e77b1c836 Better value representations, type function 🌐 2021-01-04 21:29:15 +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
1a70cb6a33 Naming and grammar ✔ 2020-10-12 18:01:22 +02:00
Laurenz
5243878d81 Less vecs in layouting 2020-10-12 17:29:01 +02:00
Laurenz
38157b0e0c Synchronous layout 🪀 2020-10-12 17:10:01 +02:00
Laurenz
a2a68106c0 Evaluation benchmark 🔋 2020-10-11 23:18:00 +02:00
Laurenz
607f4395f9 Refactor stack layout again 🧣 2020-10-11 22:38:34 +02:00
Laurenz
f04ad0ffa5 Rename LayoutItem to Layouted ✏ 2020-10-11 13:08:27 +02:00
Laurenz
92c01da360 Switch back to custom geometry types, unified with layout primitives 🏞 2020-10-10 22:19:36 +02:00
Laurenz
537545e7f8 Evaluation and node-based layouting 🚀 2020-10-07 17:07:44 +02:00
Laurenz
ca1256c924 Remove obsolete extra variable in stack layouter 2020-10-06 20:40:37 +02:00
Laurenz
4252f959f7 Typesafe conversions in stack & line layouters 🍮 2020-10-06 18:27:00 +02:00
Laurenz
ef410f6877 Move multi-dir support in stack layouter 🍁 2020-10-06 14:20:28 +02:00
Laurenz
c6a6870978 Rename secondary/primary to main/cross ✏ 2020-10-06 13:13:18 +02:00
Laurenz
5a7a32a9ba Streamline generic layouting primitives 🛫 2020-10-05 16:44:35 +02:00
Laurenz
d1c07260c0 Move align out of BoxLayout 🍫 2020-10-05 13:39:33 +02:00
Laurenz
335fa2d118 Small improvements 🍪 2020-10-04 23:31:35 +02:00
Laurenz
c1dd872b34 Remove unncessary wrappers and typedefs 🛑 2020-10-04 19:57:39 +02:00
Laurenz
0fc25d732d Port to kurbo 🎋 2020-10-03 13:23:59 +02:00
Laurenz
904bc392ab Remove spans from token iterator 🧽 2020-10-02 19:17:47 +02:00
Laurenz
f8770d2b2a Generalize layouting primitives 🛤 2020-10-01 15:35:09 +02:00
Laurenz
181f756a9e Format everything with rustfmt! 💚 2020-08-30 22:18:55 +02:00
Laurenz
dbfb3d2ced Formatting, documentation and small improvements 🧽 2020-08-03 16:04:55 +02:00
Laurenz
266d457292 Refactor model into tree 🛒 2020-08-02 22:05:49 +02:00
Laurenz
cbbc46215f Layout elements and pure rust rendering 🥏 2020-08-02 21:17:42 +02:00
Laurenz
d5ff97f42e Move binary into separate crate and tidy dependencies 🎭 2020-08-02 16:56:14 +02:00
Laurenz
533374db14 Refactor argument parsing 🔬 2020-08-02 16:31:34 +02:00
Laurenz
659248d52f Raw lengths 🚲
Replace unitless length with raw f64 and introduce length type with unit.
2020-08-01 19:15:55 +02:00
Laurenz
bbcdeb128c Move, rename and switch some things (boring) 🚚
- Problems -> Diagnostics
- Position -> Pos
- offset_spans -> Offset trait
- Size -> Length (and some more size types renamed)
- Paper into its own module
- scope::Parser -> parsing::CallParser
- Create `Decorations` alias
- Remove lots of double newlines
- Switch from f32 to f64
2020-07-29 18:09:51 +02:00
Laurenz
3150fd5643 Better Debug/Display and Derives 🧽 2020-02-03 12:22:02 +01:00