MMSFBFont Class Reference

Font rendering class. More...

#include <mmsfbfont.h>

List of all members.


Public Member Functions

 MMSFBFont (string filename, int w, int h)
virtual ~MMSFBFont ()
bool isInitialized ()
bool getStringWidth (string text, int len, int *width)
bool getHeight (int *height)
bool getAscender (int *ascender)
bool getDescender (int *descender)
bool getScaleCoeff (float *scale_coeff)
bool getGlyph (unsigned int character, MMSFBFont_Glyph *glyph)

Private Types

typedef std::map< std::string,
unsigned int > 
MMSFBFONT_MAP
 defines mapping between filename and font id

Private Member Functions

void lock ()
void unlock ()
void * loadFTGlyph (unsigned int character)
bool setupFTGlyph (unsigned int character, void *ftg, MMSFBFont_Glyph *glyph)

Private Attributes

bool initialized
 true if initialized
MMSMutex Lock
 to make it thread-safe
void * dfbfont
 pointer to the directfb font
void * ft_face
 pointer to the loaded freetype face
string filename
 font file
unsigned int font_id
 id of font
int ascender
 ascender
int descender
 descender
int height
 real height of one line
std::map< unsigned int,
MMSFBFont_Glyph
charmap
 maps a character id to a already loaded glyph (see glyphpool)

Static Private Attributes

static void * ft_library = NULL
 static pointer to the freetype library
static MMSFBFONT_MAP index
 static index
static unsigned int index_pos = 0
 static index position
static unsigned int numReferences = 0
 reference counter for final release of freetype library

Friends

class MMSFBSurface
class MMSFBBackEndInterface

Detailed Description

Font rendering class.

Author:
Jens Schneider

Definition at line 79 of file mmsfbfont.h.


Member Typedef Documentation

typedef std::map<std::string, unsigned int> MMSFBFont::MMSFBFONT_MAP [private]

defines mapping between filename and font id

Definition at line 102 of file mmsfbfont.h.


Constructor & Destructor Documentation

MMSFBFont::MMSFBFont ( string  filename,
int  w,
int  h 
)

Definition at line 54 of file mmsfbfont.cpp.

MMSFBFont::~MMSFBFont (  )  [virtual]

Definition at line 200 of file mmsfbfont.cpp.


Member Function Documentation

void MMSFBFont::lock (  )  [private]

Definition at line 263 of file mmsfbfont.cpp.

void MMSFBFont::unlock (  )  [private]

Definition at line 267 of file mmsfbfont.cpp.

void * MMSFBFont::loadFTGlyph ( unsigned int  character  )  [private]

Definition at line 319 of file mmsfbfont.cpp.

bool MMSFBFont::setupFTGlyph ( unsigned int  character,
void *  ftg,
MMSFBFont_Glyph glyph 
) [private]

Definition at line 397 of file mmsfbfont.cpp.

bool MMSFBFont::isInitialized (  ) 

Definition at line 259 of file mmsfbfont.cpp.

bool MMSFBFont::getStringWidth ( string  text,
int  len,
int *  width 
)

Definition at line 863 of file mmsfbfont.cpp.

bool MMSFBFont::getHeight ( int *  height  ) 

Definition at line 902 of file mmsfbfont.cpp.

bool MMSFBFont::getAscender ( int *  ascender  ) 

Definition at line 931 of file mmsfbfont.cpp.

bool MMSFBFont::getDescender ( int *  descender  ) 

Definition at line 955 of file mmsfbfont.cpp.

bool MMSFBFont::getScaleCoeff ( float *  scale_coeff  ) 

Definition at line 980 of file mmsfbfont.cpp.

bool MMSFBFont::getGlyph ( unsigned int  character,
MMSFBFont_Glyph glyph 
)

Definition at line 807 of file mmsfbfont.cpp.


Friends And Related Function Documentation

friend class MMSFBSurface [friend]

Definition at line 155 of file mmsfbfont.h.

friend class MMSFBBackEndInterface [friend]

Definition at line 156 of file mmsfbfont.h.


Member Data Documentation

bool MMSFBFont::initialized [private]

true if initialized

Definition at line 82 of file mmsfbfont.h.

to make it thread-safe

Definition at line 85 of file mmsfbfont.h.

void* MMSFBFont::dfbfont [private]

pointer to the directfb font

Definition at line 89 of file mmsfbfont.h.

void * MMSFBFont::ft_library = NULL [static, private]

static pointer to the freetype library

Definition at line 93 of file mmsfbfont.h.

void* MMSFBFont::ft_face [private]

pointer to the loaded freetype face

Definition at line 96 of file mmsfbfont.h.

string MMSFBFont::filename [private]

font file

Definition at line 99 of file mmsfbfont.h.

static index

Definition at line 105 of file mmsfbfont.h.

unsigned int MMSFBFont::index_pos = 0 [static, private]

static index position

Definition at line 108 of file mmsfbfont.h.

unsigned int MMSFBFont::font_id [private]

id of font

Definition at line 111 of file mmsfbfont.h.

int MMSFBFont::ascender [private]

ascender

Definition at line 119 of file mmsfbfont.h.

int MMSFBFont::descender [private]

descender

Definition at line 122 of file mmsfbfont.h.

int MMSFBFont::height [private]

real height of one line

Definition at line 125 of file mmsfbfont.h.

std::map<unsigned int, MMSFBFont_Glyph> MMSFBFont::charmap [private]

maps a character id to a already loaded glyph (see glyphpool)

Definition at line 128 of file mmsfbfont.h.

unsigned int MMSFBFont::numReferences = 0 [static, private]

reference counter for final release of freetype library

Definition at line 131 of file mmsfbfont.h.


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