Typst wish list for a Japanese user
-
treat inline maths as Latin and automatically insert spaces between them and Japanese text
-
set font size independently for CJK and Latin
#set text(lang: "ja", font: ("New Computer Modern", "Harano Aji Mincho"))
Beethoven交響曲第9番 \
Beethoven#text(0.925em, "交響曲第")9#text(0.925em, "番")

latter is often preferable
-
set penalty for Japanese widow character (line consisting of a single character except punctuation e.g. “す。” at the end of a paragraph)
-
vertical Japanese typesetting (someday!)
2 Likes
Y.D.X
2
I’d say all four points are also applicable to Chinese (except that there are subtle differences between C/J for the vertical writing mode).
Thanks! Alas, the regex workaround for the second point does not work quite well.
#set text(lang: "ja", font: "Harano Aji Mincho")
あ、「あ」。
#show regex("[\p{scx:Han}\p{scx:Hira}\p{scx:Kana}]"): set text(font: "Harano Aji Mincho", size: 0.925em)
あ、「あ」。

The first line is typeset correctly (a la jlreq!), but the second line is a mess, punctuations and quotations got square bounding boxes.
1 Like
pg999w
4
In Typst 0.13 we can set CJK and Latin font family separately.
#set text(font: (
(name: "Inria Serif", covers: "latin-in-cjk"),
"Noto Serif CJK SC"
))
But currently we cannot set font size separately. I can imagine API like
#set text(font: (
(name: "Inria Serif", covers: "latin-in-cjk"),
(name: "Noto Serif CJK SC", size: 0.925em)
))
It is not hard to implement, but @laurmaedje do not like the idea of having both size
parameter in top level text element and in font list.
Some discussion here: [Draft] Add font objects by bluebear94 · Pull Request #4093 · typst/typst · GitHub
1 Like