peterhry / CircleType

A JavaScript library that lets you curve type on the web.
https://circletype.labwire.ca
MIT License
695 stars 222 forks source link

Whitespaces are being ignored at the end or beginning of text #142

Open cophiesarius opened 2 years ago

cophiesarius commented 2 years ago

Firstly thank you for your work!

Unfortunatley I'm experiencing an Issue regarding whitespaces at the end or beginning of a text I'm using CircleType on. It seems that the whitespaces are being ignored, resulting in an uneven result when using some seperators like this:

CircleType_WhitespaceIssue

I also tried using protected whitespaces like '&#160' or ' ' but without success.

Would it be possible to take ending or beginning whitespaces into account when using CircleType?

Thanks and Greetings from Germany!

TomoyaKuroda commented 2 years ago

I think you can use a custom splitter like this. var demo7 = new CircleType( document.getElementById('demo7'), (string) => (string + ' ').split('') ); Here is the demo. https://codepen.io/tomoyakuroda/pen/rNJBxJo