MAUI::Font Class Reference

#include <MAUI/Font.h>

List of all members.


Detailed Description

This class represents and embodies bitmap fonts used by MAUI applications.


Public Member Functions

 Font (MAHandle font)
 ~Font ()
void setResource (MAHandle font)
MAHandle getHandle () const
const char * getName () const
void setLineSpacing (int size=0)
int getLineSpacing () const
MAExtent getStringDimensions (const char *str, int length=-1) const
MAExtent getBoundedStringDimensions (const char *str, const Rect &bound, int length=-1) const
int getLineBreak (int line, const char *str, const Rect &bound) const
int calculateLine (int index, const char *str, const Rect &bound) const
Rect calculateRectOfIndex (int index, const char *str, const Rect &bound) const
void drawString (const char *str, int x, int y)
void drawBoundedString (const char *str, int x, int y, const Rect &bound)
const CharsetgetCharset () const

Protected Member Functions

void calcCharPos (char c, int *x, int *y)
void calcLineBreaks (const char *str, int x, int y, const Rect &bound) const

Protected Attributes

MAHandle fontImage
Charsetcharset
int mLineSpacing


Constructor & Destructor Documentation

MAUI::Font::Font MAHandle  font  ) 
 

Constructor, takes a handle to a binary resource with font data

MAUI::Font::~Font  ) 
 


Member Function Documentation

void MAUI::Font::setResource MAHandle  font  ) 
 

Sets the binary resource with font data to be used by this font

MAHandle MAUI::Font::getHandle  )  const
 

Returns a handle to the binary resource used by the font

const char* MAUI::Font::getName  )  const
 

Returns the plain-text name of the font

void MAUI::Font::setLineSpacing int  size = 0  ) 
 

Sets the number of pixels between each line of text. The default is 0.

int MAUI::Font::getLineSpacing  )  const
 

Returns the line spacing.

See also:
setLineSpacing()

MAExtent MAUI::Font::getStringDimensions const char *  str,
int  length = -1
const
 

Returns the width and height of str when rendered with this font

MAExtent MAUI::Font::getBoundedStringDimensions const char *  str,
const Rect bound,
int  length = -1
const
 

Returns the width and height of str when rendered with this font and bounded by the rectangle specified by bound.

int MAUI::Font::getLineBreak int  line,
const char *  str,
const Rect bound
const
 

Returns the index of the first character of str on the line given by "line", assuming that the string has been linebroken according to bounds.

int MAUI::Font::calculateLine int  index,
const char *  str,
const Rect bound
const
 

Returns the line on which the character at index in str would end up, if the string were linebroken according to bounds.

Rect MAUI::Font::calculateRectOfIndex int  index,
const char *  str,
const Rect bound
const
 

void MAUI::Font::drawString const char *  str,
int  x,
int  y
 

Renders str at x, y

void MAUI::Font::drawBoundedString const char *  str,
int  x,
int  y,
const Rect bound
 

Renders str, linebroken according to bounds, at x,y. Adds lineSpacing pixels of space between each line.

const Charset& MAUI::Font::getCharset  )  const
 

void MAUI::Font::calcCharPos char  c,
int *  x,
int *  y
[protected]
 

void MAUI::Font::calcLineBreaks const char *  str,
int  x,
int  y,
const Rect bound
const [protected]
 


Member Data Documentation

MAHandle MAUI::Font::fontImage [protected]
 

Charset* MAUI::Font::charset [protected]
 

int MAUI::Font::mLineSpacing [protected]
 


Generated on Sat Feb 13 00:15:39 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO