-
Notifications
You must be signed in to change notification settings - Fork 11
Chinese support #9
Comments
I think the forum might be the right place to ask questions as the probability is higher that other people will see it. However, Gorilla depends on Ogre and uses Ogre::String. In the current Ogre version, Unicode is not very well supported - so I doubt this will happen. So the imho cleanest way would be
|
I share the same concern with you. What if we could support via pre-processor an external unicode library? But at the very least, I suppose work could be done on the Font class, to store glyphs in a large array, and then a manual function for Caption and Markup to read from a non-string class; say a char/short array? It'd be very general but then unicode support could be built on top of that. |
Unicode LibraryI don't know whether a Unicode is necessary. Imho, a Unicode library would only become necessary if we started to convert between Ansi, UTF-8, UTF-16, UCS2, UTF-32 and so We could simply allow to switch via preprocessor between different #if defined(GORILLA_UNICODE_CXX11) || defined(GORILLA_UNICODE)
typedef std::u32string UnicodeString;
#elif defined(GORILLA_UNICODE_CXX03)
typedef std::basic_string<unsigned int> UnicodeString;
#else
typedef Ogre::String UnicodeString;
#endif
typedef UnicodeString::value_type UnicodeValue; When handling files, naming and loading an atlas and so I would keep using Ogre::String as Unicode would only add unnecessary complexity here without adding functionality. Storing FontsI actually think Gorilla should simply use Alternatively I suggest to create an own Mapping class
|
I like the Font idea, and at the very least then the Caption and Markup classes can have an 'backdoor' interface to turn in arrays of integers (or shorts) into valid glyphs in the TextureAtlas. If done correctly, then a glyph could be other things apart from a single character, such as emoticons or even icons. As for a UnicodeString, I'm for it too - but I'm a bit hesitant to comply to a single unicode C++ implementation, hence the 'backdoor interface' but I see no reason for having both to suit both worlds. Perhaps we should take this discussion to the Ogre forums, and see what other people think? |
How to display chinese
The text was updated successfully, but these errors were encountered: