Skip to content

Conversation

@Vansh0204
Copy link

@Vansh0204 Vansh0204 commented Nov 26, 2025

PR2

  • Adds textWrap(PRETTY) and textWrap(BALANCE) to improve line-breaking aesthetics.
  • Uses dynamic programming to minimize raggedness; last line has zero penalty.
  • Integrates with existing text flow in 2D; works with all alignments, including JUSTIFIED .
  • Lint/build pass locally.

Addresses and resloved #7712

…anced word wrapping\n\n- Introduces and wrap styles\n- Uses dynamic programming to minimize raggedness\n- Integrates with 2D renderer; works with existing alignments including JUSTIFIED\n\nRefs processing#7712
@welcome
Copy link

welcome bot commented Nov 26, 2025

🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors!
🤔 Please ensure that your PR links to an issue, which has been approved for work by a maintainer; otherwise, there might already be someone working on it, or still ongoing discussion about implementation. You are welcome to join the discussion in an Issue if you're not sure!
🌸 Once your PR is merged, be sure to add yourself to the list of contributors on the readme page !

Thank You!

@Vansh0204
Copy link
Author

Hello @osteele @andrewn @zeke @reidab sir can u please review my PR.

@dhowe
Copy link
Contributor

dhowe commented Nov 27, 2025

@Vansh0204 have you created tests for this feature?

@Vansh0204
Copy link
Author

Thanks for reviewing, sir! I haven't added tests yet – I'll add comprehensive unit tests for the PRETTY/BALANCE textWrap modes covering the main functionality and edge cases. I'll push them shortly.

@dhowe
Copy link
Contributor

dhowe commented Nov 28, 2025

a good place to start would be the alignment tests in https://github.com/processing/p5.js/blob/dev-2.0/test/manual-test-examples/type/index.html

image

eventually we will also need pixel-based tests like those here: https://github.com/processing/p5.js/blob/dev-2.0/test/unit/visual/cases/typography.js

@Vansh0204
Copy link
Author

Hi @dhowe, sir! I've updated the PRs to include the necessary tests.
Screenshot 2025-12-01 at 12 05 08 AM

@dhowe
Copy link
Contributor

dhowe commented Nov 30, 2025

Sorry, did you make this PR against the dev-2.0 branch ?

@Vansh0204
Copy link
Author

Yes sir, the PR is currently targeting dev-2.0. Should I change the base branch to main instead, or would you prefer I rebase my changes on top of dev-2.0? Let me know which branch you'd like me to target, and I'll update accordingly.

@dhowe
Copy link
Contributor

dhowe commented Dec 1, 2025

Yes sir, the PR is currently targeting dev-2.0. Should I change the base branch to main instead, or would you prefer I rebase my changes on top of dev-2.0? Let me know which branch you'd like me to target, and I'll update accordingly.

I'm seeing main as the target for this pr:
image

@Vansh0204
Copy link
Author

Vansh0204 commented Dec 1, 2025

Yes @dhowe sir, that's correct! The PR is targeting main. I can see it shows "base: main" at the top of the PR. Let me know if there's anything else you'd like me to address!

@Vansh0204 Vansh0204 requested a review from osteele December 1, 2025 14:48
@dhowe
Copy link
Contributor

dhowe commented Dec 1, 2025

both of these PR's need to target dev-2.0 as we're not adding features to v1.x (which his still main) at this point

@Vansh0204 Vansh0204 changed the base branch from main to dev-2.0 December 1, 2025 15:05
@Vansh0204
Copy link
Author

Vansh0204 commented Dec 1, 2025

@dhowe sir, I have to work on it.

@Vansh0204 Vansh0204 changed the base branch from dev-2.0 to 2.0-lint-warnings December 1, 2025 15:18
@Vansh0204 Vansh0204 changed the base branch from 2.0-lint-warnings to main December 1, 2025 15:18
@Vansh0204
Copy link
Author

Vansh0204 commented Dec 1, 2025

Hi @osteele and @dhowe, sir, I have raised new PRs can you please review them. Should I close these two PRs?

@dhowe
Copy link
Contributor

dhowe commented Dec 1, 2025

Hi @osteele and @dhowe, sir, I have raised new PRs can you please review them. Should I close these two PRs?

yes please

and thanks for your work!

@Vansh0204
Copy link
Author

Thank you, @dhowe sir for your guidance.

@Vansh0204
Copy link
Author

@dhowe Sir, one last request, can you please review my new PRs?

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.

3 participants