Thanks in advance,
Rui Maciel
P.S.: On a side note, it appears that google buries comp.graphics.api.opengl in
it's google groups search. I don't understand how a search engine is able to burry
results from this newsgroup, which google claims to have around 1700 subscribers
(grossly inflated, I'm sure), while sticking in the very first result page a link
to a google group labeled as mac-opengl, which has 7 members
First you have to decide what you mean by "fonts"...
Do you want to use system fonts or supply font files
with an application? Do you want 2D? 3D? Outline or
filled...?
> A quick google groups
> search returned only very old posts, which I believe may not be up to date.
No, nothing's changed...
--
<\___/>
/ O O \
\_____/ FTB.
http://www.topaz3d.com/ - New 3D editor for real time simulation
> Currently, what is the best way to render fonts in an opengl? A quick
> google groups search returned only very old posts, which I believe may not
> be up to date. Ater a bit of digging I stumbled on FTGL, which appears to
> do the trick. Yet, what are your suggestions?
The thing is, that the way how one renders text (aka font glyphs) using
OpenGL hasn't much changed during the years. Essentially it's either:
* extract the glyph shapes tesselate into geometry and render as such.
or
* Rasterize glyphs into a pixmap and draw the text using these.
The source code of Blender2.5 has a very nice implementation of the later
method. And years ago I somewhere posted something similar.
Wolfgang
Can you give some pointers to implementations of/articles about this
method? AFAIK, TTF fonts are made of splines, so why tesselation?
I know and understand all of the above.
> For primitive font, all you need is to convert it into bunch of
> glVertex command in order to render it to screen.
Yes, but how to do the conversion?
There's a library called GLTT ...
>> * extract the glyph shapes tesselate into geometry and render as such.
>
> Can you give some pointers to implementations of/articles about this
> method?
Actually I'd rather suggest you to resterize the glyps. The quality will be
alot better than what you get with OpenGL. That is, because antialiasing
methods used by GPUs have not been optimized for font rendering, whereas
libraries like FreeType have been built for exactly that purpose.
FreeType offers you both: A font rasterizer and access to the glyphs' spline
data.
> AFAIK, TTF fonts are made of splines, so why tesselation?
Because the usual GPUs can't deal with splines. The spline evaluators of
OpenGL you might know about (glEvalCoord) are in fact nothing more, than a
tesselation interface, on most common implementations done by the CPU.
Wolfgang