FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::GuiFont Class Reference

#include <gui_font.h>

+ Inheritance diagram for FIFE::GuiFont:
+ Collaboration diagram for FIFE::GuiFont:

Public Member Functions

 GuiFont (IFont *font)
 Constructor Takes the ownership of given font. More...
 
virtual ~GuiFont ()
 
int32_t getStringIndexAt (const std::string &text, int32_t x) const
 
void drawString (gcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y)
 
void drawMultiLineString (gcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y)
 
std::string splitTextToWidth (const std::string &text, int32_t render_width)
 
void setRowSpacing (int32_t spacing)
 Sets the spacing between rows in pixels. More...
 
int32_t getRowSpacing () const
 Gets the spacing between rows in pixels. More...
 
void setGlyphSpacing (int32_t spacing)
 Sets the spacing between letters in pixels. More...
 
int32_t getGlyphSpacing () const
 Gets the spacing between letters in pixels. More...
 
void setAntiAlias (bool antiAlias)
 Sets the use of anti aliasing. More...
 
bool isAntiAlias ()
 Checks if anti aliasing is used. More...
 
ImagegetAsImage (const std::string &text)
 Gets given text as Image The rsulting image is pooled, so it's not that time critical. More...
 
ImagegetAsImageMultiline (const std::string &text)
 Gets given text as Image. More...
 
void setColor (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
 Set the color the text should be rendered in. More...
 
SDL_Color getColor () const
 Get the color the text was rendered in. More...
 
int32_t getWidth (const std::string &text) const
 gets width of given text More...
 
int32_t getHeight () const
 gets height of this font More...
 
void invalidate ()
 
- Public Member Functions inherited from FIFE::IFont
virtual ~IFont ()
 

Private Attributes

IFontm_font
 

Detailed Description

Definition at line 39 of file gui_font.h.

Constructor & Destructor Documentation

FIFE::GuiFont::GuiFont ( IFont font)

Constructor Takes the ownership of given font.

Definition at line 38 of file gui_font.cpp.

FIFE::GuiFont::~GuiFont ( )
virtual

Definition at line 42 of file gui_font.cpp.

References m_font.

Member Function Documentation

void FIFE::GuiFont::drawMultiLineString ( gcn::Graphics *  graphics,
const std::string &  text,
int32_t  x,
int32_t  y 
)
void FIFE::GuiFont::drawString ( gcn::Graphics *  graphics,
const std::string &  text,
int32_t  x,
int32_t  y 
)
Image * FIFE::GuiFont::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 118 of file gui_font.cpp.

References FIFE::IFont::getAsImage(), and m_font.

Referenced by drawString().

+ Here is the caller graph for this function:

Image * FIFE::GuiFont::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 gui_font.cpp.

References FIFE::IFont::getAsImageMultiline(), and m_font.

Referenced by gcn::ClickLabel::adjustSize(), and drawMultiLineString().

+ Here is the caller graph for this function:

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

Get the color the text was rendered in.

Implements FIFE::IFont.

Definition at line 134 of file gui_font.cpp.

References FIFE::IFont::getColor(), and m_font.

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

Gets the spacing between letters in pixels.

Returns
the spacing.

Implements FIFE::IFont.

Definition at line 106 of file gui_font.cpp.

References FIFE::IFont::getGlyphSpacing(), and m_font.

int32_t FIFE::GuiFont::getHeight ( ) const
virtual

gets height of this font

Implements FIFE::IFont.

Definition at line 142 of file gui_font.cpp.

References FIFE::IFont::getHeight(), and m_font.

Referenced by drawString().

+ Here is the caller graph for this function:

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

Gets the spacing between rows in pixels.

Returns
the spacing.

Implements FIFE::IFont.

Definition at line 98 of file gui_font.cpp.

References FIFE::IFont::getRowSpacing(), and m_font.

Referenced by drawMultiLineString(), and drawString().

+ Here is the caller graph for this function:

int32_t FIFE::GuiFont::getStringIndexAt ( const std::string &  text,
int32_t  x 
) const
virtual

Implements FIFE::IFont.

Definition at line 46 of file gui_font.cpp.

References FIFE::IFont::getStringIndexAt(), and m_font.

int32_t FIFE::GuiFont::getWidth ( const std::string &  text) const
virtual

gets width of given text

Implements FIFE::IFont.

Definition at line 138 of file gui_font.cpp.

References FIFE::IFont::getWidth(), and m_font.

Referenced by drawString().

+ Here is the caller graph for this function:

void FIFE::GuiFont::invalidate ( )
virtual

Implements FIFE::IFont.

Definition at line 146 of file gui_font.cpp.

References FIFE::IFont::invalidate(), and m_font.

bool FIFE::GuiFont::isAntiAlias ( )
virtual

Checks if anti aliasing is used.

Returns
true if anti aliasing is used.

Implements FIFE::IFont.

Definition at line 114 of file gui_font.cpp.

References FIFE::IFont::isAntiAlias(), and m_font.

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

Sets the use of anti aliasing.

Parameters
antiAliastrue for use of anti aliasing.

Implements FIFE::IFont.

Definition at line 110 of file gui_font.cpp.

References m_font, and FIFE::IFont::setAntiAlias().

void FIFE::GuiFont::setColor ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
virtual

Set the color the text should be rendered in.

Implements FIFE::IFont.

Definition at line 130 of file gui_font.cpp.

References m_font, and FIFE::IFont::setColor().

Referenced by FIFE::Console::Console().

+ Here is the caller graph for this function:

void FIFE::GuiFont::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 102 of file gui_font.cpp.

References m_font, and FIFE::IFont::setGlyphSpacing().

void FIFE::GuiFont::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 94 of file gui_font.cpp.

References m_font, and FIFE::IFont::setRowSpacing().

std::string FIFE::GuiFont::splitTextToWidth ( const std::string &  text,
int32_t  render_width 
)
virtual

Implements FIFE::IFont.

Definition at line 126 of file gui_font.cpp.

References m_font, and FIFE::IFont::splitTextToWidth().

Referenced by gcn::ClickLabel::wrapText().

+ Here is the caller graph for this function:

Member Data Documentation


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