diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-30 14:12:28 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-30 14:12:28 +0200 |
| commit | f9e115daf54c29358f890b137f50a33a781af680 (patch) | |
| tree | 496de52246629ea8039db6beea94eb779ed2851d /tests/typ/layout | |
| parent | f7c67cde72e6a67f45180856b332bae9863243bd (diff) | |
New block spacing model
Diffstat (limited to 'tests/typ/layout')
| -rw-r--r-- | tests/typ/layout/pagebreak.typ | 12 | ||||
| -rw-r--r-- | tests/typ/layout/place.typ | 12 | ||||
| -rw-r--r-- | tests/typ/layout/spacing.typ | 4 | ||||
| -rw-r--r-- | tests/typ/layout/stack-1.typ | 32 |
4 files changed, 32 insertions, 28 deletions
diff --git a/tests/typ/layout/pagebreak.typ b/tests/typ/layout/pagebreak.typ index df3b0423..349a2fc2 100644 --- a/tests/typ/layout/pagebreak.typ +++ b/tests/typ/layout/pagebreak.typ @@ -13,14 +13,14 @@ #pagebreak() --- -// Two text bodies separated with and surrounded by soft pagebreaks. +// Two text bodies separated with and surrounded by weak pagebreaks. // Should result in two aqua-colored pages. #set page(fill: aqua) -#pagebreak(soft: true) +#pagebreak(weak: true) First -#pagebreak(soft: true) +#pagebreak(weak: true) Second -#pagebreak(soft: true) +#pagebreak(weak: true) --- // Test a combination of pagebreaks, styled pages and pages with bodies. @@ -34,12 +34,12 @@ Third Fif[#set page();th] --- -// Test hard and soft pagebreak followed by page with body. +// Test hard and weak pagebreak followed by page with body. // Should result in three navy-colored pages. #set page(fill: navy) #set text(fill: white) First #pagebreak() #page[Second] -#pagebreak(soft: true) +#pagebreak(weak: true) #page[Third] diff --git a/tests/typ/layout/place.typ b/tests/typ/layout/place.typ index 527e0559..95049bdc 100644 --- a/tests/typ/layout/place.typ +++ b/tests/typ/layout/place.typ @@ -16,14 +16,14 @@ the line breaks still had to be inserted manually. place(right, dy: 1.5pt)[ABC], rect(fill: conifer, height: 10pt, width: 80%), rect(fill: forest, height: 10pt, width: 100%), + 10pt, + block[ + #place(center, dx: -7pt, dy: -5pt)[Hello] + #place(center, dx: 7pt, dy: 5pt)[Hello] + Hello #h(1fr) Hello + ] ) -#block[ - #place(center, dx: -7pt, dy: -5pt)[Hello] - #place(center, dx: 7pt, dy: 5pt)[Hello] - Hello #h(1fr) Hello -] - --- // Test how the placed node interacts with paragraph spacing around it. #set page("a8", height: 60pt) diff --git a/tests/typ/layout/spacing.typ b/tests/typ/layout/spacing.typ index 378c11b8..eb0bd39e 100644 --- a/tests/typ/layout/spacing.typ +++ b/tests/typ/layout/spacing.typ @@ -1,8 +1,8 @@ // Test the `h` and `v` functions. --- -// Linebreak and v(0pt) are equivalent. -#box[A \ B] #box[A #v(0pt) B] +// Linebreak and leading-sized weak spacing are equivalent. +#box[A \ B] #box[A #v(0.65em, weak: true) B] // Eating up soft spacing. Inv#h(0pt)isible diff --git a/tests/typ/layout/stack-1.typ b/tests/typ/layout/stack-1.typ index eee1f4d1..19a00de5 100644 --- a/tests/typ/layout/stack-1.typ +++ b/tests/typ/layout/stack-1.typ @@ -19,24 +19,16 @@ #stack(dir: btt, ..items) --- -// Test RTL alignment. -#set page(width: 50pt, margins: 5pt) -#set text(8pt) -#stack(dir: rtl, - align(center, [A]), - align(left, [B]), - [C], -) - ---- // Test spacing. #set page(width: 50pt, margins: 0pt) -#set par(leading: 5pt) #let x = square(size: 10pt, fill: eastern) -#stack(dir: rtl, spacing: 5pt, x, x, x) -#stack(dir: ltr, x, 20%, x, 20%, x) -#stack(dir: ltr, spacing: 5pt, x, x, 7pt, 3pt, x) +#stack( + spacing: 5pt, + stack(dir: rtl, spacing: 5pt, x, x, x), + stack(dir: ltr, x, 20%, x, 20%, x), + stack(dir: ltr, spacing: 5pt, x, x, 7pt, 3pt, x), +) --- // Test overflow. @@ -45,3 +37,15 @@ rect(width: 40pt, height: 20pt, fill: conifer), rect(width: 30pt, height: 13pt, fill: forest), )) + +--- +// Test aligning things in RTL stack with align function & fr units. +#set page(width: 50pt, margins: 5pt) +#set text(8pt) +#stack(dir: rtl, 1fr, [A], 1fr, [B], [C]) +#v(5pt) +#stack(dir: rtl, + align(center, [A]), + align(left, [B]), + [C], +) |
