#include <ShapeFont.h>
Inheritance diagram for ShapeFont:
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 RenderedText * | 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) |
ENABLE_RUNTIME_CLASSTYPE () | |
Private Attributes | |
int | height |
int | baseline |
int | vlead |
int | hlead |
Definition at line 25 of file ShapeFont.h.
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.
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)
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] |
void ShapeFont::setHLead | ( | int | hl | ) | [inline] |
void ShapeFont::setVLead | ( | int | vl | ) | [inline] |
int ShapeFont::baseline [private] |
int ShapeFont::height [private] |
int ShapeFont::hlead [private] |
Definition at line 30 of file ShapeFont.h.
Referenced by getHlead(), getStringSize(), and setHLead().
int ShapeFont::vlead [private] |