it seems like every tutorial I can find on doing text with opengl is either windows only or uses a black and white texture wtih all the characters on it. Well, I’m not going windows only so I seem to be stuck with the latter option. My question is about displaying this type of font so that the letters are not translucent. It seems to me that the only option I have for blending mode is: GL_SRC_ALPHA, GL_ONE as long as the texture is black and white. Since this will always result in a translucent texture. So what I’m wondering is if there is another blend mode I could use, if I should start looking for textures with white characters and a transparent background so I can use: GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, or other solutions people have found to get around this.
if I should start looking for textures with white characters
and a transparent background
Just create those.
http://www.lmnopc.com/bitmapfontbuilder/
Or write your own tool… or use the one from SPGL.
found the solution. By using the LUMINANCE_ALPHA format instead of RGBA. Now I can use GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA with grayscale images to get transparent backgrounds and fully opaque foregrounds (yeah, I’m still a bit of an ogl newb). I’m now using a modification of spgl’s FontConverter that doesn’t require other spgl classes. I think I’ll write a simple gui for it just so I can view all the fonts on my system…
p.s. I would recommend looking at spgl’s font stuff to anyone else looking for a nice way to do text with OpenGL, there is a lot to know (and now I know more than I ever wanted to…) about text/fonts.
God knows it took me long enough to figure out!
Cas 
A java binding to FreeType2 ( http://www.freetype.org/ ) may be quite an elegant way to go. It is very lightweight, portable and flexible, and allow to render glyphs from almost any kind of font file to a memory buffer dynamically. I’ll be glad to see it be part of lwjgl’s util library ( i can even participate if someone is interested ).
Already discussed few days ago. Sorry that.
Another way of doing it could be the use of bitplanes (the code for it is somewhere in the redbook)
Advantages:
- You can color the bitplane u are drawing in any way you like.
- No blending needed, and the background is fully transparent.
- Very clear fonts / no scaling could screw up your quality
Disadvantages:
- you can’t use them as textures in 3d, just for 2d text rendering in the foreground
- you just have one font size available for each bitplane-font you are creating.
But for GUI use it should do the job.