#include <ZE_ZFont.h>
Inherits ZE::ZObject.
Public Methods | |
ZFont () | |
Default Constructor. | |
ZFont (string filename, int size) | |
Constructor that opens a font with a certain size. | |
~ZFont () | |
Destructor, frees memory. | |
void | Open (string filename, int size) |
Opens a font with a certain size. | |
void | Release () |
Release font. | |
void | DrawText (string text, ZImage &image) const |
Draws a string in a color to a ZImage. | |
void | DrawShadedText (string text, ZImage &image) const |
Draws a string with a colored background to a ZImage. | |
void | SetColor (Uint8 r, Uint8 g, Uint8 b) |
Set Text rColor. | |
void | SetBGColor (Uint8 r, Uint8 g, Uint8 b) |
Set Background rColor. | |
void | SetStyle (bool bold, bool italic, bool underline) |
Set display format. | |
void | Resize (int size) |
Resize Font. | |
bool | IsLoaded () const |
Check if file is loaded. | |
bool | IsBold () const |
Get Bold Setting. | |
bool | IsItalic () const |
Get Italic Setting. | |
bool | IsUnderlined () const |
Get Underlined Setting. | |
int | Height () const |
Get Height of Font. | |
int | LineSkip () const |
Get Line Skip for Font. | |
int | StringWidth (string text) const |
Get String Width. | |
int | StringHeight (string text) const |
Get String Height. | |
Protected Attributes | |
TTF_Font * | rFont |
Pointer to font data. | |
string | rFilename |
Filename, for resizing. | |
SDL_Color | rColor |
SDL_Color for current text color. | |
SDL_Color | rBGColor |
SDL_Color for background color to be used in shaded draws. |
|
Default Constructor, does nothing. |
|
Constructor simply calls ZFont::Open() with same parameters.
|
|
Destructor calls ZFont::Release(). |
|
Opens a font given a filename and a point size.
|
|
Release memory held by font. |
|
Draw to a surface in specified color and associate that surface with a ZImage.
|
|
Draw to a surface a string with a background of rBGColor and lettering in the normal color and associate that surface with a ZImage.
|
|
Set rColor of Text Output.
|
|
Set rColor of Background for Shaded Draw.
|
|
Set display format (bold, italic, underline).
|
|
Release and Reopen font in new size.
|
|
Check if file is loaded and pointer to data is non-NULL.
|
|
Check if font output is currently bold.
|
|
Check if font output is currently italic.
|
|
Check if font output is currently underline.
|
|
Check font height as reported by SDL_ttf.
|
|
Check font line skip as reported by SDL_ttf.
|
|
Get Width of String in Current Font in Pixels.
|
|
Get Height of String in Current Font in Pixels.
|