Mogre unicode building woes - has anyone build w/ UTF yet?

handcircus

18-12-2007 12:49:22

Hello,

Several people have mentioned a unicode build (for overlays) but has anyone successfully built one yet? I've made some progress with building Mogre with Unicode - I've successfully compiled OGRE with Unicode enabled, and modified the autogenerated code to enable reading unicode strings for the getters, ala:

String^ TextAreaOverlayElement::Caption::get()
{
return gcnew System::String(static_cast<const Ogre::TextAreaOverlayElement*>(_native)->getCaption( ).asUTF8_c_str(),System::Text::Encoding::UTF8);
}


But this is where my head starts to melt a little bit. I presume for the setters, the code for "InitNativeStringWithCLRString" in Marshalling.cpp needs a similar function to be implemented for UTF8 strings. But at this stage I'm really out my depth.

Any help would be *greatly* appreciated. Marioko, I see that in your latest post you mention that you are working on a UTF build - do you know when that is likely to be ready? Is there anything I can do to help.

Thanks in advance :)

Simon

Marioko

18-12-2007 13:12:29

hi, that is very easy to do.. today i should be have builded and uploaded...

I starting building now...

[Edit] You can help me if give me a short app with i can test the unicode support!!

handcircus

18-12-2007 13:20:02

hi, that is very easy to do.. today i should be have builded and uploaded...

I starting building now...


Amazing! :D Thanks so much for your help and such a speedy response. That is a great xmas present

Simon

[EDIT] Cool, I'll get one wrapped up now

handcircus

18-12-2007 14:02:57

Ok, theres a simple test project here:

http://www.handcircus.com/temp/TestUTF.zip

Its very straightforward, just sets a textarea overlay's caption to "Français". This may still not work though! The fontdef file might not be set up properly so the character might be missing and I'm not able to test within Ogre. If it does work though, the missing character should be a single space width (or no width), as opposed to the double space width that it currently is.

Thanks again :)

Simon

[EDIT] I've just noticed that the previous build (1.4.3) that Ogre was using was unable to read Unicode bitmap fonts from the fontdef file. Theres an explanation of it here, and a patch for OgreFontManager.cpp. Do you know if this was sorted out in the 1.4.5 version that you are using?

http://www.ogre3d.org/phpBB2/viewtopic. ... hlight=utf

Also I've attached a (hopefully) correctly made bitmap fontdef file and replacement media. You should be able to overwrite and use these.

http://www.handcircus.com/temp/utf_bitmap_font.zip

Cheers,
Simon

Marioko

18-12-2007 14:43:53

ok thanks...

Marioko

18-12-2007 23:45:56

ok i am very close to make it (mogre with unicode support), but i have bussy day and tomorrow i should have this 100% fixed (also each compilation or linked is very slow, a normal clr problem). Be patient..

handcircus

19-12-2007 09:00:15

Great, thanks again for your help.

Marioko

21-12-2007 01:39:17

Yaaaaahooooooooooo!!!

I made it.. finally i could fix mogre with unicode support, now i dont have time to upload it, but tomorrow will be the Day!!! c ya!

Here a screenshot:

handcircus

21-12-2007 08:26:52

Thats brilliant news! :D Thanks so much for the effort to get this working, it will be invaluable for the project I'm working on.

Marioko

21-12-2007 15:55:34

uploaded, see thread: "Mogre 0.2.3 ... released"