"texture not bound for character" error

I’m getting this error on the log screen:

OF_WARNING: texture not bound for character – line 660 in /Users/rangel/Documents/OF_v0.06/apps/Rangel/QuaseCinema/…/…/…/libs/openFrameworks/graphics/ofTrueTypeFont.cpp

I think it’s slowing down the app.

Any clues on what might be causing that?


it seems you are missing a font somewhere…

can you check that the font you are trying to use exists in the data folder and that you have the name of the font right.

take care!

no, the font is loaded. the error says its about missing characters in ‘character set’ of that font.

tested in fontsExample:

runs without warning:
franklinBook.drawString(“hello, this is franklin book calling\n”, 100,100);

runs, prints the warning and slows down app:
franklinBook.drawString(" ", 100,100); // where " " is the character: \t (tab)

Hi lian,

thank you! That seems to be it. I has actually setting the text variable to be full of blank spaces. And there was the error, flooding the console.

Now I changed it, until we find a better solution, to dots (’.’) , and the error is gone.

on testApp.h:

char textInput[20];

on testApp.cppp:

textInput[0] = ‘!’;
for (int x = 1; x <22; x++) {
textInput[x] = ‘.’;

Some other weird behaviour above (probably because of my C newbie ways…). The variable is set to have 20 chars in the array, but I have to make the for up to 21 to fully fill it with the dots, otherwise, weird characters show up on the end.

Still buggy.

I think I’ll rewrite the text input code. The bug is probably there.

What’s the right way to setup and edit a variable for this text input scenario:
On screen display of text with variable character count.

The input of the variable is setup the following way:

  • when the user clicks an icon or hits T: text editing is toggled on (the variable can be cleared at this point)
  • then all keys are directed to the text variable.
  • when the user hits return, text editing is finished.

PS - Maybe one of the 6 fonts the app uses is corrupted… will check that.

Got it running somehow ok…

the app doen’t crash or give errors all the time as it was doing.

	for (int x = 0; x <22; x++) textInput[x] = '.';  
// (...)  
if (textInputActive == 1) { // listen to text input keystrokes  
                switch (key){  
                    case OF_KEY_BACKSPACE:  
                        //for (int x = 0; x <22; x++) textInput[x] = '.';  
						textInput[textInputCharPos] = ' ';  
                        if (textInputCharPos > 0) textInputCharPos--;  
                    case OF_KEY_RETURN:  
                        textInputActive = -1;  
                        textInput[textInputCharPos] = key;  
                        if (textInputCharPos < 21) textInputCharPos++;  
                } // end switch  

hm, not sure - i think its more general, in your case it might work as a workaround to replace with “.” i run into the same problem, but didnt really resolve it yet - just commented out line 660 in ofTrueTypeFont.cpp to stop slowing down the app - and continued till now. the issue with that is ‘just ignoring them’ destroys the text-align which results in http://bit.ly/oWfUX

…looking at ofTrueTypeFont.cpp just now and came up with a different patch: http://pastie.org/496710

Hi lian. Thank you very much.
I applied the modifications to ofTrueTypeFont.cpp according to your diff file and now it worls ok!

Hi guys

I applied the pastie patch and I get rid of the warning but I still dont get why the problem occurs in the first place. What about ur cases? I dont have any probs if I load the font in the beginning of the programm execution but than always if I try to
load it on the fly. Any idea?

Thx in advance

no update on this ??

I am encountering the same problem, for now on I just commented out the warning

what confuses me is that I am not trying to do anything funky… just inputing proper text

I’m not by any means in the know about how C++ memory works, but I think it’s somewhere along those lines. I had the same problem (except no characters were printing as well as the error). I fixed it by changing from using reference to a font:

[tt]ofTrueTypeFont font; // in the header
with the corresponding usage:
[tt]font.loadfont(“arial.ttf”, 15);
font.drawString(… etc.)
to using a pointer:

[tt]ofTrueTypeFont* font; // in the header
with usage:
[tt]font = new ofTrueTypeFont();
font->loadfont(“arial.ttf”, 15);
font->drawString(… etc.)

Hope that helps.


I think it helped

I had changed sth in a file so that the message no longer gets displayed

I had some BAD_ACCESS errors and crashes in my program when I was moving text around on mouse drag - I used what you suggested and I seem to no longer get these crashes,

So I think it has made my program more efficient although I cannot be sure at the moment if the problem is indeed solved as I can no longer see the error message regardless…

thx anyway !