Antialiased fonts

Started by
1 comment, last by Beco 17 years, 4 months ago
I'm looking for a method for drawing antialiased fonts in OpenGL. In my application I have to be able to draw all installed fonts in a correct form and antialiased if possible. The result should be something like MS Word can do. Outline fonts could be good if there were any useable method for antialiasing, otherwise they look very awful at a little size. I also tried Freetype, but I couldn't manage to get it support character-sets like Eastern-European. Is there any other way?
Advertisement
The Windows wgl has some functions for drawing text. However, they do not draw antialiased text at all (as far as I know). You will have to write your own font renderer or use a readily available one.

Nehe's tutorial #43 is about rendering anti-aliased bitmap fonts using FreeType, so if you want to roll your own, it's a good resource to get started. The FreeType manuals are also worth reading (although they are a bit out of date and somewhat incomplete).

There's a couple of FreeType font renderers available. There's GLTT and FTGL and GLttf (http://glttf.sourceforge.net). GLttf is written by me ;). You could pick one of those and use it to render text.

What comes to non-standard character-sets and FreeType, FreeType does support a bunch of different character encodings. If you are using character encodings that aren't supported by FreeType, you'll have to translate your characters into an encoding understood by FreeType. GLttf works with unicode and I can render my scandinavian characters, euro signs, copyright symbols and other non-ascii characters ok. Using unicode for your strings isn't really a bad idea.

-Riku
Thx for your help!

Well, I have two main problems with libraries based on FreeType. First of all, I can't tell you exactly why, but I'm a little bit afraid of the fact that they are bitmap-based. As far as I know FreeType generates an 8bpp texture for all characters, but what happens, when I have to zoom them for example. My solution has to be insensible of that. So that's why I prefer outline fonts.

The other thing is, and that's the bigger problem, that, OK, even if I manage to handle Eastern-European character set, the application is multilangual, so it has to be able to display any existing font-type (Russian, Korean as well) without any special and custom development. And yes, the wgl functions can handle them but in that case antialiasing is still an existing problem.

I think my problem is so special that I have to find my own way to solve it.

This topic is closed to new replies.

Advertisement