FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
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 (fcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y)
 
void drawMultiLineString (fcn::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 () const
 Checks if anti aliasing is used. More...
 
void setBoldStyle (bool style)
 Sets the use of bold style. More...
 
bool isBoldStyle () const
 Checks if bold style is used. More...
 
void setItalicStyle (bool style)
 Sets the use of italic style. More...
 
bool isItalicStyle () const
 Checks if italic style is used. More...
 
void setUnderlineStyle (bool style)
 Sets the use of underline style. More...
 
bool isUnderlineStyle () const
 Checks if underline style is used. More...
 
void setStrikethroughStyle (bool style)
 Sets the use of strikethrough style. More...
 
bool isStrikethroughStyle () const
 Checks if strikethrough style is used. More...
 
void setDynamicColoring (bool coloring)
 
bool isDynamicColoring () const
 
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 ( fcn::Graphics *  graphics,
const std::string &  text,
int32_t  x,
int32_t  y 
)
void FIFE::GuiFont::drawString ( fcn::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 174 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 178 of file gui_font.cpp.

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

Referenced by fcn::ClickLabel::adjustSize(), fcn::ClickLabel::draw(), 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 190 of file gui_font.cpp.

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

Referenced by drawMultiLineString(), and drawString().

+ Here is the caller graph for this function:

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

Gets the spacing between letters in pixels.

Returns
the spacing.

Implements FIFE::IFont.

Definition at line 122 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 198 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 114 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 194 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 202 of file gui_font.cpp.

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

bool FIFE::GuiFont::isAntiAlias ( ) const
virtual

Checks if anti aliasing is used.

Returns
true if anti aliasing is used.

Implements FIFE::IFont.

Definition at line 130 of file gui_font.cpp.

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

bool FIFE::GuiFont::isBoldStyle ( ) const
virtual

Checks if bold style is used.

Returns
true if bold style is used.

Implements FIFE::IFont.

Definition at line 138 of file gui_font.cpp.

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

bool FIFE::GuiFont::isDynamicColoring ( ) const
virtual

Implements FIFE::IFont.

Definition at line 170 of file gui_font.cpp.

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

Referenced by drawMultiLineString(), and drawString().

+ Here is the caller graph for this function:

bool FIFE::GuiFont::isItalicStyle ( ) const
virtual

Checks if italic style is used.

Returns
true if italic style is used.

Implements FIFE::IFont.

Definition at line 146 of file gui_font.cpp.

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

bool FIFE::GuiFont::isStrikethroughStyle ( ) const
virtual

Checks if strikethrough style is used.

Returns
true if strikethrough style is used.

Implements FIFE::IFont.

Definition at line 162 of file gui_font.cpp.

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

bool FIFE::GuiFont::isUnderlineStyle ( ) const
virtual

Checks if underline style is used.

Returns
true if underline style is used.

Implements FIFE::IFont.

Definition at line 154 of file gui_font.cpp.

References FIFE::IFont::isUnderlineStyle(), 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 126 of file gui_font.cpp.

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

void FIFE::GuiFont::setBoldStyle ( bool  style)
virtual

Sets the use of bold style.

Parameters
stlyeTrue for use of bold style.

Implements FIFE::IFont.

Definition at line 134 of file gui_font.cpp.

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

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 186 of file gui_font.cpp.

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

Referenced by FIFE::Console::Console(), drawMultiLineString(), and drawString().

+ Here is the caller graph for this function:

void FIFE::GuiFont::setDynamicColoring ( bool  coloring)
virtual

Implements FIFE::IFont.

Definition at line 166 of file gui_font.cpp.

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

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 118 of file gui_font.cpp.

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

void FIFE::GuiFont::setItalicStyle ( bool  style)
virtual

Sets the use of italic style.

Parameters
stlyeTrue for use of italic style.

Implements FIFE::IFont.

Definition at line 142 of file gui_font.cpp.

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

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 110 of file gui_font.cpp.

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

void FIFE::GuiFont::setStrikethroughStyle ( bool  style)
virtual

Sets the use of strikethrough style.

Parameters
stlyeTrue for use of strikethrough style.

Implements FIFE::IFont.

Definition at line 158 of file gui_font.cpp.

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

void FIFE::GuiFont::setUnderlineStyle ( bool  style)
virtual

Sets the use of underline style.

Parameters
stlyeTrue for use of underline style.

Implements FIFE::IFont.

Definition at line 150 of file gui_font.cpp.

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

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

Implements FIFE::IFont.

Definition at line 182 of file gui_font.cpp.

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

Referenced by fcn::ClickLabel::adjustSize(), and fcn::ClickLabel::wrapText().

+ Here is the caller graph for this function:

Member Data Documentation


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