Cafu Engine
cf::TrueTypeFontT Class Reference

A class for rendering fonts that have been created with the Cafu MakeFont tool. More...

#include "FontTT.hpp"

Classes

class  FontInfoT
 
struct  GlyphInfoT
 

Public Member Functions

 TrueTypeFontT (const std::string &FontName_)
 The constructor. More...
 
 ~TrueTypeFontT ()
 The destructor. More...
 
const std::string & GetName () const
 Returns the name of this font. More...
 
float GetWidth (const std::string &Text, float Scale) const
 Returns the width of string Text at scale Scale in pixels. More...
 
float GetAscender (float Scale) const
 Returns how far the highest glyph of this font extends above the baseline ("____") at scale Scale in pixels. More...
 
float GetLineSpacing (float Scale) const
 Returns the default line-spacing of this font at scale Scale in pixels. More...
 
void Print (float PosX, float PosY, float Scale, unsigned long Color, const char *PrintString,...) const
 Prints PrintString at (PosX, PosY) in color Color. More...
 

Detailed Description

A class for rendering fonts that have been created with the Cafu MakeFont tool.

Constructor & Destructor Documentation

TrueTypeFontT::TrueTypeFontT ( const std::string &  FontName_)

The constructor.

Exceptions
TextParserT::ParseErrorTif one of the related cfont files could not be successfully opened and parsed.
TrueTypeFontT::~TrueTypeFontT ( )

The destructor.

Member Function Documentation

float TrueTypeFontT::GetAscender ( float  Scale) const

Returns how far the highest glyph of this font extends above the baseline ("____") at scale Scale in pixels.

float TrueTypeFontT::GetLineSpacing ( float  Scale) const

Returns the default line-spacing of this font at scale Scale in pixels.

const std::string& cf::TrueTypeFontT::GetName ( ) const
inline

Returns the name of this font.

float TrueTypeFontT::GetWidth ( const std::string &  Text,
float  Scale 
) const

Returns the width of string Text at scale Scale in pixels.

Useful e.g. for aligning a string to the center or the right of a window. This method does not take newline characters ('
') into account, the caller should pass pre-parsed strings instead!

void TrueTypeFontT::Print ( float  PosX,
float  PosY,
float  Scale,
unsigned long  Color,
const char *  PrintString,
  ... 
) const

Prints PrintString at (PosX, PosY) in color Color.

Note that this method does not setup any of the MatSys's model, view or projection matrices: it's up to the caller to do that!


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