FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
FIFE::FontBase Class Referenceabstract

#include <fontbase.h>

Inheritance diagram for FIFE::FontBase:
Inheritance graph
Collaboration diagram for FIFE::FontBase:
Collaboration graph

Public Member Functions

void setRowSpacing (int32_t spacing)
 
int32_t getRowSpacing () const
 
void setGlyphSpacing (int32_t spacing)
 
int32_t getGlyphSpacing () const
 
void setAntiAlias (bool antiAlias)
 
bool isAntiAlias ()
 
ImagegetAsImage (const std::string &text)
 
ImagegetAsImageMultiline (const std::string &text)
 
SDL_Color getColor () const
 
- Public Member Functions inherited from FIFE::IFont
virtual void setColor (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
 
virtual int32_t getWidth (const std::string &text) const =0
 
virtual int32_t getHeight () const =0
 

Detailed Description

Abstract Font Base Class Uses a pool for rendered strings.

See Also
TextRenderPool

Definition at line 48 of file fontbase.h.

Member Function Documentation

Image * FIFE::FontBase::getAsImage ( const std::string &  text)
virtual

Gets given text as Image The rsulting image is pooled, so it's not that time critical

Implements FIFE::IFont.

Definition at line 112 of file fontbase.cpp.

References FIFE::TextRenderPool::addRenderedText(), and FIFE::TextRenderPool::getRenderedText().

Image * FIFE::FontBase::getAsImageMultiline ( const std::string &  text)
virtual

Gets given text as Image. Text is splitted on multiple lines based "\n" marks The rsulting image is pooled, so it's not that time critical

Implements FIFE::IFont.

Definition at line 122 of file fontbase.cpp.

References FIFE::TextRenderPool::addRenderedText(), FIFE::IFont::getHeight(), FIFE::TextRenderPool::getRenderedText(), and getRowSpacing().

SDL_Color FIFE::FontBase::getColor ( ) const
virtual

Get the color the text was rendered in

Implements FIFE::IFont.

Definition at line 80 of file fontbase.cpp.

Referenced by FIFE::TextRenderPool::addRenderedText(), and FIFE::TextRenderPool::getRenderedText().

Here is the caller graph for this function:

int32_t FIFE::FontBase::getGlyphSpacing ( ) const
virtual

Gets the spacing between letters in pixels.

Returns
the spacing.

Implements FIFE::IFont.

Definition at line 68 of file fontbase.cpp.

Referenced by FIFE::TextRenderPool::addRenderedText(), FIFE::TextRenderPool::getRenderedText(), and FIFE::ImageFontBase::getWidth().

Here is the caller graph for this function:

int32_t FIFE::FontBase::getRowSpacing ( ) const
virtual

Gets the spacing between rows in pixels.

Returns
the spacing.

Implements FIFE::IFont.

Definition at line 60 of file fontbase.cpp.

Referenced by FIFE::TextRenderPool::addRenderedText(), getAsImageMultiline(), FIFE::TrueTypeFont::getHeight(), and FIFE::TextRenderPool::getRenderedText().

Here is the caller graph for this function:

bool FIFE::FontBase::isAntiAlias ( )
virtual

Checks if anti aliasing is used.

Returns
true if anti aliasing is used.

Implements FIFE::IFont.

Definition at line 76 of file fontbase.cpp.

Referenced by FIFE::TextRenderPool::addRenderedText(), and FIFE::TextRenderPool::getRenderedText().

Here is the caller graph for this function:

void FIFE::FontBase::setAntiAlias ( bool  antiAlias)
virtual

Sets the use of anti aliasing..

Parameters
antaAliastrue for use of antia aliasing.

Implements FIFE::IFont.

Definition at line 72 of file fontbase.cpp.

void FIFE::FontBase::setGlyphSpacing ( int32_t  spacing)
virtual

Sets the spacing between letters in pixels. Default is 0 pixels. The spacing can be negative.

Parameters
spacingthe spacing in pixels.

Implements FIFE::IFont.

Definition at line 64 of file fontbase.cpp.

void FIFE::FontBase::setRowSpacing ( int32_t  spacing)
virtual

Sets the spacing between rows in pixels. Default is 0 pixels. The spacing can be negative.

Parameters
spacingthe spacing in pixels.

Implements FIFE::IFont.

Definition at line 56 of file fontbase.cpp.


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