On Fri, 7 Apr 2017 13:34:16 -0400
Post by Julia Dudascik (Contractor)Hi
Is there a way to draw text in a FXGLViewer window?
I need to add labeling to my model in the FXGLViewer window.
Thanks
Julia
Using OpenGL?
We have glUseFXFont(). It makes a display list containing character bitmaps
for each glyph in the font [actually, glyph indexes from first up to first+count].
You can then draw some text using the characters as index into the glyph display
lists, using glCallLists().
It is NOT sophisticated. For nicer drawing, use fonts rendered into a texture
map so it can do transparency etc.
There are some freely available libraries, like glFont and others; I have some
code that does this (not yet ready for prime time), it loads a file format
containing a monochrome texture tile + character metrics.
Then it can draw utf8 text into OpenGL at arbitrary angles. The font-texture
file is pre-computed by pulling font glyphs from FreeType, assembling them into
a texture map with optimal layout [wasting as little space as possible].
Here's what that looks like (attached), just for some ideas...
-- JVZ
+----------------------------------------------------------------------------+
| Copyright (C) 13:00 04/ 7/2017 Jeroen van der Zijp. All Rights Reserved. |
+----------------------------------------------------------------------------+