Skip to content

Conversation

Decoy4ever
Copy link
Contributor

@Decoy4ever Decoy4ever commented May 27, 2023

resolves #5474

Changes:

Since the issue was caused was related to a line-break, we have added code that identifies line-breaks in the text if it exists. So lines are split accordingly where a line-break exists. We also added code to identify tab ('\t') characters in these lines, and replaced them with 2 spaces. What this entails is that textToPoint() is now able to print new lines, in the sense of moving to a new line prior to print the next character.

Screenshots of the change:

Screenshot 2023-05-27 at 9 35 15 am
Screenshot 2023-05-27 at 9 35 22 am

PR Checklist

Aqmalp99 and others added 4 commits April 29, 2023 22:23
@welcome
Copy link

welcome bot commented May 27, 2023

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

munusshih added a commit to munusshih/p5.js that referenced this pull request May 31, 2023
Based on this pull request:
processing#6163
@munusshih
Copy link
Contributor

Hi @Decoy4ever, thank you for your wonderful answer.
I'm working on this issue as part of my GSoC project and will integrate this as a future version of p5! yay!
We decide to adopt most of your answer but instead of y = y + fontSize, it should be fixed as y = y + this.parent._renderer._textLeading; since sometimes the textLeading() might not equal as the textSize().

@limzykenneth
Copy link
Member

@munusshih Instead of using the patch here in your own PR later, would you like to just review this PR and suggest changes necessary if you see any for this feature? So that @Decoy4ever would still be able to have their work here merged. Thanks.

@limzykenneth
Copy link
Member

@Decoy4ever Thanks for filing this PR. Your changes here are incorporated into #6184 as per @munusshih so I'll close this PR in favor of #6184.

@all-contributors please add @Decoy4ever for code

@allcontributors
Copy link
Contributor

@limzykenneth

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

I've put up a pull request to add @Decoy4ever! 🎉

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.

textToPoints() not handling line-breaks correctly
5 participants