Skip to main content
GameDev.net gamedev.net
🔒 Locked

Font Building

Started by neowneow Jan 10, 2005 at 7:22 PM 3 replies 650+ views
Original Post
neowneow
neowneow
I'm very new to OpenGL, and have just started learning how to build bitmap fonts. Everything has gone very smoothly, except there is one thing I have been trying to do that I cannot figure out. That is, when printing text onto the screen, how can I make it so I am able to specify a size for the text? I have been following the NeHe tutorials, so I use glPrint(cont char*) method. I do know how to make it so the font set is a certain size, but I do not know how to print various sizes of text once I have declared my font set. I would prefer a simple method for accomplishing so, but any answer I get will be much appreciated.
Xero-X2
Xero-X2
perhapes, glScalef(x,y,z); will help. You can make that glScalef(0.5,0.5,0.5); and everything will be rendered at half size, take a box thats 1x1x1 it would then be 0.5,0.5,0.5 hope that helps some
"I seek knowledge and to help those who also seek it"
neowneow
neowneow
Thanks for the reply, but glscale doesn't seem to change the size of the font. Maybe this has to do with the fact that I'm using bitmap fonts. I have tried texture mapped fonts with .tga files, but can't seem to get them to display properly (the screen goes white whenever glPrint is called).
kburkhart84
kburkhart84
I would say to use various fonts with different sizes each. Or you can go to the 3d Outline fonts, use one and they WILL resize with glScalef(). About the texturing, did you enable automatic texture coordinate generation like in the NEHE tutorial??


ff8
ff8
like what Xero-X2 said:" You can make that glScalef(0.5,0.5,0.5); and everything will be rendered at half size, take a box thats 1x1x1 it would then be 0.5,0.5,0.5 hope that helps some"

but i think you put glScalef before glPrint like this
glScalef(1,.5f,1);
glPrint();
this will not effected the font size because NEHE used glPushMatrix/glPopMatrix for the GL_MODELVIEW go inside BuildFon() and put before the for loop
glScalef(Xsize,Ysize,0);//Xsize and Ysize are globals
and before you draw your text in your render function give the Xsize and Ysize the value you want .
i hope this work
bye!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.