255 Commits

Author SHA1 Message Date
Laurenz
b0b4607725 Set the correct base for grid cells 2021-09-10 15:10:34 +02:00
Laurenz
3481d8cc81 More utility functions
- join("a", "b", "c", sep: ", ")
- int("12")
- float("31.4e-1")
- str(10)
- sorted((3, 2, 1))
2021-08-31 12:59:53 +02:00
Laurenz
17ea0d4ba9 Make font fallback disableable 2021-08-27 14:08:31 +02:00
Laurenz
148a06c070 Switch from state to decorations for underline/strikethrough/overline 2021-08-24 00:41:15 +02:00
Martin
d546453880
Links! (#43)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
2021-08-23 23:56:33 +02:00
Laurenz
a6f260ca39 Refactor layouting a bit
Notably:
- Handle aspect ratio in fixed node
- Inline constraint inflation into pad node
2021-08-19 15:52:15 +02:00
Laurenz
594809e35b Library functions behave more imperatively
- Templates scope state changes
- State-modifying function operate in place instead of returning a template
- Internal template representation contains actual owned nodes instead of a pointer to a syntax tree + an expression map
- No more wide calls
2021-08-17 22:20:37 +02:00
Laurenz
9a798ce6f6 Make percentages for h and v relative to area instead of font size 2021-08-17 00:17:28 +02:00
Laurenz
8207c31aec Minor refactorings
- Reorder parser methods and use `Pos` everywhere
- Remove tab special handling for columns and adapt heading/list/enum indent handling
- Don't panic when a file has an empty path
2021-08-10 11:28:12 +02:00
Laurenz
1ee1d078e2 Fatal errors
- Makes errors fatal, so that a phase is only reached when all previous phases were error-free
- Parsing still recovers and can produce multiple errors
- Evaluation fails fast and can thus produce only a single error (except for parse errors due to an import)
- The single error that could occur during execution is removed for now
- Removes Value::Error variant
2021-07-30 18:49:19 +02:00
Laurenz
2c6127dea6 Refactor state 2021-07-29 13:28:19 +02:00
Laurenz
891e0c5fa6 Remove warnings from parsing and casting 2021-07-10 23:14:46 +02:00
Laurenz
7e2c217cbc Rename some library arguments
- font
  - color -> fill
  - shorthands for families and size
- decoration functions
  - color -> stroke
  - strength -> thickness
  - position -> offset
  - invert offsets: now positive goes downwards just like the rest of typst
2021-07-08 21:42:36 +02:00
Laurenz
551e3af9d0 Replace using with from 2021-07-08 21:16:16 +02:00
Laurenz
5c327e249e Switch to = for headings once again 2021-07-08 20:03:13 +02:00
Laurenz
f85e5aac64 URL special case for line comments 2021-07-08 19:37:38 +02:00
Laurenz
44d8028b49 Allow wide calls only directly in templates 2021-06-30 22:49:11 +02:00
Laurenz
45812b7001
Merge pull request #35 from typst/wide-calls
Wide calls
2021-06-30 11:04:53 +02:00
Laurenz
2f44d10aa4 Make test separators commentable 2021-06-29 16:05:05 +02:00
Laurenz
b89cd128ae Wide calls 2021-06-29 13:49:50 +02:00
Martin Haug
9bd8b7ddac Code review, new stack test 2021-06-27 18:06:39 +02:00
Laurenz
422b8e640f With expressions 2021-06-26 18:07:05 +02:00
Laurenz
d53c933e4d Add box and block functions 2021-06-26 15:47:37 +02:00
Laurenz
bca035172c Join semantics 2021-06-18 11:59:05 +02:00
Martin
fec1f41106
Allow grid cells to span multiple regions. (#30) 2021-06-12 18:19:18 +02:00
Laurenz
4017b5a9f6 Push some nodes directly into the stack 2021-06-11 14:42:20 +02:00
Laurenz
4dbd9285c9 Basic enums 2021-06-11 14:00:06 +02:00
Martin Haug
c28708aa19 Text decorations 2021-06-10 23:15:51 +02:00
Laurenz
5611c26577 Restructure tests 2021-06-10 16:46:01 +02:00
Laurenz
bce553a991 Tidy up 2021-06-09 22:44:40 +02:00
Martin Haug
29cfef0a6d Add a grid layouter 2021-06-09 22:44:40 +02:00
Laurenz
c7416f18bd Move invalid syntax tests into appropriate places 2021-06-09 10:51:19 +02:00
Laurenz
edff2ae680 Remove template pretty printing
Was buggy and pretty useless anyway since it couldn't peek into function templates.
2021-06-09 10:45:49 +02:00
Laurenz
5afb42ad89 Lists with indent-based parsing
- Unordered lists with indent-based parsing and basic layout using stacks
- Headings are now also indent based
- Removes syntax functions since they will be superseded by select & transform
2021-06-09 00:37:13 +02:00
Laurenz
f26526ba75 Switch back to hashtags for headings 2021-06-07 18:17:47 +02:00
Martin Haug
37e0846037 Test cases for include and import 2021-05-31 22:33:40 +02:00
Laurenz
cd25b40281 Stack function 2021-05-23 22:36:34 +02:00
Laurenz
8b58171d7c Reorganize test cases 2021-05-18 00:36:11 +02:00
Laurenz
076e767b0e Do binary search and find the outermost glyph with the text index 🔍
Co-Authored-By: Martin <mhaug@live.de>
2021-04-07 00:24:42 +02:00
Laurenz
de20a21a58 Reshaping with unsafe-to-break
Co-Authored-By: Martin <mhaug@live.de>
2021-04-05 22:32:09 +02:00
Laurenz
a86cf7bd8c Refresh all reference images 2021-04-03 21:12:32 +02:00
Laurenz
bfbbe8dcf8 Better paragraph layout tests 2021-04-03 21:12:32 +02:00
Laurenz
c00cca3677 Refactor ♻ 2021-03-30 16:19:16 +02:00
Laurenz
12a604fec8 BiDi tests 2021-03-30 14:31:50 +02:00
Laurenz
79948c0c5e BiDi reordering 🔃
Co-Authored-By: Martin <mhaug@live.de>
2021-03-30 14:31:50 +02:00
Laurenz
47b4dab7ed Line breaking tests
Co-Authored-By: Martin <mhaug@live.de>
2021-03-30 14:31:49 +02:00
Laurenz
9c040a9d2b Move around test cases 🚚 2021-03-29 14:51:54 +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
73615f7e3c Text shaping 🚀
- Shapes text with rustybuzz
- Font fallback with family list
- Tofus are shown in the first font

Co-Authored-By: Martin <mhaug@live.de>
2021-03-24 17:12:34 +01:00