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

Long CJK text overflows without wrapping #14837

Closed
Contextualist opened this issue Sep 24, 2021 · 3 comments · Fixed by ppy/osu-framework#6231
Closed

Long CJK text overflows without wrapping #14837

Contextualist opened this issue Sep 24, 2021 · 3 comments · Fixed by ppy/osu-framework#6231
Labels
area:comments osu!framework issue Can't resolve this without changes to osu!framework. priority:2 Moderately important. Relied on by some users or impeding the usability of the game type:online

Comments

@Contextualist
Copy link

Describe the bug:
See the comparison for this map's comment section:

Lazer's beatmap overlay:
osu_cjk_long-lazer

Web:
osu_cjk_long-web

Long comments in English works just fine, such as those in this map.

osu!lazer version:
2021.916.0

Logs:
Not applicable

@smoogipoo smoogipoo added area:comments type:online priority:2 Moderately important. Relied on by some users or impeding the usability of the game labels Sep 24, 2021
@bdach bdach added the osu!framework issue Can't resolve this without changes to osu!framework. label Sep 24, 2021
@bdach
Copy link
Collaborator

bdach commented Sep 25, 2021

This was in the back of my mind when thinking about localisation support for text flow. The way I was going to try is to integrate International Components for Unicode with framework - the library in question provides support for finding potential word break location in a text.

@peppy
Copy link
Member

peppy commented Oct 19, 2021

A good start would just be to wrap at any character, which does look to be what the browser is doing for chinese at least.

@bdach
Copy link
Collaborator

bdach commented Oct 30, 2021

Because I was poking around text flow localisation work anyhow I went to check how big would the overhead involved with adding ICU be. And the results are... not encouraging.

Test cases were: 1 single word, the first paragraph of lorem ipsum, and the first paragraph of the first google search result for "japanese lorem ipsum".

2021-10-30-212328_1067x207_scrot

Maybe I screwed up my benchmark but I did expect something like this to happen. Probably best to use a naive implementation based on character ranges, then, until someone notices that doesn't work 100% at least.

@bdach bdach changed the title Long comment contents in CJK characters overflow without wrapping Long CJK text characters overflows without wrapping Feb 13, 2023
@bdach bdach changed the title Long CJK text characters overflows without wrapping Long CJK text overflows without wrapping Feb 13, 2023
bdach added a commit to bdach/osu-framework that referenced this issue Mar 29, 2024
- Closes ppy/osu#10085
- Closes ppy/osu#14837

I'm not really considering the performance implications of this, just
looking to get a baseline more-correct behaviour in place.

The change is basically a best-effort heuristic, although I did use a
slightly smarter split method for CJK to attempt to ensure no hanging
punctuation.
bdach added a commit to bdach/osu-framework that referenced this issue Mar 29, 2024
- Closes ppy/osu#10085
- Closes ppy/osu#14837

I'm not really considering the performance implications of this, just
looking to get a baseline more-correct behaviour in place.

The change is basically a best-effort heuristic, although I did use a
slightly smarter split method for CJK to attempt to ensure no hanging
punctuation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:comments osu!framework issue Can't resolve this without changes to osu!framework. priority:2 Moderately important. Relied on by some users or impeding the usability of the game type:online
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants