french accent

zolt4n

18-02-2008 16:57:10

Hi I'm trying since 1 week to put a french accent like é in a label

But It 's allways buging in quickgui .

I use arial.ttf like that
acmesa.10
{
type truetype
source arial.ttf
size 10
resolution 72
}


missed I something ?

thx U

ps:arial.ttf allowing french accent

kungfoomasta

18-02-2008 18:27:46

Are you using GUIManager::setSupportedCodePoints? Make a list of all code points you want to be able to display on the screen and call this function.

Artic_Ice83

18-02-2008 18:31:28

hi! i don't know if it is the same thing, but i tried to to the same thing with a text box. if i use "setText("é"); the application crash...i don't know if the fact that is an UTF string can serve...

kungfoomasta

18-02-2008 18:37:37

If it crashes, post the line of code that is causing the crash. :P

Artic_Ice83

18-02-2008 19:17:58

ok.
this is the code:



QuickGUI::TextBox* tb123 = mPanel->createTextBox();

tb123->setText("è natale");



and this is the stack call...



kernel32.dll!RaiseException() + 0x52 byte

msvcr80d.dll!_CxxThrowException() + 0x50 byte

prova_QuickGUI.exe!Ogre::UTFString::_verifyUTF8(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & str="è natale") Riga 2153 + 0x41 byte C++

prova_QuickGUI.exe!Ogre::UTFString::assign(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & str="è natale") Riga 1220 + 0x9 byte C++

prova_QuickGUI.exe!Ogre::UTFString::assign(const char * c_str=0x0045fa0c) Riga 1253 + 0xc byte C++

prova_QuickGUI.exe!Ogre::UTFString::UTFString(const char * c_str=0x0045fa0c) Riga 859 C++

prova_QuickGUI.exe!SimpleGUIDemoApp::createGUI() Riga 362 + 0x10 byte C++



to bypass the problem i don't write "è" but "e' "...maybe this is a problem in Ogre and not in quickgui.i use the latest svn of quick gui and the ogre SDK 1.4.5

i try this code also in the demo and it crashes too...

kungfoomasta

18-02-2008 19:23:01

It looks like the problem is with creating an Ogre UTFString, but you won't be sure unless you debug it. Are you able to step into the code and see what's happening? Are you running in debug mode? The call stack doesn't look very accurate..

Artic_Ice83

18-02-2008 19:34:12

the problem is in the validation and creation of the Ogre UTF string because throw an exception "bad UTF-8 continuation byte", and yes i am in debug mode.
what do you mean for "be able to step into the code and see what's happening"?put interruptions points?

kungfoomasta

18-02-2008 19:36:43

put interruptions points?

Yep. I don't know what IDE you're using, but it would be helpful to put in breakpoints and step through the code, so you can see whats happening when the crash occurs, as well as the inputs that are used in the functions.

Artic_Ice83

18-02-2008 20:01:03

i have "forced" the progress in the program after the setText call and i have noted that in the text box the mData variable of mCaption have this value "è ®atale" and the mData of mOutput too.

name = mData

value = "è ®atale"
type = std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >

i don't know what to do...
:(

kungfoomasta

18-02-2008 21:13:34

I really have no idea what the problem is, I use plain english on my end..

Although it looks like somebody was able to display Chinese using QuickGUI, so the code can't be that bad. :wink:

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6479

Artic_Ice83

18-02-2008 21:34:07

ok. i'll try to update the ogre to 1.4.6 and then try.

zolt4n

19-02-2008 10:00:41

I have same probleme segfault in Ogre utf8 string if it's work fine with Ogre 1.4.5 say me because I'm desapointed now !!!


kungfoomasta

have I to do GUIManager::setSupportedCodePoints
only for displaying accent or doest it not crached if I do that ?

And can you says me how code_point works ?
like that ? Ogre::UTFString::code_point code = "é"

darkdragon

19-02-2008 13:00:27

Maybe you could try this

acmesa.10
{
type truetype
source arial.ttf
size 10
resolution 72
code_point 33-166 192-255
}

to add Latin-1 unicode char to Ogre

Artic_Ice83

19-02-2008 14:55:25

well! so adding that code in the font file and use the GUIManager::setSupportedCodePoints can correct this crask?

zolt4n

19-02-2008 16:00:43

It doesnt work dragon I allways have segfault in utf8 verify

kungfoomasta

19-02-2008 17:28:57

Basically if you can get characters rendering using the Ogre Overlay system you can get them rendering with QuickGUI. Post on the main Ogre forums if you have problems with UTF and using non-english characters, I can't really help here.