processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.46k stars 3.29k forks source link

Let characters other than space break lines #7258

Open kyfex-uwu opened 1 week ago

kyfex-uwu commented 1 week ago

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?

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.

welcome[bot] commented 1 week ago

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!

orrkislev commented 5 days ago

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)