Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No line break for paragraphs with only Chinese characters #327

Open
infomagic-docs opened this issue Apr 28, 2022 · 1 comment
Open

No line break for paragraphs with only Chinese characters #327

infomagic-docs opened this issue Apr 28, 2022 · 1 comment
Labels
bad output rinohtype's output is not correct bug

Comments

@infomagic-docs
Copy link

infomagic-docs commented Apr 28, 2022

When using Rinoh type for PDF for RST docs in Chinese as paragraphs (normally no space between characters by nature), the paragraphs in the generated PDF have no line break and exceed the page (as shown in the first paragraph in the screenshot). When generating the docs, a "item too long to fit on line" error is displayed.

Do you have any ideas on how to fix this? We tried editing styles like width, ligatures, etc., but got no luck.

If we add white spaces in the paragraphs (the second paragraph in the screenshot), the paragraph breaks at the whitespaces. There's no issue with a pure English paragraph.

image
image

Content in the RST file for testing:
纯中文不换行文本。纯文本格式,就是没有任何文本修饰的,没有任何粗体,下划线,斜体,图形,符号或特殊字符及特殊打印格式的文本,只保存文本,不保存其格式设置。将所有的分节符、分页符、新行字符转换为段落标记。

纯中文换行文本:纯文本格式,就是没有任何文本修饰的,没有任何粗体,下划线,斜体,图
形,符号或特殊字符及特殊打印格式的文本,只保存文本,不保存其格式设置。将所有的分节
符、分页符、新行字符转换为段落标记。

Please also provide the following information:

  • rinohtype version: latest from github master 0.5.4
  • Sphinx version: 4.5.0
  • Python version: 3.9
  • operating system: CentOS
@infomagic-docs infomagic-docs added bad output rinohtype's output is not correct bug labels Apr 28, 2022
@brechtm
Copy link
Owner

brechtm commented Jun 22, 2022

rinohtype will only break lines on spaces currently. I'm thinking this could relatively easily be changed depending on the language set for the document. It would be great if rinohtype could render Chinese documents!

I was trying to reproduce this issue, but I haven't been able to find a typeface including Chinese characters that will not crash rinohtype on loading. I tried rinoh-typeface-notosanscjk and Noto Serif SC Which typeface did you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad output rinohtype's output is not correct bug
Projects
None yet
Development

No branches or pull requests

2 participants