Main Page | Alphabetical List | Class List | File List | Class Members

CFont Class Reference

Use this class to load a font and print some text on screen. More...

List of all members.

Public Member Functions

 CFont (const char *, bool alpha=true)
 Creates a font from an image file.

void printString (double x, double y, double t, const char *s)
 Prints the string s at (x,y) with size t.

void printStringN (double x, double y, double t, const char *s, int n)
 Prints N first characters of string s at (x,y) with size t.

void printStringNeed (double t, const char *s, double *w, double *h)
 Retrieve the width and height needed by printString to print string s with size t.


Detailed Description

Use this class to load a font and print some text on screen.

Fonts are images with all characters on a line. There must be at least on pixel of pure black between two characters.
 
The character set is
!"#$&'()*+,-./0123456789:;<=>?[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
 
Note that a default font is provided in libtexture/font/default.tga (this font as a low resolution to have a small memory cost)


Constructor & Destructor Documentation

CFont::CFont const char *  ,
bool  alpha = true
 

Creates a font from an image file.

If alpha is true the black background is replaced by transparancy.


Member Function Documentation

void CFont::printString double  x,
double  y,
double  t,
const char *  s
 

Prints the string s at (x,y) with size t.

Note that the text is printed in a plane but that nothing prevents using an appropriate modelview to draw it in 3d.


The documentation for this class was generated from the following file:
Generated on Tue Sep 21 17:28:12 2004 for libTexture by doxygen 1.3.5