views:

323

answers:

3

So basically, how is non-western input handled in SDL or OpenGL games or applications? Googling for it reveals http://sdl-im.csie.net/ but that doesn't seem to be maintained or available anymore. Just to view the page I had to use the Google cache.

To clarify, I'm not having any kind of issue in terms of the application displaying text in non-western languages to users. This is a solved problem. There are many unicode fonts available, and many different ways to process text into glyphs and then into display surfaces.

I run a-foul in the opposite direction. Even if my program could safely handle text data in any arbitrary encoding, there's no way for users to actually type their name if it happens to include a character that requires more than one keystroke to produce.

+1  A: 

Usually everybody just ends up using unicode for the text to internationalize their apps.

I don't remember SDL or neither OpenGL implemented anything that'd prevent you from implementing international input/output, except they are neither helping at that.

There's utilities over OpenGL you can use to render with .ttf fonts.

Cheery
+1  A: 

You are interested in SDL_EnableUNICODE(). When you enable unicode translation, you can use the unicode field of SDL_keysym structure to get the unicode character based on the key user typed.

Generally I think whenever you do text input (e.g. user focuses on a textbox) you should use the unicode field and not attempt to do translation yourself.

Here's something we did in YATC. Not really a shining example of how things should be done, but demonstrates the use of the unicode field.

Ivan Vučica
A: 

It appears there is now a Google summer of code project on this topic, for both X11 and for MacOS X

TokenMacGuy