Changing the size of text

Started by
5 comments, last by LGAB 19 years, 9 months ago
Hello everyone, I'm new here! I'm developing a GUI using OpenGL atm and I'd like to change the size of my text on the fly. I've been using the text-routines in the NeHe tutorials, and the only way I've found to change textsize is to rebuild the font each time, which is very slow. What do you guys use to draw text? Cheers everyone
Advertisement
I created a font engine a while ago. You might want to check it out. http://66.31.232.6/
I'm not sure about the bitmap fonts, but if you use the 3d fonts(the tutorial after the bitmap fonts), you can just scale the vertices with glScalef(). Just like any other 3d object or primitive, the scaling affects the 3d fonts as well.


Cool kmaz, I'll check it out for sure.

About 3D fonts.. does it work the same with ortho-viewports as with 3D? Perhaps that would be cool because scaling is exactly what I'm doing to some of my widgets, so if the text would scale seamlessly with it then I guess it's perfect for my needs :)

Thanks a million guys
3d fonts work exactly the same as any other 3d object. They light up etc.. That also means that in ortho, they still work scaling included, they look 3d, but they don't project, just like anything else you do in Ortho mode, but if you create the 3d font with a depth of 0.1 or less, you really can't tell that it is a 3d font when using ortho mode anyway,not much anyway.


You know if its faster or slower to draw compared to bitmap fonts? I might need a lot :) Also, I noticed that the Nehe tutorial on 3D fonts are windows-specific. Even tho I'm developing on w32 right now I want to keep this application open for porting later on. What would be the best route to take?

I might settle with perhaps three different sizes tho, perhaps I can pre-build those fonts and switch those at runtime?

Thanks again
If anyone is interested, I tried building a number of fonts while initiating the application, this works perfect for my needs, so I'm a happy camper for now ;)

This topic is closed to new replies.

Advertisement