diegomura / diegomura/react-pdf

Line break issue for chinese font (Noto Serif Simplified Chinese)

Open
#2,917 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Describe the bug**
I’m experiencing an issue with line breaks in Chinese text when using @react-pdf/renderer. While text in other languages (e.g., English, French) automatically wraps within the set container width, Chinese characters are rendered in a single line, even when the text overflows the container width. This issue significantly impacts readability and layout in documents with Chinese text. I am using Noto Serif Simplified Chinese font.

**Expected behavior**
The Chinese text should wrap in next line when it exceeds the defined container width or page boundary.

**Screenshots**

![react-pdf-code](https://github.com/user-attachments/assets/a426d64c-4ff2-4046-ae81-7365475a6b11)
![react-pdf-renderer](https://github.com/user-attachments/assets/5c9504f1-53f3-40d3-a0d5-b7f056e180ae)

**Desktop (please complete the following information):**

- OS: Ubuntu, Windows
- Browser: Chrome, Firefox
- React-pdf version: v3.4.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.