- added some common characters to be preloaded when fonts are loaded for better speed

This commit is contained in:
Mark Vejvoda 2011-06-25 22:26:56 +00:00
parent 4013af9447
commit 5f32d56b85

View File

@ -157,6 +157,11 @@ void TextFTGL::init(string fontName, int fontSize) {
if(ftFont->Error()) {
throw runtime_error("FTGL: error setting encoding");
}
// Create a string containing common characters
// and preload the chars without rendering them.
string preloadText = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890-=!@#$%^&*()_+:\"{}[]/?.,<>\\';";
ftFont->Advance(preloadText.c_str());
}
void TextFTGL::SetFaceSize(int value) {