turbobadger icon indicating copy to clipboard operation
turbobadger copied to clipboard

support input unicode character

Open yushli opened this issue 9 years ago • 6 comments

Currently it seems turbobadger doesn't support input unicode character (e.g., Chinese). Is there any plan to add this support? Thanks.

yushli avatar Aug 21 '15 03:08 yushli

I have no such plans at the moment.

It wouldn't be such a big task to add API's and handling in Turbo Badger, but the actual platform integrations are a major pain to implement due to many undocumented behaviors of different input methods (i've done this before in proprietary software).

fruxo avatar Aug 21 '15 19:08 fruxo

I notice the display of text also doesn't support unicode. Would you like to add this support, e.g., for displaying Chinese text.

yushli avatar Sep 10 '15 03:09 yushli

It does. You just have to use a font that contains Chinese characters.

fruxo avatar Sep 10 '15 06:09 fruxo

looks like the default demo is not using freetype font. Which font file should I replace to see the result?

yushli avatar Sep 10 '15 09:09 yushli

You can define TB_FONT_RENDERER_STB or TB_FONT_RENDERER_FREETYPE to make it support true type fonts. The demo then loads resources/vera.ttf by default (which doesn't contain chinese).

You can add another true type font file containing chinese and make it the default. All this is done in Demo/demo01/Demo01.cpp

fruxo avatar Sep 10 '15 19:09 fruxo

it works now. Thank you for your kind help. TurboBadger is a nice library. Keep up the good work!

yushli avatar Sep 11 '15 07:09 yushli