ShapeFont Class Reference

#include <ShapeFont.h>

Inheritance diagram for ShapeFont:

Pentagram::Font Shape List of all members.

Public Member Functions

 ShapeFont (const uint8 *data, uint32 size, const ConvertShapeFormat *format, const uint16 flexId, const uint32 shapenum)
virtual ~ShapeFont ()
virtual int getHeight ()
virtual int getBaseline ()
virtual int getBaselineSkip ()
int getWidth (char c)
int getVlead () const
int getHlead () const
void setVLead (int vl)
void setHLead (int hl)
virtual void getStringSize (const std::string &text, int &width, int &height)
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 ()

Private Attributes

int height
int baseline
int vlead
int hlead

Detailed Description

Definition at line 25 of file ShapeFont.h.


Constructor & Destructor Documentation

ShapeFont::ShapeFont ( const uint8 data,
uint32  size,
const ConvertShapeFormat format,
const uint16  flexId,
const uint32  shapenum 
)

Definition at line 28 of file ShapeFont.cpp.

ShapeFont::~ShapeFont (  )  [virtual]

Definition at line 37 of file ShapeFont.cpp.


Member Function Documentation

ShapeFont::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from Pentagram::Font.

int ShapeFont::getBaseline (  )  [virtual]

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

Implements Pentagram::Font.

Definition at line 63 of file ShapeFont.cpp.

References baseline, Shape::frameCount(), Shape::getFrame(), and ShapeFrame::yoff.

Referenced by ShapeRenderedText::draw(), JPRenderedText::draw(), and JPFont::getBaseline().

int ShapeFont::getBaselineSkip (  )  [virtual]

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

Implements Pentagram::Font.

Definition at line 78 of file ShapeFont.cpp.

References getHeight(), and getVlead().

Referenced by JPFont::getBaselineSkip().

int ShapeFont::getHeight (  )  [virtual]

get the height of the font

Implements Pentagram::Font.

Definition at line 48 of file ShapeFont.cpp.

References Shape::frameCount(), Shape::getFrame(), ShapeFrame::height, and height.

Referenced by getBaselineSkip(), JPFont::getHeight(), and getStringSize().

int ShapeFont::getHlead (  )  const [inline]

Definition at line 43 of file ShapeFont.h.

References hlead.

Referenced by ShapeRenderedText::draw(), JPRenderedText::draw(), ShapeRenderedText::drawBlended(), JPRenderedText::drawBlended(), and JPFont::getStringSize().

void ShapeFont::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 83 of file ShapeFont.cpp.

References getHeight(), getWidth(), and hlead.

int ShapeFont::getVlead (  )  const [inline]

Definition at line 42 of file ShapeFont.h.

References vlead.

Referenced by getBaselineSkip(), renderText(), and JPFont::renderText().

int ShapeFont::getWidth ( char  c  ) 

Definition at line 43 of file ShapeFont.cpp.

References Shape::getFrame(), and ShapeFrame::width.

Referenced by ShapeRenderedText::draw(), ShapeRenderedText::drawBlended(), and getStringSize().

RenderedText * ShapeFont::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 98 of file ShapeFont.cpp.

References getVlead().

void ShapeFont::setHLead ( int  hl  )  [inline]

Definition at line 46 of file ShapeFont.h.

References hlead.

void ShapeFont::setVLead ( int  vl  )  [inline]

Definition at line 45 of file ShapeFont.h.

References vlead.


Member Data Documentation

int ShapeFont::baseline [private]

Definition at line 28 of file ShapeFont.h.

Referenced by getBaseline().

int ShapeFont::height [private]

Definition at line 27 of file ShapeFont.h.

Referenced by getHeight().

int ShapeFont::hlead [private]

Definition at line 30 of file ShapeFont.h.

Referenced by getHlead(), getStringSize(), and setHLead().

int ShapeFont::vlead [private]

Definition at line 29 of file ShapeFont.h.

Referenced by getVlead(), and setVLead().


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