83 Commits

Author SHA1 Message Date
Laurenz
e74ae6ce70 Make all nodes into classes 2022-01-08 00:20:48 +01:00
Laurenz
af014cfe5e Tidy up styling 2022-01-07 10:46:55 +01:00
Laurenz
5fd9c0b0d7 Lift styles out of individual nodes 2022-01-05 23:55:06 +01:00
Laurenz
f7e8624b4c Refactor 2022-01-05 15:06:42 +01:00
Laurenz
f174134aa2 Style chains 2021-12-30 12:12:19 +01:00
Laurenz
f5dcb84e36 Make clippy a bit happier 2021-12-30 12:00:12 +01:00
Laurenz
bd304b99e5 Tidying 2021-12-28 13:41:26 +01:00
Martin
7efdcdf247 Apply simple suggestions from code review
Co-Authored-By: Laurenz <laurmaedje@gmail.com>
2021-12-27 12:33:53 +01:00
Martin Haug
b22ce6f8b8 Introduce equal-width columns 2021-12-26 15:59:24 +01:00
Laurenz
438255519e Review One: A Set Rules Story 2021-12-22 19:19:32 +01:00
Laurenz
11565a40b3 Set Rules Episode IX: The Rise of Testing 2021-12-21 00:20:24 +01:00
Laurenz
958f74f777 Set Rules Episode VIII: The First Macro 2021-12-16 14:43:02 +01:00
Laurenz
2a3d0f4b39 Set Rules Episode VII: The Set Awakens 2021-12-15 20:27:41 +01:00
Laurenz
244ad386ec Set Rules Episode VI: Return of the Refactor 2021-12-15 12:49:20 +01:00
Laurenz
ae38be9097 Set Rules Episode IV: A New Fold 2021-12-15 11:11:57 +01:00
Laurenz
fe21c4d399 Set Rules Episode III: Revenge of the packer 2021-12-09 13:42:52 +01:00
Laurenz
40b87d4066 Set Rules Episode II: Attack of the properties 2021-12-07 16:36:39 +01:00
Laurenz
26bdc1f0f6 Set Rules Episode I: The Phantom Style 2021-12-05 12:54:03 +01:00
Laurenz
f3bdc9d3da Syntax highlighting 2021-11-30 18:55:50 +01:00
Laurenz
3a15922d2f X/Y abstractions 2021-11-26 16:32:06 +01:00
Laurenz
304d9dd110 Small style changes 2021-11-24 17:00:10 +01:00
Laurenz
ed50661378 Castable optional and smart values 2021-11-29 16:47:35 +01:00
Laurenz
cef46e6c40 Strokes 2021-11-20 15:51:07 +01:00
Laurenz
70c0dd7674 Small fixes 2021-11-19 13:16:43 +01:00
Laurenz
5a59bb4821 Page fill 2021-11-18 12:50:28 +01:00
Laurenz
0e0f340502 Revert page and inline levels 2021-11-16 10:41:30 +01:00
Laurenz
63c274e7f6 Make clippy happier and remove Str 2021-11-15 17:06:43 +01:00
Laurenz
072e7c710c Reduce namespace pollution 2021-11-02 10:39:45 +01:00
Martin Haug
8ccb7d6f15 Smallcaps, sub- and superscript, ligature ctrls... 2021-11-02 10:39:45 +01:00
Laurenz
5b344b663a Reorganize modules
Instead of separating functionality into layout and library, everything lives in the library now. This way, related things live side by side and there are no duplicate file names in the two directories.
2021-10-31 15:52:35 +01:00
Laurenz
285c2f617b Cleanse library
- Remove doc-comments for Typst functions from library
- Reduce number of library source files
2021-06-26 13:06:37 +02:00
Laurenz
8b6391040e Remove eat_ prefix 2021-06-18 11:58:43 +02:00
Laurenz
118fc1014b Leaner argument parsing 2021-05-18 21:32:40 +02:00
Laurenz
c975d0d5e9 Tidy up layouting code 2021-05-17 22:55:31 +02:00
Laurenz
57ca9628c1 Better space coalescing logic 🌧
This creates a smaller state machine helper type for softness coalescing, which does not own the resulting nodes. While this creates a bit more duplication in stack and par builder, it makes it a lot easier to integrate additional logic into the paragraph builder.

Furthermore:
- Line breaks are now "hard", that is, not coalesced with each other.
- Text nodes with equal style are now merged allowing for example `f{}i` to form a ligature.
2021-03-27 21:52:39 +01: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
5e08028fb3 Syntax functions 🚀
This adds overridable functions that markup desugars into. Specifically:
- \ desugars into linebreak
- Two newlines desugar into parbreak
- * desugars into strong
- _ desugars into emph
- = .. desugars into heading
- `..` desugars into raw
2021-03-21 17:50:56 +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
54a9ccb1a5 Configurable font edges ⚙
Adds top-edge and bottom-edge parameters to the font function. These define how
the box around a word is computed. The possible values are:
- ascender
- cap-height (default top edge)
- x-height
- baseline (default bottom edge)
- descender

The defaults are chosen so that it's easy to create good-looking designs with
vertical alignment. Since they are much tighter than what most other software
uses by default, the default leading had to be increased to 50% of the font size
and paragraph spacing to 100% of the font size.

The values cap-height and x-height fall back to ascender in case they are zero
because this value may occur in fonts that don't have glyphs with cap- or
x-height (like Twitter Color Emoji). Since cap-height is the default top edge,
doing no fallback would break things badly.

Removes softness in favor of a simple boolean for pages and a more finegread u8
for spacing. This is needed to make paragraph spacing consume line spacing
created by hard line breaks.
2021-03-19 13:20:58 +01:00
Laurenz
6bd1a494e0 Formatting and documentation 2021-03-17 23:29:58 +01:00
Laurenz
1584b09708 Fix pagebreak-in-box bug ✔ 2021-03-12 18:48:11 +01:00
Laurenz
c3acb491e3 Refactor execution context 🏗
- The execution context is a lot more structured: Instead of a magic stack of arbitrary objects there are static objects for pages, stacks and paragraphs
- Page softness/keeping mechanic is now a lot simpler than before
2021-03-12 14:16:59 +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
b0446cbdd1 Move around library types 🚚 2021-03-10 17:22:44 +01:00
Laurenz
11e44516fa Merge some modules 🥞 2020-11-25 16:56:29 +01:00
Laurenz
ee38c6aa9a Allow configuration of directions in page and box ↗ 2020-10-19 13:05:54 +02:00
Laurenz
d3bc4ec073 Refactor layouting base 🪁 2020-10-11 22:38:30 +02:00
Laurenz
92c01da360 Switch back to custom geometry types, unified with layout primitives 🏞 2020-10-10 22:19:36 +02:00
Laurenz
d2e220245d Move deco, pass and feedback into diagnostics module ↩ 2020-10-07 18:24:47 +02:00
Laurenz
537545e7f8 Evaluation and node-based layouting 🚀 2020-10-07 17:07:44 +02:00