diff --git a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp index c7fc63a47..7f2ef9b17 100644 --- a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp +++ b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp @@ -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) {