FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <gui_font.h>
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 |
Image * | getAsImage (const std::string &text) |
Gets given text as Image The rsulting image is pooled, so it's not that time critical. More... | |
Image * | getAsImageMultiline (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 | |
IFont * | m_font |
Definition at line 39 of file gui_font.h.
FIFE::GuiFont::GuiFont | ( | IFont * | font | ) |
Constructor Takes the ownership of given font.
Definition at line 38 of file gui_font.cpp.
|
virtual |
Definition at line 42 of file gui_font.cpp.
References m_font.
void FIFE::GuiFont::drawMultiLineString | ( | fcn::Graphics * | graphics, |
const std::string & | text, | ||
int32_t | x, | ||
int32_t | y | ||
) |
Definition at line 80 of file gui_font.cpp.
References getAsImageMultiline(), getColor(), FIFE::Image::getHeight(), getRowSpacing(), FIFE::Image::getWidth(), FIFE::RectType< T >::h, FIFE::RectType< T >::intersects(), isDynamicColoring(), FIFE::Image::render(), setColor(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
Referenced by fcn::ClickLabel::draw().
void FIFE::GuiFont::drawString | ( | fcn::Graphics * | graphics, |
const std::string & | text, | ||
int32_t | x, | ||
int32_t | y | ||
) |
Definition at line 50 of file gui_font.cpp.
References getAsImage(), getColor(), getHeight(), getRowSpacing(), getWidth(), FIFE::RectType< T >::h, FIFE::RectType< T >::intersects(), isDynamicColoring(), FIFE::Image::render(), setColor(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
|
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().
|
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().
|
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().
|
virtual |
Gets the spacing between letters in pixels.
Implements FIFE::IFont.
Definition at line 122 of file gui_font.cpp.
References FIFE::IFont::getGlyphSpacing(), and m_font.
|
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().
|
virtual |
Gets the spacing between rows in pixels.
Implements FIFE::IFont.
Definition at line 114 of file gui_font.cpp.
References FIFE::IFont::getRowSpacing(), and m_font.
Referenced by drawMultiLineString(), and drawString().
|
virtual |
Implements FIFE::IFont.
Definition at line 46 of file gui_font.cpp.
References FIFE::IFont::getStringIndexAt(), and m_font.
|
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().
|
virtual |
Implements FIFE::IFont.
Definition at line 202 of file gui_font.cpp.
References FIFE::IFont::invalidate(), and m_font.
|
virtual |
Checks if anti aliasing is used.
Implements FIFE::IFont.
Definition at line 130 of file gui_font.cpp.
References FIFE::IFont::isAntiAlias(), and m_font.
|
virtual |
Checks if bold style is used.
Implements FIFE::IFont.
Definition at line 138 of file gui_font.cpp.
References FIFE::IFont::isBoldStyle(), and m_font.
|
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().
|
virtual |
Checks if italic style is used.
Implements FIFE::IFont.
Definition at line 146 of file gui_font.cpp.
References FIFE::IFont::isItalicStyle(), and m_font.
|
virtual |
Checks if strikethrough style is used.
Implements FIFE::IFont.
Definition at line 162 of file gui_font.cpp.
References FIFE::IFont::isStrikethroughStyle(), and m_font.
|
virtual |
Checks if underline style is used.
Implements FIFE::IFont.
Definition at line 154 of file gui_font.cpp.
References FIFE::IFont::isUnderlineStyle(), and m_font.
|
virtual |
Sets the use of anti aliasing.
antiAlias | true for use of anti aliasing. |
Implements FIFE::IFont.
Definition at line 126 of file gui_font.cpp.
References m_font, and FIFE::IFont::setAntiAlias().
|
virtual |
Sets the use of bold style.
stlye | True for use of bold style. |
Implements FIFE::IFont.
Definition at line 134 of file gui_font.cpp.
References m_font, and FIFE::IFont::setBoldStyle().
|
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().
|
virtual |
Implements FIFE::IFont.
Definition at line 166 of file gui_font.cpp.
References m_font, and FIFE::IFont::setDynamicColoring().
|
virtual |
Sets the spacing between letters in pixels.
Default is 0 pixels. The spacing can be negative.
spacing | the spacing in pixels. |
Implements FIFE::IFont.
Definition at line 118 of file gui_font.cpp.
References m_font, and FIFE::IFont::setGlyphSpacing().
|
virtual |
Sets the use of italic style.
stlye | True for use of italic style. |
Implements FIFE::IFont.
Definition at line 142 of file gui_font.cpp.
References m_font, and FIFE::IFont::setItalicStyle().
|
virtual |
Sets the spacing between rows in pixels.
Default is 0 pixels. The spacing can be negative.
spacing | the spacing in pixels. |
Implements FIFE::IFont.
Definition at line 110 of file gui_font.cpp.
References m_font, and FIFE::IFont::setRowSpacing().
|
virtual |
Sets the use of strikethrough style.
stlye | True for use of strikethrough style. |
Implements FIFE::IFont.
Definition at line 158 of file gui_font.cpp.
References m_font, and FIFE::IFont::setStrikethroughStyle().
|
virtual |
Sets the use of underline style.
stlye | True for use of underline style. |
Implements FIFE::IFont.
Definition at line 150 of file gui_font.cpp.
References m_font, and FIFE::IFont::setUnderlineStyle().
|
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().
|
private |
Definition at line 77 of file gui_font.h.
Referenced by getAsImage(), getAsImageMultiline(), getColor(), getGlyphSpacing(), getHeight(), getRowSpacing(), getStringIndexAt(), getWidth(), invalidate(), isAntiAlias(), isBoldStyle(), isDynamicColoring(), isItalicStyle(), isStrikethroughStyle(), isUnderlineStyle(), setAntiAlias(), setBoldStyle(), setColor(), setDynamicColoring(), setGlyphSpacing(), setItalicStyle(), setRowSpacing(), setStrikethroughStyle(), setUnderlineStyle(), splitTextToWidth(), and ~GuiFont().