Pentagram::Font Class Reference

#include <Font.h>

Inheritance diagram for Pentagram::Font:

JPFont ShapeFont TTFont List of all members.

Public Types

 TEXT_LEFT
 TEXT_CENTER
 TEXT_RIGHT
enum  TextAlign { TEXT_LEFT, TEXT_CENTER, TEXT_RIGHT }

Public Member Functions

 Font ()
virtual ~Font ()
 ENABLE_RUNTIME_CLASSTYPE ()
virtual int getHeight ()=0
virtual int getBaseline ()=0
virtual int getBaselineSkip ()=0
virtual void getStringSize (const std::string &text, int &width, int &height)=0
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)=0
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)
void setHighRes (bool hr)
bool isHighRes () const

Protected Attributes

bool highRes

Classes

struct  SJISTraits
struct  Traits

Detailed Description

Definition at line 37 of file Font.h.


Member Enumeration Documentation

enum Pentagram::Font::TextAlign

Enumerator:
TEXT_LEFT 
TEXT_CENTER 
TEXT_RIGHT 

Definition at line 45 of file Font.h.


Constructor & Destructor Documentation

Pentagram::Font::Font (  ) 

Pentagram::Font::~Font (  )  [virtual]

Definition at line 33 of file Font.cpp.


Member Function Documentation

Pentagram::Font::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented in JPFont, ShapeFont, and TTFont.

virtual int Pentagram::Font::getBaseline (  )  [pure virtual]

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

Implemented in JPFont, ShapeFont, and TTFont.

virtual int Pentagram::Font::getBaselineSkip (  )  [pure virtual]

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

Implemented in JPFont, ShapeFont, and TTFont.

virtual int Pentagram::Font::getHeight (  )  [pure virtual]

get the height of the font

Implemented in JPFont, ShapeFont, and TTFont.

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

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

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

Implemented in JPFont, ShapeFont, and TTFont.

void Pentagram::Font::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]

get the dimensions of a rendered string

Parameters:
text The text
resultwidth Returns the resulting width
resultheight Returns the resulting height
remaining Returns index of the first character not printed
width The width of the target rectangle, or 0 for unlimited
height The height of the target rectangle, or 0 for unlimited
u8specials If true, interpret the special characters U8 uses
align Alignment of the text (left, right, center)

Definition at line 38 of file Font.cpp.

bool Pentagram::Font::isHighRes (  )  const [inline]

Definition at line 99 of file Font.h.

References highRes.

virtual RenderedText* Pentagram::Font::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 
) [pure virtual]

render a string

Parameters:
text The text
remaining Returns index of the first character not printed
width The width of the target rectangle, or 0 for unlimited
height The height of the target rectangle, or 0 for unlimited
align Alignment of the text (left, right, center)
u8specials If true, interpret the special characters U8 uses
Returns:
the rendered text in a RenderedText object

Referenced by PaperdollGump::PaintStat(), SKFPlayer::run(), and CreditsGump::Run().

void Pentagram::Font::setHighRes ( bool  hr  )  [inline]

Definition at line 98 of file Font.h.

References highRes.


Member Data Documentation

bool Pentagram::Font::highRes [protected]

Definition at line 102 of file Font.h.

Referenced by isHighRes(), and setHighRes().


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