From 2c6127dea611944abb09a0d38375ad7cf9baced0 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 29 Jul 2021 13:21:25 +0200 Subject: Refactor state --- tests/ref/text/par.png | Bin 4337 -> 3632 bytes tests/typ/text/par.typ | 7 +------ tests/typeset.rs | 5 +++-- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/ref/text/par.png b/tests/ref/text/par.png index 41742f20..c3758738 100644 Binary files a/tests/ref/text/par.png and b/tests/ref/text/par.png differ diff --git a/tests/typ/text/par.typ b/tests/typ/text/par.typ index 8aa1147d..0c776c70 100644 --- a/tests/typ/text/par.typ +++ b/tests/typ/text/par.typ @@ -1,12 +1,7 @@ // Test configuring paragraph properties. --- -// FIXME: Word spacing doesn't work due to new shaping process. -#par!(spacing: 10pt, leading: 25%, word-spacing: 1pt) +#par!(spacing: 10pt, leading: 25%) But, soft! what light through yonder window breaks? It is the east, and Juliet is the sun. - ---- -// Test that it finishes an existing paragraph. -Hello #par!(word-spacing: 0pt) t h e r e ! diff --git a/tests/typeset.rs b/tests/typeset.rs index 3e83fcb5..78577098 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -63,8 +63,9 @@ fn main() { // We want to have "unbounded" pages, so we allow them to be infinitely // large and fit them to match their content. let mut state = State::default(); - state.page.size = Size::new(Length::pt(120.0), Length::inf()); - state.page.margins = Sides::splat(Some(Length::pt(10.0).into())); + let page = state.page_mut(); + page.size = Size::new(Length::pt(120.0), Length::inf()); + page.margins = Sides::splat(Some(Length::pt(10.0).into())); // We hook up some extra test helpers into the global scope. let mut std = typst::library::new(); -- cgit v1.2.3