diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-10 10:20:01 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-10 10:20:01 +0100 |
| commit | bbb9ed07ffe8a2a0ea0a232f6cfc52f82f7f7afe (patch) | |
| tree | 2b106b63e104652b66efc74a0ffa3080a8b0a134 /tests/typ | |
| parent | b2b8d37ce03de60582230e03c03efa356b6f31d3 (diff) | |
Better line spacing calculations ↕
- Only add line spacing between lines. Previously, line spacing was added below
every line, making `#box[word]` higher than just `word`.
- Compute box height of text as `ascender - descender` so that the full word is
contained in the box.
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/full/coma.typ | 2 | ||||
| -rw-r--r-- | tests/typ/library/box.typ | 12 | ||||
| -rw-r--r-- | tests/typ/repr.typ | 3 |
3 files changed, 8 insertions, 9 deletions
diff --git a/tests/typ/full/coma.typ b/tests/typ/full/coma.typ index 39404a35..d324627f 100644 --- a/tests/typ/full/coma.typ +++ b/tests/typ/full/coma.typ @@ -1,5 +1,5 @@ // Configuration with `page` and `font` functions. -#page(width: 450pt, height: 380pt, margins: 1cm) +#page(width: 450pt, margins: 1cm) // There are variables and they can take normal values like strings, ... #let city = "Berlin" diff --git a/tests/typ/library/box.typ b/tests/typ/library/box.typ index 10e2c93e..7ce56859 100644 --- a/tests/typ/library/box.typ +++ b/tests/typ/library/box.typ @@ -1,15 +1,15 @@ // Test the box function. --- -#page("a7", flip: true) +#page("a8", flip: true) // Box with fixed width, should have text height. -#box(width: 2cm, color: #9650D6)[A] +#box(width: 2cm, color: #9650D6)[Legal] Sometimes there is no box. // Box with fixed height, should span line. -#box(height: 2cm, width: 100%, color: #734CED)[B] +#box(height: 1cm, width: 100%, color: #734CED)[B] // Empty box with fixed width and height. #box(width: 6cm, height: 12pt, color: #CB4CED) @@ -18,6 +18,6 @@ Sometimes there is no box. #box(width: 2in, color: #ff0000) // These are in a row! -#box(width: 1in, height: 10pt, color: #D6CD67) -#box(width: 1in, height: 10pt, color: #EDD466) -#box(width: 1in, height: 10pt, color: #E3BE62) +#box(width: 0.5in, height: 10pt, color: #D6CD67) +#box(width: 0.5in, height: 10pt, color: #EDD466) +#box(width: 0.5in, height: 10pt, color: #E3BE62) diff --git a/tests/typ/repr.typ b/tests/typ/repr.typ index 6eead75e..96eb710e 100644 --- a/tests/typ/repr.typ +++ b/tests/typ/repr.typ @@ -32,9 +32,8 @@ {12e1pt} \ {2.5rad} \ {45deg} \ - // Not in monospace via repr. -#repr(45deg) +#repr(45deg) \ --- // Colors. |
