WoopsiGfx 1.4
Nintendo DS 2D Graphics Library
Public Member Functions
WoopsiGfx::FontBase Class Reference

#include <libwoopsigfx/include/fontbase.h>

Inheritance diagram for WoopsiGfx::FontBase:
WoopsiGfx::PackedFontBase WoopsiGfx::PackedFont1 WoopsiGfx::PackedFont16

List of all members.

Public Member Functions

virtual ~FontBase ()
virtual const bool isCharBlank (const u32 letter) const =0
virtual s16 drawChar (MutableBitmapBase *bitmap, u32 letter, u16 colour, s16 x, s16 y, u16 clipX1, u16 clipY1, u16 clipX2, u16 clipY2)=0
virtual s16 drawBaselineChar (MutableBitmapBase *bitmap, u32 letter, u16 colour, s16 x, s16 y, u16 clipX1, u16 clipY1, u16 clipX2, u16 clipY2)=0
virtual u16 getStringWidth (const WoopsiString &text) const =0
virtual u16 getStringWidth (const WoopsiString &text, s32 startIndex, s32 length) const =0
virtual u8 getCharWidth (u32 letter) const =0
virtual u8 getCharHeight (u32 letter) const =0
virtual s8 getCharTop (u32 letter) const =0
virtual const u8 getHeight () const =0

Detailed Description

Abstract class defining the basic properties of a font and providing some of the essential functionality. Should be used as a base class for all fonts.


Constructor & Destructor Documentation

virtual WoopsiGfx::FontBase::~FontBase ( ) [inline, virtual]

Destructor.


Member Function Documentation

virtual s16 WoopsiGfx::FontBase::drawBaselineChar ( MutableBitmapBase bitmap,
u32  letter,
u16  colour,
s16  x,
s16  y,
u16  clipX1,
u16  clipY1,
u16  clipX2,
u16  clipY2 
) [pure virtual]

Draw an individual character of the font to the specified bitmap on a baseline.

Parameters:
bitmapThe bitmap to draw to.
letterThe character to output.
colourThe colour to draw with.
xThe x co-ordinate of the pen.
yThe y co-ordinate of the pen.
clipX1The left edge of the clipping rectangle.
clipY1The top edge of the clipping rectangle.
clipX2The right edge of the clipping rectangle.
clipY2The bottom edge of the clipping rectangle.
Returns:
The x co-ordinate for the next character to be drawn.

Implemented in WoopsiGfx::PackedFontBase.

virtual s16 WoopsiGfx::FontBase::drawChar ( MutableBitmapBase bitmap,
u32  letter,
u16  colour,
s16  x,
s16  y,
u16  clipX1,
u16  clipY1,
u16  clipX2,
u16  clipY2 
) [pure virtual]

Draw an individual character of the font to the specified bitmap.

Parameters:
bitmapThe bitmap to draw to.
letterThe character to output.
colourThe colour to draw with.
xThe x co-ordinate of the text.
yThe y co-ordinate of the text.
clipX1The left edge of the clipping rectangle.
clipY1The top edge of the clipping rectangle.
clipX2The right edge of the clipping rectangle.
clipY2The bottom edge of the clipping rectangle.
Returns:
The x co-ordinate for the next character to be drawn.

Implemented in WoopsiGfx::PackedFontBase.

virtual u8 WoopsiGfx::FontBase::getCharHeight ( u32  letter) const [pure virtual]

Get the height of an individual character.

Parameters:
letterThe letter to get the height of.
Returns:
The height of the character in pixels.

Implemented in WoopsiGfx::PackedFontBase.

virtual s8 WoopsiGfx::FontBase::getCharTop ( u32  letter) const [pure virtual]

Get the algebric distance from baseline to top of an individual character.

Parameters:
letterThe character to get the "top" of.
Returns:
The top of the character in pixels.

Implemented in WoopsiGfx::PackedFontBase.

virtual u8 WoopsiGfx::FontBase::getCharWidth ( u32  letter) const [pure virtual]

Get the width of an individual character.

Parameters:
letterThe character to get the width of.
Returns:
The width of the character in pixels.

Implemented in WoopsiGfx::PackedFontBase.

virtual const u8 WoopsiGfx::FontBase::getHeight ( ) const [pure virtual]

Gets the height of the font.

Returns:
The height of the font.

Implemented in WoopsiGfx::PackedFontBase.

virtual u16 WoopsiGfx::FontBase::getStringWidth ( const WoopsiString text) const [pure virtual]

Get the width of a string in pixels when drawn with this font.

Parameters:
textThe string to check.
Returns:
The width of the string in pixels.

Implemented in WoopsiGfx::PackedFontBase.

virtual u16 WoopsiGfx::FontBase::getStringWidth ( const WoopsiString text,
s32  startIndex,
s32  length 
) const [pure virtual]

Get the width of a portion of a string in pixels when drawn with this font.

Parameters:
textThe string to check.
startIndexThe start point of the substring within the string.
lengthThe length of the substring in chars.
Returns:
The width of the substring in pixels.

Implemented in WoopsiGfx::PackedFontBase.

virtual const bool WoopsiGfx::FontBase::isCharBlank ( const u32  letter) const [pure virtual]

Checks if supplied character is blank in the current font.

Parameters:
letterThe character to check.
Returns:
True if the glyph contains any pixels to be drawn. False if the glyph is blank.

Implemented in WoopsiGfx::PackedFontBase.


The documentation for this class was generated from the following file: