Unicode revisited

psquare

09-03-2010 06:17:34

I have an application which needs unicode support.

I can change the ttf file to ArialUni.ttf, but I understand, to support different character sets/languages, I have to change the code_ranges in the core_font.xml as well.

All this is working fine. However:

Our app has a console logging feature, where we render text to the console (using MyGUI). The text for this can be any language though. Our app does allow user to put any unicode string:

setConsole3DText(const std::wstring& text)

which we then forward to the MyGUI edit/text control. e.g.
void Edit::insertText(const Ogre::UTFString & _text, size_t _index = ITEM_NONE) { insertText(_text, _index, false); }

Obviously, if a character is not in the range as defined by core_font.xml this doesn't work.

As I understood, MyGUI generates fonts by rendering the codes mentioned in the core_font.xml to a texture. Hence, supporting all possible character ranges/languages will result in a very large texture and probably wont work (didn't try it)

Is there any other way this can be solved?

Altren

09-03-2010 08:18:03

Well, you probably don't need many languages at the same time, so you can do next thing: generate fonts for different languages and load file with language that is currently used in application.