yglukhov / nimx

GUI library
MIT License
1.1k stars 75 forks source link

Please try to support unicode strings #180

Open kingofoz opened 8 years ago

kingofoz commented 8 years ago

Seems Japanese menu cannot be displayed, do we support that?

yglukhov commented 8 years ago

Could you please provide some steps (or better sample code) to reproduce this, given that I don't know how to input Japanese? Nimx text rendering is designed to work with UTF8 strings.

yglukhov commented 8 years ago

Related to #20?

kingofoz commented 8 years ago

Not sure if this issue is relevant with #20. #20 is tied with win10. Anyway, please change label.text = "Hello, world!" to label.text = "你好" in the demo code, you should reproduce the issue.

yglukhov commented 8 years ago

@kingofoz, ok, the problem is that Arial.ttf which is used by default as system font on windows (the defaults are hard-coded in font.nim) does not support unicode characters. Currently I don't see a good solution to this problem. We could use some other ttf file that supports more languages (e.g. on macos there's Arial Unicode.ttf) but I can see no such option in windows. Can you suggest anything?

yglukhov commented 8 years ago

Now that I think of it, we should probably utilize platform native api to generate glyphs and that should do the trick.

alynch4047 commented 8 years ago

How about including

https://github.com/googlei18n/noto-fonts

which aims to "provide a beautiful reading experience for all languages" ?

kingofoz commented 7 years ago

Hi @yglukhov Any updates to this issue?