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

Let characters other than space break lines

Open kyfex-uwu opened this issue 1 year ago • 2 comments

Increasing access

This would increase support for languages that use different spaces, and it would give greater control over text as a whole.

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 request details

Currently, when rendering text with a width parameter the given text is only broken on space characters. If a user wants to insert characters like a zero width joiner in order to allow text wrapping in a specific spot, p5 just ignores it and will not split the text.

kyfex-uwu avatar Sep 09 '24 16:09 kyfex-uwu

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

welcome[bot] avatar Sep 09 '24 16:09 welcome[bot]

I'm not sure I understand the use case here:

text('some text \n this is a new line', 50,50)

would work with or without setting the width

or is it something for specific languages? Thai? (I'm sorry for my ignorance)

orrkislev avatar Sep 12 '24 16:09 orrkislev

in v2.0 users can pass the character to split on

dhowe avatar Nov 14 '24 13:11 dhowe