ofDrawBitmapString with moving coordinates produces shaky text (linux)


This is the code and my problem:

void draw(){
    ofPoint pos(ofGetWidth()*ofGetElapsedTimef()*0.005, ofGetHeight()*ofGetElapsedTimef()*0.005);
    ofDrawRectangle(pos, 100, 40);
    ofDrawBitmapString("some text", pos+ofPoint(10,10));

On my machine (linux64) the resulting text is not moving smoothly with the rectangle, it wobbles around just a tiny bit all the time. Can anyone confirm or tell me the reason or tell me how to stop it from doing that?

Thanks and regards,

the rectangle is antialiased when drawn so it can draw correctly at subpixel resolutions but the text being a texture with no antialiasing looks wobbly because it can only be drawn correctly at pixel resolution. ofTrueTypeFont has antialiasing but doesn’t support subpixel resolution so that won’t solve it either.

You can try to make the position an integer or round it before using it for drawing so both the rectangle and the text are always drawn at the exact nearest pixel which would have the same effect as disabling antialiasing for the rectangle but the movement won’t look as smooth.

The only real solution would be to implement subpixel antialiasing for ofTrueTypeFont

I see. Thanks for explaining. Could I actually help doing that? I don’t really get far with looking into ofTrueTypeFont but I also don’t know what to look for.