I'm using blf in a modal operator to draw help text on the 3D viewport. Here's a snippet:

bgl.glColor4f(1.0, 1.0, 1.0, 1.0)
    blf.position(FONT_ID, x, y, 0)
    blf.draw(FONT_ID, line)
    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)

This works well, but when the user moves the mouse, the text flickers: when the mouse is moving it's a bit bigger, and when it stops it goes smaller. When it's bigger it also appears a little blurry. I think the texture that the text is being painted onto is being scaled incorrectly when the mouse moves. I've checked the parameters that I'm passing to blf.draw and blf.position, and they're not changing.

Is there any way I can stop this from happening?


1 Answer 1


Oops, I should have been setting the font size.

blf.size(FONT_ID, 14, 72)

My guess is that some other text code is not resetting the font size properly. Similarly, when using text shadow, you have to set the blf.shadow_offset (even if you want to leave it at 0, 0) to avoid the shadow flickering.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .