PDA

View Full Version : FONTS? What do you use???



jpummill
09-11-2002, 05:31 PM
Hi All,

I was wondering if I could get some insight (kind of a poll if you will) about what you all use for displaying fonts in OpenGL.

Yes, I have read a lot of information on the web about fonts and OpenGL:

OpenGL font FAQ: http://www.opengl.org/developers/code/features/fontsurvey/
FTGL: http://homepages.paradise.net.nz/henryj/code/#FTGL
glFont: http://students.cs.byu.edu/~bfish/glfont.php
GLF: http://romka.demonews.com/projects/glf/index_eng.htm

To name a few sites that I have looked at. But what I was really wondering is - What do the people who visit this site use on a regular basis and why did you make that decision (easy to use, fast, cross platform, anti-aliasing, etc...)

Just curious.
jpummill

ioquan
09-11-2002, 10:08 PM
Use a 256x256 texture with all of the characters on it. Then you draw the letters with textured quads, using texture coordinate tricks to display the appropriate letters. When you load this texture, make the area around the letters transparent.

There is a tool somewhere on the nehe page that will generate a font texture like the one I mentioned, using the fonts on your computer.

tobiaso
09-11-2002, 11:19 PM
I use the same technique... A texture with characters. Alphablends them on to the screen to get nice anti-aliasing.

Have written a small, simple program to generate font images and texture coordinates. Image is then touched up in photoshop.

The actual drawing is more or less exactly what nehe describes on his site... There are a couple of font tuts that you can check out!

/hObbE

Allan Walton
09-12-2002, 12:04 AM
I use the same method - i use the ascii value of the character to get the x and y coordinates of the letter on my font texture and display it that way - it's really easy to do

e.g. A = 65 (pretty sure but it's early) = 6 character widths down and five across...

Cheers

Allan

Mazy
09-12-2002, 12:36 AM
You can use Fonture to make a Font-Texture

the principe is the same, but the generator is a bit more flexible than glFont. You can have larger textures( better looking fonts ) and use non monospaced fonts

save as tga gives you a .tga and a .txf ( the later is a txt but with a stupid name, will change that) the textfile aer easy to parse but you might ask abotu the a,b and c values.. just look at the link here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_85f7.asp


and the link to the program - http://mazy.annat.nu/files/Applications/Fonture/

/Mikael

jpummill
09-13-2002, 08:14 AM
Thanks to everyone who replied.

So is no one using a library (like FTGL) to dynamically load fonts?

jpummill

nexusone
09-13-2002, 08:53 AM
I have been using glutBitmapCharacter for text....

Mazy
09-13-2002, 09:38 AM
I have my program as an component for me to use.. but for demos and games you dont need that.