You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Natural phrase-based line breaking for CJK and Thai (like word-break: auto-phrase) #8097
cjkChinese, Japanese, Korean typography.feature requestNew feature or requesttextRelated to the text category, which is all about text handling, shaping, etc.
In English and many similar languages, natural line breaking is easily supported due to the use of spaces to separate words. However, in languages such as Japanese, Chinese, and Thai, words are not separated by spaces. Therefore, achieving natural, phrase-based automatic line breaking is known to be a complex problem that typically requires morphological analysis or dictionary-based approaches.
In Chromium-based web browsers, the CSS property word-break: auto-phrase; has been implemented to support language-aware, phrase-based line wrapping1. Under the hood, this is powered by BudouX, which is a lightweight machine learning model by Google. Since utilizing a pre-trained model for this purpose is highly efficient and lightweight, it would be extremely beneficial if Typst natively supported such natural phrase-based line breaking.
Use Case
This feature benefits design-oriented typesetting in languages like Japanese, Chinese, and Thai.
Note that for Chinese, phrase-based line breaking is quite rare. It only exists in elementary textbooks that teach Chinese as a second language.
Therefore, this feature should be disabled by default for lang: "zh" when it’s implemented.
Edit: According to word-break CSS property - CSS | MDN (already shared above), CSS word-break: auto-phrase is supported only by Blink/Chromium, and has effect only if lang="ja".
This word-break: auto-phrase equivalent function is often vulnerable to proper nouns, so I believe users should need to explicitly enable it for all languages.
cjkChinese, Japanese, Korean typography.feature requestNew feature or requesttextRelated to the text category, which is all about text handling, shaping, etc.
Activity
YDX-2147483647 commentedon May 24, 2026
Note that for Chinese, phrase-based line breaking is quite rare. It only exists in elementary textbooks that teach Chinese as a second language.
Therefore, this feature should be disabled by default for
lang: "zh"when it’s implemented.More discussions (in Chinese) can be found at https://www.thetype.com/2018/01/14017/.
Edit: According to word-break CSS property - CSS | MDN (already shared above), CSS
word-break: auto-phraseis supported only by Blink/Chromium, and has effect only iflang="ja".3w36zj6 commentedon May 28, 2026
This
word-break: auto-phraseequivalent function is often vulnerable to proper nouns, so I believe users should need to explicitly enable it for all languages.