Dear All:
I am new to this forum,but old player of glest.By the way, as a Chinese,my girl friend will refuse to play glest against me for the menu,hint and etc are all English or something else,not Chinese.
When I have the time to go through the source code, I found just the code cannot display a UTF8 string,actually only ASCII code can be displayed.
I have cut the code from text_render_gl.cpp.
and method of handling the string take 1 characters as 1 byte.
But actually,sometimes it takes 2 bytes or even more.
for (int i=0; utext!='\0'; ++i)
I a newbie at opengl,can somebody help to solve this issue ?
So,I also glad to be a translator for Chinese language.
for (int i=0; utext[i]!='\0'; ++i) {
switch(utext[i]){
case '\t':
rasterPos= Vec2f((rasterPos.x/size+3.f)*size, y-(size+1.f)*line);
glRasterPos2f(rasterPos.x, rasterPos.y);
break;
case '\n':
line++;
rasterPos= Vec2f(static_cast<float>(x), y-(metrics->getHeight()*2.f)*line);
glRasterPos2f(rasterPos.x, rasterPos.y);
break;
default:
glCallList(font->getHandle()+utext[i]);
}
}