FTGL: Characters do not show up on rendering
My application does some text output with OpenGL and FTGL. I set up a font
like this:
Impl::font = new
FTTextureFont("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
if (Impl::font->Error() != 0) {
delete Impl::font;
throw std::runtime_error("Could not load font DejaVuSans.ttf!");
}
if (!Impl::font->FaceSize(72)) {
delete Impl::font;
throw std::runtime_error("Could not use DejaVuSans with size 72!");
}
I render like this:
glColor3f(1.0, 1.0, 1.0);
Impl::font->Render(my_string.c_str());
Now I have a major problem: There is one string which I create pretty
early in the program, which renders correctly. Then there's another string
which gets created later, and it renders only those letters which are also
contained in the first string. I can only assume that the texture font
does only create textures for the letters of the first string, but not for
those of the second string.
What could be the cause for this? Do I need to make it load all characters
I will use early? Is there something I'm missing?
(It would be quite some effort to boil my code down to a minimal example
that reproduces the error, so I ask first for something obvious I'm doing
wrong.)
No comments:
Post a Comment