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

Fix the ugly hack for Chinese display #2297

Closed
Benau opened this issue Aug 27, 2015 · 3 comments
Closed

Fix the ugly hack for Chinese display #2297

Benau opened this issue Aug 27, 2015 · 3 comments

Comments

@Benau
Copy link
Contributor

Benau commented Aug 27, 2015

Hi!

I wrote a patch for stk/irrlicht to make it be able wrap line for CJK automatically in #2110 , but there're lots problem discovered later.

Like space between chinese and english get ignored, incorrect linebreak, wrong wrapping position for english with chinese.

Luckily, today I fully solved it by rewriting the print part of statictext, I posted the patch to irrlicht devs before, but getting no response, so I post here to hear comments.

Now stk/irrlicht can handle most utf breaking rules for CJK (can add more in utfwrapping.h) , like no opening brackets at ending line or punctuation mark at starting line.

Here's screenshots:

2015-08-26 16-19-56
As u can see, even the most complex combination of english, chinese and brackets, stk/irrlicht can print without wasting too much space *i copy the translation from another msgstr because i don't know how to print that box
2015-08-26 16-39-24
As shown in the upper middle box, there's a unneeded newline for chinese, which fixed with the new patch.

Now some questions, is the code good enough? I don't know if I should add a extra .h for defination of
brackets and punctuation. Do u think this should be included in irrlicht trunk too?

Patch: http://pastebin.com/zU7BQL9G

@auriamg
Copy link
Member

auriamg commented Aug 28, 2015

Do you think you could submit that as a pull request? They are much easier to review and test than diffs

@Benau
Copy link
Contributor Author

Benau commented Aug 29, 2015

ok let me get more comments from the devs from irrlicht first, they say they may need more rewrite
(textwrapping should be in it's own class), but if you think that's beyond stk usage,tell me and I can do a pull reqest too.

see here for details:

http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=50938

@Benau
Copy link
Contributor Author

Benau commented Aug 29, 2015

Update!
From the latest post, they say textwrapping specific class is a larger topic, which I don't think it could be done in a short time.(for me too, i don't know very deeply about c++ like class/temples/constructor).

So I think it's better to make stk display chinese/jap/kr properly first, than improvement of irrlicht.

I will do pull request later.

@auriamg auriamg closed this as completed in 0a7a0d7 Sep 1, 2015
auriamg added a commit that referenced this issue Sep 1, 2015
Fix the ugly hack for displaying Chinese in #2110, and then fix #2297
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

No branches or pull requests

2 participants