typst/tests/typ/text/justify.typ

33 lines
967 B
Typst
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
#set page(width: 180pt)
#set par(
justify: true,
indent: 14pt,
spacing: 0pt,
leading: 5pt,
)
This text is justified, meaning that spaces are stretched so that the text
forms a "block" with flush edges at both sides.
First line indents and hyphenation play nicely with justified text.
---
// Test that lines with hard breaks aren't justified.
#set par(justify: true)
A B C \
D
---
// Test that justificating chinese text is at least a bit sensible.
#set page(width: 200pt)
#set par(justify: true)
中文维基百科使用汉字书写汉字是汉族或华人的共同文字是中国大陆、新加坡、马来西亚、台湾、香港、澳门的唯一官方文字或官方文字之一。25.9%而美国和荷兰则分別占13.7%及8.2%。近年來,中国大陆地区的维基百科编辑者正在迅速增加;
---
// Test that there are no hick-ups with justification enabled and
// basically empty paragraph.
#set par(justify: true)
{""}