From b71113d37a29bab5c7dc4b501c33ee9afbdb8213 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 8 Mar 2022 19:49:26 +0100 Subject: Hyphenation --- tests/ref/text/hyphenate.png | Bin 0 -> 4979 bytes tests/ref/text/justify.png | Bin 11615 -> 11709 bytes tests/typ/text/hyphenate.typ | 14 ++++++++++++++ tests/typ/text/justify.typ | 11 +++++++++-- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 tests/ref/text/hyphenate.png create mode 100644 tests/typ/text/hyphenate.typ (limited to 'tests') diff --git a/tests/ref/text/hyphenate.png b/tests/ref/text/hyphenate.png new file mode 100644 index 00000000..050cab12 Binary files /dev/null and b/tests/ref/text/hyphenate.png differ diff --git a/tests/ref/text/justify.png b/tests/ref/text/justify.png index 26787af9..38141bdc 100644 Binary files a/tests/ref/text/justify.png and b/tests/ref/text/justify.png differ diff --git a/tests/typ/text/hyphenate.typ b/tests/typ/text/hyphenate.typ new file mode 100644 index 00000000..d6f44477 --- /dev/null +++ b/tests/typ/text/hyphenate.typ @@ -0,0 +1,14 @@ +// Test hyphenation. + +--- +#set page(width: 70pt) +#set par(lang: "en", hyphenate: true) +Warm welcomes to Typst. + +#h(6pt) networks, the rest. + +--- +#set page(width: 60pt) +#set par(lang: "el", hyphenate: true) +διαμερίσματα. \ +λατρευτός diff --git a/tests/typ/text/justify.typ b/tests/typ/text/justify.typ index 7b8a2829..eb8feb61 100644 --- a/tests/typ/text/justify.typ +++ b/tests/typ/text/justify.typ @@ -1,9 +1,16 @@ --- -#set par(indent: 14pt, spacing: 0pt, leading: 5pt, justify: true) +#set page(width: 180pt) +#set par( + lang: "en", + justify: true, + indent: 14pt, + spacing: 0pt, + leading: 5pt, +) This text is justified, meaning that spaces are stretched so that the text -forms as "block" with flush edges at both sides. +forms a "block" with flush edges at both sides. First line indents and hyphenation play nicely with justified text. -- cgit v1.2.3