Open david43 opened 7 months ago
I think I will mark it as "won't fix" for now. Konva breaks by space character
. I am not sure what will be the fast implementation from Konva side to automatically handle different languages.
A quick solution would be checking if the language of a char uses spaces as word boundaries. (e.g. /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu
) and split by chars for those languages.
Interested in making a pull request with a test?
demo: https://codepen.io/david43/pen/rNbZwjb if text mixed Chinese and Eng,the line break will wrong. set text wrap:"char" can fix this issue, but eng word also broken.