A fast and sweet way to draw text in openGL applications

I searched around and all I found about drawing text to the screen was using bitmap fonts or outline fonts that’s quite when you want something looking good. And I believe text shouldn’t be something complicated to draw. It’s very useful to find bugs with coordinates or angles when making a game.
Anyway…That’s it ! I want text !

text is OS dependent and also format dependent so this can’t be put inside GL. Use the bitmapped text for good quality. What’s wrong with bitmapped text or outlined text?


Well…nothing is really WRONG with the bitmap font or the outline font but you’re limited with the number of font style you use you have to have a bitmap for every fontstyle you want to have in your application right ?
Anyway I tought this could have been a good idea ! maybe not ! hehe !

GLUT has the ability to do this and I think (not sure, but check the source code and see)that the fonts are not integrated into it.

Bitmapped and outlined fonts can be moved to GLU and perhaps a number of them can be integrated, but is not something to be put inside OpenGL.

We will always need wglFontBitmaps and whatever else there is.


GLUT fonts are built in, and you cannot load your own font either.

I draw text in GL all the time. At the moment I use wglUseFontOutlines which loads the poly outlines of fonts in a display list. This is great . DirectX has no solution for this. GL does this very well, but it could be improved. For instance an option to draw the glyphs in a solid line format would be nice. At the moment there is only two options polygon or line. The line option draws the polygon in wireframe. The ability to draw the glyph with a single solid line (which you could vary in thickness) would be nice. There are some internationalization issues as well (double byte fonts) but I would settle for a fast solid line option in wglUseFontOutlines.

Cool I’ll try wglUseFontOutlines !
And you’re right if i only draws the polygons or lines…it should also draw solid lines and letting the programmer to choose the thickness of that line !