The Game Engine  1
Font Class Reference

Font for rendering text. More...

#include <Font.h>

+ Collaboration diagram for Font:

Public Member Functions

 Font (int s=24)
 Create the font with size s. More...
 
 Font (FontType t, int s=24)
 Create the font with size s and type t. More...
 
 ~Font ()
 
void setSize (int s)
 

Public Attributes

TTF_Font * font
 The font itself. More...
 
FontType type
 Type for the font en, jp, jpw/ruby. More...
 
string fontFile
 Filename of the font. More...
 
int size
 Font size. More...
 
int count
 The count of Texts using this font. More...
 

Protected Member Functions

bool tryLoadFont ()
 Attempts to load a font of the given name from the system. More...
 

Detailed Description

Font for rendering text.

This class is tasked with the following:

  • Holding and loading a font

Definition at line 17 of file Font.h.

Constructor & Destructor Documentation

Font::Font ( int  s = 24)

Create the font with size s.

Parameters
sFont size

Definition at line 14 of file Font.cpp.

+ Here is the call graph for this function:

Font::Font ( FontType  t,
int  s = 24 
)

Create the font with size s and type t.

Parameters
sFont size
tType of font

Definition at line 10 of file Font.cpp.

+ Here is the call graph for this function:

Font::~Font ( )

Definition at line 18 of file Font.cpp.

+ Here is the call graph for this function:

Member Function Documentation

void Font::setSize ( int  s)

Definition at line 23 of file Font.cpp.

bool Font::tryLoadFont ( )
protected

Attempts to load a font of the given name from the system.

Returns
Whether or not the font was found successfully

Definition at line 30 of file Font.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

int Font::count

The count of Texts using this font.

Definition at line 34 of file Font.h.

TTF_Font* Font::font

The font itself.

Definition at line 22 of file Font.h.

string Font::fontFile

Filename of the font.

Definition at line 28 of file Font.h.

int Font::size

Font size.

Definition at line 31 of file Font.h.

FontType Font::type

Type for the font en, jp, jpw/ruby.

Definition at line 25 of file Font.h.


The documentation for this class was generated from the following files: