timdream / wordcloud2.js

Tag cloud/Wordle presentation on 2D canvas or HTML

Home Page:https://wordcloud2-js.timdream.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Word wrap

virilo opened this issue · comments

Would it be possible to activate a word wrap break-down in order to insert a newline between words, when the tag label is using more area than the canvas width?

So, instead of shrinking the label "Indians of North America", break the text in two lines:
"Indians of
North America"

Thanks in advance

I tried to force this behavior by introducing a \n or a <br/> but neither of them worked.

this is something that would be very interesting. would be great if the lines could each have their own formatting, as for my specific usecase I'd want the second line to have a max font size that's smaller than the first line as it's just some supplemental text (specifically Country Name would be the first line and population size as the second)