OpenGL Font Lib

I find a simple (and portable) lib to integrate into my OpenGL based game.

simpler and smaller FreeType?

thank

+2


source to share


4 answers


Try FTGL . It's portable, easy to use, and can display 3D fonts. But it uses FreeType2.



+2


source


If you are using QT there is a built in font rendering subsystem, assuming you have a QGLWidget subclass, there is a set of text rendering methods you can call



If you don't find a library, you can always render text on an image using Photoshop and then use it as a texture atlas and display textured squares.

+1


source


Try FreeType , here's a NeHe lesson on how to use it in an OpenGL program.

0


source


If you want to use FreeType, I have a simple OpenGL example of how to use it. I am drawing glyphs to a glyph cache that is supported by a texture. Then I draw the text using simple textured squares.

https://github.com/ccxvii/snippets/blob/master/glfont.c

If you don't want to use FreeType, you can trivially replace it with Sean Barret's stb_truetype.h truetype font rasterizer:

http://nothings.org/stb/stb_truetype.h

0


source







All Articles