PDA

View Full Version : Fonts in opengl



07-27-2000, 07:34 AM
I am writing a 2D graphics application that requires the use of fonts. I have used the implementation of fonts in the "OpenGL Programming Guide" but since only capital alphabetic letters were defined, I would have to define numbers and symbols, etc. myself. Before I do this I wanted to know if there is an existing package that can do this. I've already tried glBDF but it didn't work on the Borland C++Builder 5.0 compiler, and additionaly I would require it to be open source, which it is not. I only need the most simple text implements, so advanced features are not neccesary (maybe a table feature, but that would be it) Thanks if you can provide information on this to me.

-Mike Powers

Leyder Dylan
07-27-2000, 07:57 AM
Hi,

See at :
http://nehe.gamedev.net/tutorials/lesson13.htm

You 'll can display font with ths lesson

SED
07-27-2000, 11:05 AM
"I only need the most simple text implements"

glutBitmapCharacter() may be all you require.
It has only 8 fonts to choose from, but it will render every character on your keyboard. Upper and lower case as well.
I use it to label objects in 3D space. You just set a glRasterPos() to anchor the first character, then stream the characters and glut will space the remaining out for ya.

I like it for 3D because the labels follow my
model no matter where I translate/rotate and the text stays in a horizontal orientation.

07-27-2000, 11:40 AM
The glutBitmapCharacter() would do the job nicely- I only really need 1 font. Thanks for the info, but the problem here is that I'm not using glut here- I'm working in the wxWindows Framework with the wxGLCanvas control. If I could use the glut function without using glut to do anything else that would be great, but I don't know if it is possible.

If I can't, does anyone know of a similar function that would work without using glut?

Thanks,

-Mike

nikopol0
07-27-2000, 02:59 PM
a great API to draw font with opengl : http://reality.sgi.com/opengl/tips/TexFont/TexFont.html