Skip to content

Difference with text wrapping betwen 1.1.9 -> 1.2.0 and 1.3.0 #5081

@westriel

Description

@westriel

How would this new feature help increase access to p5.js?

I believe that this feature would help allow the text function to do what the programmer wants it to do and relieve programmers from confusion about differences in p5 sketches, as I myself was making something along with a friend. I had made my sketch before version 1.2.0 was released and my friend after, we did very similar things and our code was producing different output and confused us for quite a while.

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
  • Build tools and processes
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Friendly error system
  • Image
  • IO (Input/Output)
  • Localization
  • Math
  • Unit Testing
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Feature enhancement details:

There is a difference between p5's text function when using 5 parameters to create a textbox so that the text wraps along multiple lines.

In p5 version 1.1.9 the text wrapping works on a word by word basis (will always create a line break on a whitespace and not in the middle of a word), example here.

In versions 1.2.0 and 1.3.0 this functionality changed and now the text wrapping will split in the middle of the text, creating a hyphen on the end of the line, examples here for 1.2.0 and here for 1.3.0.

My request for feature enhancement would be a way to switch between these two modes of text wrapping. Perhaps add another parameter to the text function? This seems like a kind of clunky solution but at the moment I can't think of anything better. Does this feature already exist? If so how would I switch between the modes? Thanks for your consideration!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions