How TextBlock work with word-break (for CJK)

I’v tried to use TextBlock.wrap ( and so TextBlock.wrap.None + TextBlock.overflow ) to deal with CJK.
The best solution for me is set word-break to break-all. (cause contents are mainly CJK)
But I can’t figure out how to make it.
Could somebody give me some hints or maybe i need to use inherit function?

Thx a lot.

Angus.

Could you describe more precisely what the problem is? I am unable to reproduce any problems by modifying Family Tree (Japanese) to force some wrapping by setting the TextBlock.width to 30 or 40.

Does this problem only happen with CJK characters? Does it wrap text correctly with latin characters?

Does this problem only exist when the text is right-to-left? Does it wrap text correctly when the text is left-to-right?

It would help to see some small screenshots.

Thanks for your reply.
My text in TextBlock is like:

2017 年一二三四五六七八九十 one two 一二三四五六七八九十

which mainly in CJK with white space,.
It seems like when words between white space are not the same word scripts, it will automatically break one line, such as

For some reasons, the best solution to me is like this:

2017 年一二三四五
六七八九十 one tw
o 一二三四五六七
八九十

  • don’t automatically break line
    (seems like set CSS -> word-break: break-all;)

Thx a lot,

Angus.

That’s a feature that we can add in a future release, probably as another option to TextBlock.wrap.

Thanks for your reply.

My solution was:

1.use TextBlock.wrap.None
2.count half-width + full-width to figure out when to break lines manually
3.fix node data size manually

yap It’s stupid, but it works.

Thx a lot,

Angus.

Hello,

We are considering adding the wrapping feature: go.TextBlock.WrapBreakAll, which will allow wrapping at every character.

If you want to try it, you can use the temporary version of GoJS here: [EDIT: obsolete]

We have an example using that version, here, resize the Node to see: https://codepen.io/simonsarris/pen/WdmYzZ

Would this new wrap option work for your needs?