PDA

View Full Version : Font display problem



Turn right
06-12-2004, 04:03 PM
can opengl display Chinese character font ?

thanks for directions

Korval
06-12-2004, 05:11 PM
OpenGL doesn't display fonts.

Or, alternatively, OpenGL can display any font you program it to.

IronicResearch
06-13-2004, 09:55 AM
Since font specs vary they are handled separately from core OpenGL spec which would expect that font glyphs be loaded into GL rendering contexts as 1-bpp bitmaps.

For Win32, there are WGL helper functions wglUseFontBitmaps() and wglUseFontOutines() to download such fonts as GL bitmaps which would be used for drawing text characters. Once the font is loaded, you would draw individual characters or strings of characters just like you would call alphabetically indexed display lists of glBitmaps.

If you've seen the Windows OpenGL Text3D screen saver, you could also see how font outlines can be used as extruded 3D objects. The source is part of the Win32 platform SDK if you're intereted, though a similar generic version is posted as one of GL programming examples at this site.