typst: Typst 0.13 `covers: "latin-in-cjk"` doesn't cover apostrophes and quotation marks

Let's "quote!" // Libertinus apostrophe/quotation marks

#set text(font: ((name: "Libertinus Serif", covers: "latin-in-cjk"), "Harano Aji Mincho"))

Let's "quote!" // CJK apostrophe/quotation marks
Image

If this is a feature, we should be cautious when using “latin-in-cjk”.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

#set text(font: ((name: "Libertinus Serif", covers: "latin-in-cjk"), "Noto Serif CJK SC"))

// #show "'": {
//   set text(font: "Libertinus Serif")
//   smartquote(double: false)
// }

// #show "\"": {
//   set text(font: "Libertinus Serif")
//   smartquote(double: true)
// }

#show smartquote: set text(font: "Libertinus Serif")

too 'bad' to be true...

这真是太‘坏’了

too "bad" to be true...

这真是太“坏”了
Image

Since that usually ' can only be seen in latin docs and in cjk usually use ‘ and “ instead (without smartquote feature), this would probably be a workaround.

Thank you very much. I certainly understand the difficulty of relying so heavily on text(lang:) in Typst. I’ll drop the above.

However, the “latin-in-cjk” problem is the same for both Chinese and Japanese, e.g.

#set text(font: ((name: "Libertinus Serif", covers: "latin-in-cjk"), "STFangsong"))
他说,“Let's go”。

will cause the apostrophe to be incorrect:

Image

As you have suggested, using regex is the most flexible way:

#set text(font: ((name: "Libertinus Serif", covers: regex("[\u0000-\u2019]")), "STFangsong"))
他说,“Let’s go”。

Thank you so much for your valuable suggestions.

How would

#let zh = langEnv(lang: ..., font: ..., ...)
#lang(env: zh)[今天天气“很好”]

be different from

#let zh = text.with(lang: ..., font: ..., ...)
#zh[今天天气“很好”]