p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

[2.0] Additional text alignment options

Open dhowe opened this issue 8 months ago • 5 comments

Increasing access

Increases readability and text aesthetics over more languages and charsets

Most appropriate sub-area of p5.js?

  • [ ] Accessibility
  • [ ] Color
  • [ ] Core/Environment/Rendering
  • [ ] Data
  • [ ] DOM
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [x] Typography
  • [ ] Utilities
  • [ ] WebGL
  • [ ] Build process
  • [ ] Unit testing
  • [ ] Internationalization
  • [ ] Friendly errors
  • [ ] Other (specify if possible)

Feature enhancement details

  • [ ] Support JUSTIFIED as horizontal alignment argument (prob via standard dynamic programming algorithm)
  • [ ] Support PRETTY and/or BALANCE as arguments to textWrap() as described here

dhowe avatar Apr 09 '25 10:04 dhowe

Hello, @dhowe can u please assign me this issue.

Vansh0204 avatar Nov 24 '25 18:11 Vansh0204

Sure, though each is a significant chunk of work (I actually wonder if they should be separate tickets). Which do you plan to tackle first?

dhowe avatar Nov 24 '25 19:11 dhowe

  • I’ll split into two PRs.
  • PR1: textAlign(JUSTIFIED) in 2D for bounded text(...) , final line ragged.
  • PR2: textWrap(PRETTY) + BALANCE (alias), DP-based balanced breaks.
  • WEBGL falls back to left for now; I can follow up with justified glyph positioning later.

Vansh0204 avatar Nov 25 '25 20:11 Vansh0204

Hello @dhowe sir, I have raised both PRs can u please review them.

Vansh0204 avatar Nov 26 '25 07:11 Vansh0204

Hello @ksen0 @osteele @andrewn Sir, can you please review my 2 PRs?

Vansh0204 avatar Nov 27 '25 18:11 Vansh0204