Skip to content

Numbering patterns "一" and "壹" doesn't respect text region setting #6484

@WenSimEHRP

Description

@WenSimEHRP

Description

#set text(lang: "zh", region: "tw", font: "Noto Serif CJK TC")
#set page(width: auto, height: auto, margin: 2em)

```typst
#set text(
  lang: "zh",
  region: "tw",
  font: "Noto Serif CJK TC"
)
#numbering("壹", 123456789123)\
#numbering("一", 123456789123)\
```
 
Expected:

壹仟貳佰叄拾肆億伍仟陸佰柒拾捌萬玖仟壹佰貳拾叄\
一千二百三十四億五千六百七十八萬九千一百二十三

Actual:

#numbering("", 123456789123)\
#numbering("", 123456789123)\

Image

The numbering pattern only works for zh_CN and zh_SG.

zh_TW and zh_CN uses different characters for those numbering patterns. zh_CN uses "零壹贰叁肆伍陆柒捌玖拾佰仟万亿一二三四五六七八九十"(萬億), whilst zh_TW uses "零壹貳叄(參)肆伍陸柒捌玖拾佰仟萬億一二三四五六七八九十"。The numbering function should respect the regional differences.

A workaround is to run the .replace method several times.

Reproduction URL

https://typst.app/project/plLY4S1B6caZuC3sNdkNnr

Operating system

Webapp

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or requesttextRelated to the text category, which is all about text handling, shaping, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions