Torque2D Reference
Loading...
Searching...
No Matches
BitmapFont Class Reference

#include <BitmapFont.h>

Public Member Functions

 BitmapFont ()
void clear ()
bool parseFont (Stream &io_rStream)
TextureHandle LoadTexture (StringTableEntry fileName)
const BitmapFontCharactergetCharacter (const U16 charID)
U32 getCharacterCount (void) const
const F32 getSizeRatio (const F32 size)
const S16 getKerning (U16 first, U16 second)

Public Attributes

U16 mLineHeight
U16 mBaseline
U16 mSize
std::vector< StringTableEntry > mPageName
std::vector< TextureHandlemTexture

Constructor & Destructor Documentation

◆ BitmapFont()

BitmapFont ( )

Member Function Documentation

◆ clear()

void clear ( )

Forget everything read from a .fnt file.

parseFont ADDS to what is already here – it has no clear of its own, and mChar and mKerning are maps, so parsing a second font over a first leaves the union of the two and a glyph count that only ever grows. Anything that re-reads a font has to come through here first.

◆ getCharacter()

const BitmapFontCharacter & getCharacter ( const U16 charID)
inline

◆ getCharacterCount()

U32 getCharacterCount ( void ) const
inline

How many glyphs the font actually holds.

Const where getCharacter above cannot be: mChar[charID] on a std::map inserts a default-constructed character for a glyph the font does not have, and size() does not.

◆ getKerning()

const S16 getKerning ( U16 first,
U16 second )
inline

◆ getSizeRatio()

const F32 getSizeRatio ( const F32 size)
inline

◆ LoadTexture()

TextureHandle LoadTexture ( StringTableEntry fileName)

◆ parseFont()

bool parseFont ( Stream & io_rStream)

Member Data Documentation

◆ mBaseline

U16 mBaseline

◆ mLineHeight

U16 mLineHeight

◆ mPageName

std::vector<StringTableEntry> mPageName

◆ mSize

U16 mSize

◆ mTexture

std::vector<TextureHandle> mTexture

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