mirror of
https://github.com/glest/glest-source.git
synced 2025-08-26 17:34:24 +02:00
- added some common characters to be preloaded when fonts are loaded for better speed
This commit is contained in:
@@ -157,6 +157,11 @@ void TextFTGL::init(string fontName, int fontSize) {
|
|||||||
if(ftFont->Error()) {
|
if(ftFont->Error()) {
|
||||||
throw runtime_error("FTGL: error setting encoding");
|
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) {
|
void TextFTGL::SetFaceSize(int value) {
|
||||||
|
Reference in New Issue
Block a user