#include <SDLFont.h>
Inheritance diagram for GAG::SDLFont:
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 |