d3plus / d3plus-text

A smart SVG text box with line wrapping and automatic font size scaling.
MIT License
105 stars 19 forks source link

Japanese language should be included in noSpaceRange #96

Closed t-ohtsuki-cognitee closed 6 years ago

t-ohtsuki-cognitee commented 6 years ago

Thank you so much for this awesome library! Without TextBox I would have wasted several days :) I was a bit confused when I used TextBox with Japanese text, as the wrapping function seemed to be broken against it. After looking into the source for a moment, I found the reason: Japanese too should be included in noSpaceRange variable in src/textSplit.js !

Typical Japanese texts like "日本語は基本的にはスペースを含みません" have no space inside them! See e.g., Japanese Wikipedia article like https://ja.wikipedia.org/wiki/JavaScript.

davelandry commented 6 years ago

@t-ohtsuki-cognitee thanks for reaching out and for the kind words! I would love for this library to have better Japanese language support. What is your experience with JavaScript development? I'm a bit swamped with work at the moment, but could make time to review a Pull Request if you can make the necessary changes.

t-ohtsuki-cognitee commented 6 years ago

@davelandry Thanks for such a quick reply! The fix should be a quite small change so I'll make a PR soon.