Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(typography): add JUSTIFIED horizontal alignment for bounded text in 2D renderer#8294

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Vansh0204 wants to merge4 commits intoprocessing:main
base:main
Choose a base branch
Loading
fromVansh0204:feat/justified-align-pr1

Conversation

@Vansh0204
Copy link

@Vansh0204Vansh0204 commentedNov 25, 2025
edited
Loading

PR 1

  • Adds textAlign(JUSTIFIED) support in the 2D renderer for bounded text(...) .
  • Distributes inter-word spacing to fill maxWidth on non-final lines; final line remains ragged.
  • Canvas2D maps JUSTIFIED to LEFT internally; WEBGL remains left-aligned for now.
  • Lint/build pass locally. Follow-up PR will add textWrap(PRETTY) and BALANCE .

Addresses#7712

…erer- Justifies non-final lines in bounded text()- Keeps final line ragged- Maps Canvas2D textAlign to LEFT when JUSTIFIED is set- WEBGL remains left-aligned for nowRefsprocessing#7712
@dhowe
Copy link
Contributor

@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 JUSTIFIED alignment in the 2D renderer covering inter-word spacing distribution and edge cases. I'll push them shortly.

@dhowe
Copy link
Contributor

a good place to start would be the alignment tests inhttps://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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Vansh0204@dhowe

[8]ページ先頭

©2009-2025 Movatter.jp