Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GAG::SDLFont Class Reference
[Libgag graphic library]

#include <SDLFont.h>

Inheritance diagram for GAG::SDLFont:

GAG::Font List of all members.

Detailed Description

TrueType font using SDL.


Public Member Functions

virtual ~SDLFont ()
 Destructor, release TrueType font.
bool load (const char *filename, unsigned size)
 Load filename TrueType font at size.
int getStringWidth (const char *string) const
 Return the width of string using this font.
int getStringHeight (const char *string) const
 Return the height of string using this font.
bool printable (char c) const
 Return true if c is a printable character.
virtual void setColor (Uint8 r, Uint8 g, Uint8 b, Uint8 a=DrawableSurface::ALPHA_OPAQUE)
 Set the font color, clear the color stack.
virtual void pushColor (Uint8 r, Uint8 g, Uint8 b, Uint8 a=DrawableSurface::ALPHA_OPAQUE)
 Push the font color on the color stack and set it.
virtual void popColor (void)
 Remove the last element of the color stack.
virtual void getColor (Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) const
 Return the actual font color.
virtual void setStyle (unsigned style)
 Set the font style, clear the style stack.
virtual void pushStyle (unsigned style)
 Push the font style on the style stack and set it.
virtual void popStyle (void)
 Remove the last element of the style stack.
virtual unsigned getStyle (void) const
 Return the actual font style.

Protected Member Functions

void drawString (SDL_Surface *Surface, int x, int y, int w, const char *text, SDL_Rect *clip=NULL) const
 Draw text on Surface at (x,y) up to width w take accompt of clipping clip.

Protected Attributes

TTF_Font * font
 TrueType font pointer.
std::stack< unsigned > styleStack
 stack of styles
std::stack< SDL_Color > colorStack
 stack of colors

Private Member Functions

 SDLFont ()
 Private constructor.

Friends

class SDLGraphicContext
class SDLDrawableSurface


The documentation for this class was generated from the following files:
Generated on Mon Oct 24 17:38:26 2005 for Teem by  doxygen 1.4.2