Font conundrum
I'm working on making a simple interface system for my games/programs. And I've got a little problem. I've used FTGL until now for fonts and such, which is great, until you want to size a button, or title bar to match the font. Fonts are spcified in pt's with FTGL, and since there is no way to convert pt's to pixels... I'm stuck. So, I say to myself, "Well, my font's dont have to be fancy, maybe some simple character-mapped blocks will work." By "character mapped" I mean like this:
Letter "V":
And then I would have my code interpret the 1/0's to draw pixels to form letters onscreen. Then it hit me... this is gonna take a long time, for every letter, and some might not work out. Like *horror*... letter 'y'.
So, what about a simple font stored as an image, which I would then load with OpenIL, and display with OpenGL, while playing a song with OpenAL (open this, open that...
). I believe this is called font bitmapping. So I go about searching on macupdate and versiontracker and I found *ONE* piece of software... BitFonter 2. It's not free, and looks complicated. I just need to generate, or use something pre-generated a font, plain and simple. 
Either that or figure out how to convert PX's to PT's.
Anyway, suggestions?
Thanks!
Letter "V":
Code:
int v[] = {1,0,0,0,0,1,
0,1,0,0,1,0,
0,0,1,1,0,0,
0,0,0,0,0,0}And then I would have my code interpret the 1/0's to draw pixels to form letters onscreen. Then it hit me... this is gonna take a long time, for every letter, and some might not work out. Like *horror*... letter 'y'.
So, what about a simple font stored as an image, which I would then load with OpenIL, and display with OpenGL, while playing a song with OpenAL (open this, open that...
). I believe this is called font bitmapping. So I go about searching on macupdate and versiontracker and I found *ONE* piece of software... BitFonter 2. It's not free, and looks complicated. I just need to generate, or use something pre-generated a font, plain and simple. 
Either that or figure out how to convert PX's to PT's.

Anyway, suggestions?
Thanks!
FTGL works a consistent unit (pt, I think)... what size you draw that unit is entirely up to you.
OneSadCookie Wrote:FTGL works a consistent unit (pt, I think)... what size you draw that unit is entirely up to you.
But I have no idea how to set that size. Frankly, FTGL's documentation sucks. Sorry, but it's true. They seem to have a command for setting up bounding boxes, but of course the explanation was one sentence long and gave no examples.
Grr. Maybe if I just borrowed the font bitmap from Jedi Knight II, just maybe Raven Soft wouldn't notice.
You set the font size (in points) when you create the font, I think.
FTGL will tell you how big your string is, in points, I think.
As I said earlier, how big it is on the screen is *entirely up to you*. There's no way FTGL can tell you that.
FTGL will tell you how big your string is, in points, I think.
As I said earlier, how big it is on the screen is *entirely up to you*. There's no way FTGL can tell you that.
How big it is on the screen is entirely up to FTGL, you give it a size in PT's and it draws it in pixels, on the screen acoordingly.
I need the pixel size!
I need the pixel size!
FTGL uses whatever OpenGL state you've set up. That means the size is entirely up to you. More than that, which state affects it depends on which kind of FTGL font you're using.
Drop FTGL its awful, http://www.idevgames.com/forum/showthread.php?t=11993
Sir, e^iπ + 1 = 0, hence God exists; reply!
Right then... alternatives to FTGL?
If none are any good, I'll just use textures holding fonts. Or better yet... my game will have no actual text in it. Which is feasible, all my buttons could be textures.
But I'd rather not do that.
If none are any good, I'll just use textures holding fonts. Or better yet... my game will have no actual text in it. Which is feasible, all my buttons could be textures.
But I'd rather not do that.
have a look at http://zakariya.net/shamyl/etc/GlyphGen.zip
Sir, e^iπ + 1 = 0, hence God exists; reply!
unknown Wrote:have a look at http://zakariya.net/shamyl/etc/GlyphGen.zip
Wow... that's really good. I spotted the link to that in the other thread, but I wasn't sure if it was the latest version, or if I'd have to build it myself and debug it, which I'm too lazy to do. And yet I was willing to write out every letter imaginable with 1's and 0's for my own font header. Hmmm.

Thanks!
(How's GLUT-font for performance? Just for chucking an fps meter or something, and some hud text.)
GLUT's fine, I would use glutStrokeCharacter for an fps meter though.
Sir, e^iπ + 1 = 0, hence God exists; reply!
unknown Wrote:GLUT's fine, I would use glutStrokeCharacter for an fps meter though.
Any reason why? Performance, or just visual appeal...
I figured GLUT would be faster than say, loading something from GlyphGen pics and display them on quads.
Nuther question: (Again!)
If I wanted to simulated colorkey behavior like in SDL, I would need to write my own function to do so or use a third party plugin/library, correct?
Is there any other format besides TIFF that allows for a transparent background, or transparency? DevIL/OpenGL have trouble with TIFFs. Specifically, it just paints them all red or tints reddish/pinkish. As although pink font is cool, it's not really the look one would go for when designing an FPS or something.
If I wanted to simulated colorkey behavior like in SDL, I would need to write my own function to do so or use a third party plugin/library, correct?
Is there any other format besides TIFF that allows for a transparent background, or transparency? DevIL/OpenGL have trouble with TIFFs. Specifically, it just paints them all red or tints reddish/pinkish. As although pink font is cool, it's not really the look one would go for when designing an FPS or something.
pngpngpngp
Sir, e^iπ + 1 = 0, hence God exists; reply!
PNG is the usual format to use for full 8-bit transparency support.

