- updates for possible chinese support (but i really doubt this shows the right text) but still a good start

This commit is contained in:
Mark Vejvoda 2011-05-25 21:17:15 +00:00
parent cc958d266e
commit 8f56fc4657
1 changed files with 28 additions and 4 deletions

View File

@ -167,11 +167,35 @@ void TextRenderer3DGl::render(const string &text, float x, float y, float size,
glTranslatef(x-scale, y-scale, 0);
}
glScalef(scale, scale, scale);
for (int i=0; utext[i]!='\0'; ++i) {
glCallList(font->getHandle()+utext[i]);
}
if(Font::fontIsMultibyte == true) {
//setlocale(LC_CTYPE, "en_ca.UTF-8");
//wstring wText = widen(text);
//glListBase(font->getHandle());
//glCallLists(wText.length(), GL_UNSIGNED_SHORT, &wText[0]);
//string utfText = text;
//glListBase(font->getHandle());
//glCallLists(utfText.length(), GL_UNSIGNED_SHORT, &utfText[0]);
string utfText = text;
glListBase(font->getHandle());
glCallLists(text.length(), GL_UNSIGNED_SHORT, &utext[0]);
//std::locale loc("");
//wstring wText = widen(text);
//std::string strBuffer(Text.size() * 4 + 1, 0);
//std::use_facet<std::ctype<wchar_t> >(loc).narrow(&Text[0], &Text[0] + Text.size(), '?', &strBuffer[0]);
//string utfText = std::string(&strBuffer[0]);
//glListBase(font->getHandle());
//glCallLists(utfText.length(), GL_UNSIGNED_SHORT, &utfText[0]);
}
else {
for (int i=0; utext[i]!='\0'; ++i) {
glCallList(font->getHandle()+utext[i]);
}
}
glPopMatrix();
glPopAttrib();