GLTT
Index

Home
About
Download
Documentation
Mailing Lists
Contribute
Old News
Links
"OpenGL"
Source Forge

Documentation
How To Use It
To create a bitmapped font:

       FTFace face;
       if( ! face.open("arial.ttf") )
         fatal("unable to open ttf file");
       GLTTBitmapFont font(&face);
       int point_size= 20;
       if( ! font.create(point_size) )
         fatal("unable to create bitmapped font");
       // ... OpenGL initialization commands...
       glColor3f(1,1,1);
       font.print( x, y, "hello bitmapped world" );

To create an anti-aliased pixmapped font:


       FTFace face;
       if( ! face.open("arial.ttf") )
         fatal("unable to open ttf file");
       GLTTPixmapFont font(&face);
       int point_size= 20;
       if( ! font.create(point_size) )
         fatal("unable to create pixmapped font");
       // ... OpenGL initialization commands...
       glColor3f(1,1,1);
       font.output( x, y, "hello anti-aliased world" );

To create an outline font (vectorized contours only):


       FTFace face;
       if( ! face.open("arial.ttf") )
         fatal("unable to open ttf file");
       GLTTOutlineFont font(&face);
       int point_size= 20;
       if( ! font.create(point_size) )
         fatal("unable to create outline font");
       // ... OpenGL initialization commands...
       glColor3f(1,1,1);
       font.print( x, y, "hello outlined world" );

To create an plain font (plain polygonized font):


       FTFace face;
       if( ! face.open("arial.ttf") )
         fatal("unable to open ttf file");
       GLTTFont font(&face);
       int point_size= 20;
       if( ! font.create(point_size) )
         fatal("unable to create outline font");
       // ... OpenGL initialization commands...
       glColor3f(1,1,1);
       font.print( x, y, "hello plain world" );

How It Works
Read the FreeType documentation files for more information about the vocabulary used. (as glyph, contours, etc.)

gltt is written in C++.

The FT classes don't depend on OpenGL but simply on FreeType. The GLTT classes do depend on OpenGL.

The GLTTBitmapFont, GLTTOutlineFont and GLTTFont classes act as font servers: they internally render only requested glyphs and cache them. BTW, the requested glyphs are put into a GL display list by GLTTOutlineFont and GLTTFont classes.

You have access to the outline contour vectorization, as well as its tesselation. You have access to the trangles set generated by the glyph tesselation. (see the source code and the demo)

No extrusion ability is provided since this feature could be restrictive: it is not the goal of this library. The author lets the user have imagination for nice extrusions!