High Quality Text

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

High Quality Text

rooch84
Morning all,

I'm currently porting an existing Flash project (don't ask) into Java.  There is no specific reason to use JOGL other than I have some OpenGL experience.  One of the few good things about Flash is the clearly rendered text, especially for small font sizes.

I would like to both have clear text and take advantage of a 3D environment (rotations etc..). I have tried using TextRenderer but cannot get clear text for small font sizes.  

Is there a better library that I can use?  Or are there tips or tricks that would allow for better quality rendering?  Perhaps using texture rendered text.

Cheers
Chris
Reply | Threaded
Open this post in threaded view
|

Re: High Quality Text

Demoscene Passivist
Administrator
The problem with using TextRenderer and TextureRenderer is that the font is rasterized two times. First by Java2D to generate the texture and second by OpenGL by drawing the texture. This really distortes/blurs the font rendering resulting in bad quality.

If u really want high quality font rendering using JOGL theres no way around glut.glutStrokeCharacter() wich renders the strings as mesh. With multisampling enabled u should get a decent quality especially when rotating the string (not as good a dedicated truetype font-rendering engine, but way better than Java2D+OpenGL).

As a starting point how to achieve OpenGL font rendering with meshes take a look at the Nehe Lession 14: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=14

There's a JOGL port for this lesson available here: http://nehe.gamedev.net/data/lessons/jogl/lesson14.jar
Reply | Threaded
Open this post in threaded view
|

Re: High Quality Text

matt
In reply to this post by rooch84
i have written a couple of classes that utilize bmfont ( http://www.angelcode.com/products/bmfont/ ) to create and render fonts at any size. if many people are interested i might publish them.
Reply | Threaded
Open this post in threaded view
|

Re: High Quality Text

rooch84
I'd be interested in having a look.  One thing I haven't got my head around yet is calling c functions from within Java.

Cheers
C
Reply | Threaded
Open this post in threaded view
|

Re: High Quality Text

rooch84
In reply to this post by Demoscene Passivist
Thanks for the reply.  I've had a look at glutStrokeCharacter.  While it is clearer, the ability to use only two fonts is a major problem.   I'm hoping BMFont might be a solution.

Cheers
C