Solved: writing unicode text in Monkey

Monkey Forums/Monkey Programming/Solved: writing unicode text in Monkey

Lindsay(Posted 2014) [#1]
I've asked a few times recently about various ways to be able to write non-English text to the screen in Monkey, and have explored most of solutions available. Turns out that what I needed was already here if you knew where to look ...

http://www.monkey-x.com/Community/posts.php?topic=4878

I can confirm that using GlyphDesigner to create the bitmap font, plus the code from the above thread, does indeed work perfectly. However, there are a few caveats; it doesn't support right-to-left systems (eg, Arabic), and there are some layout issues with some languages, especially the ones that use ligatures and other things. So far I can confirm that Arabic, Hindi, Hebrew and Thai don't work properly, but every other language I've tried (20, so far) does. It's pretty slow, but as my game is a word puzzle and not an action game, that's not an issue.

Thanks to Nobuyuki - without this code I think I'd have abandoned my game!


Nobuyuki(Posted 2014) [#2]
no problem, glad to hear it worked out for ya. RTL systems and ligatures are something that would have to be supported in the glyph-displaying implementation. The one used in monkey-utf8 is really just there to demonstrate that the underlying principal for reading utf-8 is sound. I'll be attempting to design a better system for font blitting in the future.

If I may brag for a sec! Most apps and devices don't support Unicode 7.0 (as far as I know, the release implementation is only 4 days old!) -- but if you want your game to use Unicode 7, you can do it in Monkey with monkey-utf8. Great for people who love emoji ;)