Skip to content

feat: support text-wrap to control orphans in paragraph#3408

Open
exoego wants to merge 1 commit into
diegomura:masterfrom
exoego:feat/text-wrap
Open

feat: support text-wrap to control orphans in paragraph#3408
exoego wants to merge 1 commit into
diegomura:masterfrom
exoego:feat/text-wrap

Conversation

@exoego
Copy link
Copy Markdown
Contributor

@exoego exoego commented May 3, 2026

This PR adds text-wrap to control how text inside an element is wrapped.

  • pretty: The linebreaker keeps the last whitespace from being a break point so the final line carries at least two words together.
  • nowrap: keep text on a single line. Useful for short labels or table-cell-like content where breaking the text would be wrong.
  • balance: to equalize line lengths for titles
  • stable: Not implemented. It is for user-editable content, which does not fit in PDF
image

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 3, 2026

🦋 Changeset detected

Latest commit: 67ab670

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@react-pdf/vite-example Minor
@react-pdf/stylesheet Minor
@react-pdf/textkit Minor
@react-pdf/layout Minor
@react-pdf/types Patch
@react-pdf/render Patch
@react-pdf/renderer Patch
@react-pdf/font Patch
@react-pdf/math Patch
@react-pdf/mermaid Patch
next-14 Patch
next-15 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- `pretty`: linebreaker keeps the last whitespace from being a break point so the final line carries at least two words together.
- `nowrap`: keep  text on a single line. Useful for short labels or table-cell-like content where breaking the text would be wrong.
- `balance`: to equalize line lengths for titles
@exoego exoego force-pushed the feat/text-wrap branch from a7b60ad to 67ab670 Compare May 3, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Word-Level Orphan Control

1 participant