Skip to content

Text wrapping support for more languages - #3450

Merged
pandamicro merged 2 commits into
cocos2d:developfrom
ntrrgc:text-wrapping
Apr 17, 2017
Merged

pandamicro merged 2 commits into
cocos2d:developfrom
ntrrgc:text-wrapping

Conversation

@ntrrgc

@ntrrgc ntrrgc commented Jan 31, 2017

Copy link
Copy Markdown
Contributor

I've modified the regexp in a way that should not modify their behavior in CJK languages but -- hopefully -- finds proper word boundaries in most Latin scripts (Spanish, French, German, Portuguese...) as well as in Greek and Russian.

@pandamicro

Copy link
Copy Markdown
Contributor

thanks~ Can you provide some texts for testing ?

@ntrrgc

ntrrgc commented Mar 15, 2017

Copy link
Copy Markdown
Contributor Author

Привіт як в тебе справи

Привіт як в
тебе справи

中文语句中是不包含空格的

中文语句中是
不包含空格的

¿Me preguntas por qué compro arroz y flores? Compro arroz para vivir y flores para tener algo por lo que vivir.

¿Me preguntas por qué
compro arroz y flores?
Compro arroz para vivir
y flores para tener algo
por lo que vivir.

@pandamicro

Copy link
Copy Markdown
Contributor

Thanks, I will check it out

@Dimon4eg

Copy link
Copy Markdown
Contributor

Nice!
Would be cool to do the same for cocos2d-x.

@Dimon4eg

Copy link
Copy Markdown
Contributor

I fixed it also for cocos2d-x.
here is PR cocos2d/cocos2d-x#17703

@pandamicro
pandamicro merged commit c901b28 into cocos2d:develop Apr 17, 2017
@pandamicro

Copy link
Copy Markdown
Contributor

Merged for v3.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants