From d19a4124de60b043e36e76dfe20fca193deb6a41 Mon Sep 17 00:00:00 2001 From: Peng Guanwen Date: Thu, 11 May 2023 21:02:52 +0800 Subject: Implement sophisticated CJK punctuation adjustment (#954) --- tests/ref/layout/par-justify-cjk.png | Bin 120972 -> 69448 bytes tests/ref/meta/numbering.png | Bin 36985 -> 35430 bytes tests/ref/text/chinese.png | Bin 21925 -> 20759 bytes tests/typ/layout/par-justify-cjk.typ | 17 +++++++++++++++-- 4 files changed, 15 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/ref/layout/par-justify-cjk.png b/tests/ref/layout/par-justify-cjk.png index 5efcc1e1..89a9af7d 100644 Binary files a/tests/ref/layout/par-justify-cjk.png and b/tests/ref/layout/par-justify-cjk.png differ diff --git a/tests/ref/meta/numbering.png b/tests/ref/meta/numbering.png index 984cf04c..8ddf3324 100644 Binary files a/tests/ref/meta/numbering.png and b/tests/ref/meta/numbering.png differ diff --git a/tests/ref/text/chinese.png b/tests/ref/text/chinese.png index 89ee357b..4762558d 100644 Binary files a/tests/ref/text/chinese.png and b/tests/ref/text/chinese.png differ diff --git a/tests/typ/layout/par-justify-cjk.typ b/tests/typ/layout/par-justify-cjk.typ index d82e72cd..8ceab65f 100644 --- a/tests/typ/layout/par-justify-cjk.typ +++ b/tests/typ/layout/par-justify-cjk.typ @@ -5,7 +5,7 @@ // Most Chinese publications do not use hanging punctuation at line end. #set page(width: auto) #set par(justify: true) -#set text(overhang: false, lang: "zh") +#set text(font: "Noto Serif CJK SC", lang: "zh", overhang: false) #rect(inset: 0pt, width: 80pt, fill: rgb("eee"))[ 中文维基百科使用汉字书写,汉字是汉族或华人的共同文字,是中国大陆、新加坡、马来西亚、台湾、香港、澳门的唯一官方文字或官方文字之一。25.9%,而美国和荷兰则分別占13.7%及8.2%。近年來,中国大陆地区的维基百科编辑者正在迅速增加; @@ -33,4 +33,17 @@ 《书名》《测试》下一行 《书名》《测试》。 -] \ No newline at end of file +] + +--- +// Test Variants of Mainland China, Hong Kong, and Japan. + +// 17 characters a line. +#set page(width: 170pt + 10pt, margin: (x: 5pt)) +#set text(font: "Noto Serif CJK SC", lang: "zh", overhang: false) +#set par(justify: true) + +孔雀最早见于《山海经》中的《海内经》:\u{200b}“有孔雀。”东汉杨孚著《异物志》记载,岭南:“孔雀,其大如大雁而足高,毛皆有斑纹彩,捕而蓄之,拍手即舞。” + +#set text(font: "Noto Serif CJK TC", lang: "zh", region: "hk") +孔雀最早见于《山海经》中的《海内经》:「有孔雀。」东汉杨孚著《异物志》记载,岭南:「孔雀,其大如大雁而足高,毛皆有斑纹彩,捕而蓄之,拍手即舞。」 -- cgit v1.2.3