TTFont Class Reference

#include <TTFont.h>

Inheritance diagram for TTFont:

Pentagram::Font List of all members.

Public Member Functions

 TTFont (TTF_Font *font, uint32 rgb, int bordersize, bool antiAliased, bool SJIS)
virtual ~TTFont ()
virtual int getHeight ()
virtual int getBaseline ()
virtual int getBaselineSkip ()
bool isAntialiased ()
virtual void getStringSize (const std::string &text, int &width, int &height)
virtual void getTextSize (const std::string &text, int &resultwidth, int &resultheight, unsigned int &remaining, int width=0, int height=0, TextAlign align=TEXT_LEFT, bool u8specials=false)
virtual RenderedTextrenderText (const std::string &text, unsigned int &remaining, int width=0, int height=0, TextAlign align=TEXT_LEFT, bool u8specials=false, std::string::size_type cursor=std::string::npos)
 ENABLE_RUNTIME_CLASSTYPE ()

Protected Attributes

TTF_Fontttf_font
uint32 rgb
int bordersize
bool antiAliased
bool SJIS
uint16 bullet

Detailed Description

Definition at line 27 of file TTFont.h.


Constructor & Destructor Documentation

TTFont::TTFont ( TTF_Font font,
uint32  rgb,
int  bordersize,
bool  antiAliased,
bool  SJIS 
)

Definition at line 42 of file TTFont.cpp.

References bordersize, bullet, bullets, and rgb.

TTFont::~TTFont (  )  [virtual]

Definition at line 68 of file TTFont.cpp.


Member Function Documentation

TTFont::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Pentagram::Font.

int TTFont::getBaseline (  )  [virtual]

get the baseline of the font (relative from the top)

Implements Pentagram::Font.

Definition at line 78 of file TTFont.cpp.

References ttf_font.

Referenced by TTFRenderedText::draw(), and TTFRenderedText::drawBlended().

int TTFont::getBaselineSkip (  )  [virtual]

get the baselineskip of the font (distance between two baselines)

Implements Pentagram::Font.

Definition at line 83 of file TTFont.cpp.

References ttf_font.

int TTFont::getHeight (  )  [virtual]

get the height of the font

Implements Pentagram::Font.

Definition at line 73 of file TTFont.cpp.

References bordersize, and ttf_font.

void TTFont::getStringSize ( const std::string &  text,
int &  width,
int &  height 
) [virtual]

get the dimensions of a string (not containing any newlines)

Parameters:
text The string
width Returns the width
height Returns the height

Implements Pentagram::Font.

Definition at line 111 of file TTFont.cpp.

References bordersize, bullet, pout, SJIS, and ttf_font.

void TTFont::getTextSize ( const std::string &  text,
int &  resultwidth,
int &  resultheight,
unsigned int &  remaining,
int  width = 0,
int  height = 0,
TextAlign  align = TEXT_LEFT,
bool  u8specials = false 
) [virtual]

Definition at line 134 of file TTFont.cpp.

References SJIS.

bool TTFont::isAntialiased (  )  [inline]

Definition at line 38 of file TTFont.h.

Referenced by TTFRenderedText::draw(), and TTFRenderedText::drawBlended().

RenderedText * TTFont::renderText ( const std::string &  text,
unsigned int &  remaining,
int  width = 0,
int  height = 0,
TextAlign  align = TEXT_LEFT,
bool  u8specials = false,
std::string::size_type  cursor = std::string::npos 
) [virtual]

Definition at line 152 of file TTFont.cpp.

References antiAliased, bordersize, Texture::buffer, bullet, Texture::height, if(), pal, pout, rgb, SJIS, ttf_font, Texture::width, x, and y.


Member Data Documentation

bool TTFont::antiAliased [protected]

Definition at line 62 of file TTFont.h.

Referenced by renderText().

int TTFont::bordersize [protected]

Definition at line 61 of file TTFont.h.

Referenced by getHeight(), getStringSize(), renderText(), and TTFont().

uint16 TTFont::bullet [protected]

Definition at line 65 of file TTFont.h.

Referenced by getStringSize(), renderText(), and TTFont().

uint32 TTFont::rgb [protected]

Definition at line 60 of file TTFont.h.

Referenced by renderText(), and TTFont().

bool TTFont::SJIS [protected]

Definition at line 63 of file TTFont.h.

Referenced by getStringSize(), getTextSize(), and renderText().

TTF_Font* TTFont::ttf_font [protected]

Definition at line 59 of file TTFont.h.

Referenced by getBaseline(), getBaselineSkip(), getHeight(), getStringSize(), and renderText().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:30:04 2007 for pentagram by  doxygen 1.4.7