Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

SFontLoader Class Reference

#include <SFontLoader.h>

List of all members.

Public Types

enum  AlphaLoadingType { NONE, BLACK_MASK, GREY_COLOUR }

Public Member Functions

void loadFont (const string &name)
void setAlphaLoadingType (AlphaLoadingType type)
void setAlpha (unsigned char r, unsigned char g, unsigned char b)
void setSeperatorColour (unsigned char r, unsigned char g, unsigned char b)
void setFontDefinition (const string &definition)
unsigned char * getDataForCharacter (char character)
int getCharacterWidth (char character)
int getCharacterHeight ()
int getFontHeight ()
int getFontWidth ()


Detailed Description

A class for loading a SFont stored in a .ppm image.

Definition at line 13 of file SFontLoader.h.


Member Enumeration Documentation

enum SFontLoader::AlphaLoadingType
 

An enum defining the way to obtain alpha data from the ppm image

Enumeration values:
NONE  Don't fake an alpha channel.
BLACK_MASK  Every thing black is transparent (colour is actually definable).
GREY_COLOUR  Use the grey (r+g+b)/3 value as alpha 0 is 100% transparent.

Definition at line 17 of file SFontLoader.h.


Member Function Documentation

int SFontLoader::getCharacterHeight  )  [inline]
 

Returns the height of the font <=getFontHeight() (in pixels).

Definition at line 55 of file SFontLoader.h.

int SFontLoader::getCharacterWidth char  character  ) 
 

Returns the width of a specific character <=getFontWidth() (in pixels).

Definition at line 267 of file SFontLoader.cpp.

unsigned char * SFontLoader::getDataForCharacter char  character  ) 
 

Returns a pointer to a raw image of a character, the format is RBGA and the width and height can be found using getFontWidth() and getFontHeight().

Definition at line 262 of file SFontLoader.cpp.

int SFontLoader::getFontHeight  )  [inline]
 

Returns the height of a character data image (in pixels). Always = 2^n

Definition at line 57 of file SFontLoader.h.

int SFontLoader::getFontWidth  )  [inline]
 

Returns the width of a character data image (in pixels). Always = 2^m

Definition at line 59 of file SFontLoader.h.

void SFontLoader::loadFont const string &  name  ) 
 

Load a font .ppm file (may contain path).

Definition at line 35 of file SFontLoader.cpp.

void SFontLoader::setAlpha unsigned char  r,
unsigned char  g,
unsigned char  b
 

Sets the alpha colour to use with alphaType=BLACK_MASK, default 0,0,0.

void SFontLoader::setAlphaLoadingType AlphaLoadingType  type  )  [inline]
 

Sets the way to get the alpha channel when load is called, default is GREY_COLOUR.

Definition at line 34 of file SFontLoader.h.

void SFontLoader::setFontDefinition const string &  definition  )  [inline]
 

Sets the fontDefinition to use for the next loadFont

fontDefinition is a string containing the letters in the SFont.

Definition at line 44 of file SFontLoader.h.

void SFontLoader::setSeperatorColour unsigned char  r,
unsigned char  g,
unsigned char  b
 

Sets the colour used to separate characters in the SFont file, default 255,0,255.


The documentation for this class was generated from the following files:
Generated on Wed Sep 1 14:46:57 2004 by doxygen 1.3.7