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" ); |