Pyglet does font rendering.

I don't know whether Pyglet plays nice with Tkinter / Togl applications. Maybe you can give pyglet an OpenGL context to use?

If it *does* work, then you could use any installed font, or font files you provide. See classes Label (plain text) and HTMLLabel (formatted with layout):

I once borrowed someone else's code (origins lost in the mists of time, sorry!) which uses pyglet font rendering to render text to a texture, rather than to the screen:


On 01/12/2010 18:46, Philip Winston wrote:
I have a Tkinter/Togl/PyOpenGL app and am interested in my options for drawing 2d text in the OpenGL window.  Text for heads-up text or labels of entities, maybe tooltip-like prompts.  I don't care about supporting arbitrarily fonts, as long as I have one good readable font.

Is it possible to use glutBitmapString even though I'm not using GLUT?  Is this a reasonable approach, any tips for speed?

I'd like to keep my dependencies minimal.  I saw PyFTGL but wondered if it might be overkill for my needs, and it requires FTGL and FreeType.


------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
_______________________________________________ PyOpenGL Homepage _______________________________________________ PyOpenGL-Users mailing list

Jonathan Hartley      Made of meat.   +44 7737 062 225   twitter/skype: tartley