Error drawing ofTrueTypeFont letters as rectangles

I’m copying the example fontsExample into a project that uses ofxNI2.
In the setup, everything with the font is correct:

    bool fontLoaded = myFont.load("helvetica.ttf", 35, true, true, true, false, 72);

in draw

    myFont.drawString("Testing", ofGetWidth()/2, ofGetHeight()/2);

For some reason, maybe a call inside openNI is causing the texture to draw only rectangles, not the letters.
I tried by chance to set ofDisableDepthTest(); glDepthMask(false) or glDepthMask(true).
But I can’t find what is causing that.
Any suggestion?


did you try stuff like wrapping the letters into some :





Hi Pierre,
Yes I also tried that. I started to play with gl cull face, but nothing. It looks like it’s something from ofxNI2, I replicated the project without Kinect library and the text appears as usual.

I have seen this on Android sometimes. I’m not sure what causes it exactly, but I think it is that the font has not been successfully loaded for some reason.

After calling the font first in setup, before kinect device, it started to draw the typography normally. I don’t get why kinect device is causing the issue but now it is resolved.

    ofTrueTypeFontSettings settings("helvetica.ttf", 24);
    settings.antialiased = true;
    bool fontLoaded= theFont.load(settings);

It seems to me that ofTrueTypeFont could really use ways to test and ensure a font is loaded correctly.