Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 19659 fix 3b #20650

Open
wants to merge 4 commits into
base: v4
Choose a base branch
from
Open

Issue 19659 fix 3b #20650

wants to merge 4 commits into from

Conversation

mnievas
Copy link

@mnievas mnievas commented Feb 6, 2021

The current implementation based the decision of which char is a word separator on the location of the device but some games let the user decide the language from a settings, so it is good to let them the choice.

I added these option for the developer to choose from:

WordSeparatorBasedOnDevice: current implementation
WordSeparatorSpaceSlashNotHighUnicode: Spaces and '-' will be consider words separators. Recommended for Korean
WordSeparatorSpaceSlashAndKCJ: Spaces, '-' and KCJ unicodes will be consider words separators. Recommended for Spanish

You can see the test on:
Node:UI > GUI Dynamic Create Test > RichTest Test > language

The function findSplitPositionForWord receives the parameter wordSeparatorMode and chooses the inline function (charWrappableFunctionPointer) to be use in getNextWordPos and then in std::find_if to look for a good spot to but the sentence.

To make the decision I use these facts:

  • space (32) as word separator for Spanish, English, Russian, etc.
  • char '-' (45) is also a separator for English
  • CJK unicodes has a len of 3 or more. (named as HighUnicode)
  • Chinese has CJK but no separator
  • Korean has CJK but space is a separator

First approach to see the problem of wrapping words in different languages
Solution 1 with wrapping failing on Korean languages
Same languages like Spanish has space (32) as word separator.  Other like Chinese has no separator.

The current implementation based the decision of which char is a word separator on the location of the device. Some games let the user decide the language from a settings, so it is good to let them th choice.

CJK unicodes has a len of 3 or more.

I added these option for the developer to choose from:

WordSeparatorBasedOnDevice:   current implementation

WordSeparatorSpaceSlashNotHighUnicode:  Spaces and '-' will be consider words separators.  Recommended for Korean

WordSeparatorSpaceSlashAndKCJ: Spaces, '-' and KCJ unicodes will be consider words separators.  Recommended for Spanish

You can see the test on:
Node:UI > GUI Dynamic Create Test > RichTest Test > language

The fnction findSplitPositionForWord receives the parameter wordSeparatorMode and chooses the inlinen function (charWrappableFunctionPointer) to be use in getNextWordPos and then in std::find_if to look for a good spot to but the sentence.
@mnievas
Copy link
Author

mnievas commented Feb 6, 2021

Original issue #19659

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.

None yet

1 participant