FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Abstract Font Base Class Uses a pool for rendered strings. More...
#include <fontbase.h>
Public Member Functions | |
FontBase () | |
virtual | ~FontBase () |
void | invalidate () |
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... | |
virtual void | setAntiAlias (bool antiAlias) |
Sets the use of anti aliasing. More... | |
virtual bool | isAntiAlias () const |
Checks if anti aliasing is used. More... | |
virtual void | setBoldStyle (bool style) |
Sets the use of bold style. More... | |
virtual bool | isBoldStyle () const |
Checks if bold style is used. More... | |
virtual void | setItalicStyle (bool style) |
Sets the use of italic style. More... | |
virtual bool | isItalicStyle () const |
Checks if italic style is used. More... | |
virtual void | setUnderlineStyle (bool style) |
Sets the use of underline style. More... | |
virtual bool | isUnderlineStyle () const |
Checks if underline style is used. More... | |
virtual void | setStrikethroughStyle (bool style) |
Sets the use of strikethrough style. More... | |
virtual bool | isStrikethroughStyle () const |
Checks if strikethrough style is used. More... | |
virtual void | setDynamicColoring (bool coloring) |
virtual bool | isDynamicColoring () const |
virtual int32_t | getStringIndexAt (const std::string &text, int32_t x) 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... | |
std::string | splitTextToWidth (const std::string &text, int32_t render_width) |
SDL_Color | getColor () const |
Get the color the text was rendered in. More... | |
virtual SDL_Surface * | renderString (const std::string &text)=0 |
Public Member Functions inherited from FIFE::IFont | |
virtual | ~IFont () |
virtual void | setColor (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Set the color the text should be rendered in. More... | |
virtual int32_t | getWidth (const std::string &text) const =0 |
gets width of given text More... | |
virtual int32_t | getHeight () const =0 |
gets height of this font More... | |
Protected Attributes | |
TextRenderPool | m_pool |
SDL_Color | mColor |
int32_t | mGlyphSpacing |
int32_t | mRowSpacing |
std::string | mFilename |
bool | m_antiAlias |
bool | m_boldStyle |
bool | m_italicStyle |
bool | m_underlineStyle |
bool | m_strikeStyle |
bool | m_coloring |
Abstract Font Base Class Uses a pool for rendered strings.
Definition at line 48 of file fontbase.h.
FIFE::FontBase::FontBase | ( | ) |
Definition at line 43 of file fontbase.cpp.
|
inlinevirtual |
Definition at line 51 of file fontbase.h.
References getAsImage(), getAsImageMultiline(), getColor(), getGlyphSpacing(), getRowSpacing(), getStringIndexAt(), invalidate(), isAntiAlias(), isBoldStyle(), isDynamicColoring(), isItalicStyle(), isStrikethroughStyle(), isUnderlineStyle(), renderString(), setAntiAlias(), setBoldStyle(), setDynamicColoring(), setGlyphSpacing(), setItalicStyle(), setRowSpacing(), setStrikethroughStyle(), setUnderlineStyle(), and splitTextToWidth().
|
virtual |
Gets given text as Image The rsulting image is pooled, so it's not that time critical.
Implements FIFE::IFont.
Definition at line 157 of file fontbase.cpp.
References FIFE::TextRenderPool::addRenderedText(), FIFE::RenderBackend::createImage(), FIFE::TextRenderPool::getRenderedText(), FIFE::DynamicSingleton< RenderBackend >::instance(), m_pool, and renderString().
Referenced by ~FontBase().
|
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 167 of file fontbase.cpp.
References FIFE::TextRenderPool::addRenderedText(), FIFE::AMASK, utf8::append(), FIFE::BMASK, FIFE::RenderBackend::createImage(), FIFE::IFont::getHeight(), FIFE::TextRenderPool::getRenderedText(), getRowSpacing(), FIFE::GMASK, FIFE::DynamicSingleton< RenderBackend >::instance(), m_pool, utf8::next(), renderString(), FIFE::RMASK, and utf8::utf8to32().
Referenced by ~FontBase().
|
virtual |
Get the color the text was rendered in.
Implements FIFE::IFont.
Definition at line 125 of file fontbase.cpp.
References mColor.
Referenced by FIFE::TextRenderPool::addRenderedText(), FIFE::TextRenderPool::getRenderedText(), and ~FontBase().
|
virtual |
Gets the spacing between letters in pixels.
Implements FIFE::IFont.
Definition at line 73 of file fontbase.cpp.
References mGlyphSpacing.
Referenced by FIFE::TextRenderPool::addRenderedText(), FIFE::TextRenderPool::getRenderedText(), FIFE::ImageFontBase::getWidth(), FIFE::ImageFontBase::renderString(), and ~FontBase().
|
virtual |
Gets the spacing between rows in pixels.
Implements FIFE::IFont.
Definition at line 65 of file fontbase.cpp.
References mRowSpacing.
Referenced by FIFE::TextRenderPool::addRenderedText(), getAsImageMultiline(), FIFE::TrueTypeFont::getHeight(), FIFE::TextRenderPool::getRenderedText(), and ~FontBase().
|
virtual |
Implements FIFE::IFont.
Definition at line 129 of file fontbase.cpp.
References FIFE::IFont::getWidth(), utf8::is_valid(), and utf8::next().
Referenced by ~FontBase().
|
virtual |
Implements FIFE::IFont.
Definition at line 57 of file fontbase.cpp.
References FIFE::TextRenderPool::invalidateCachedText(), and m_pool.
Referenced by ~FontBase().
|
virtual |
Checks if anti aliasing is used.
Implements FIFE::IFont.
Definition at line 81 of file fontbase.cpp.
References m_antiAlias.
Referenced by FIFE::TextRenderPool::addRenderedText(), FIFE::TextRenderPool::getRenderedText(), and ~FontBase().
|
virtual |
Checks if bold style is used.
Implements FIFE::IFont.
Definition at line 89 of file fontbase.cpp.
References m_boldStyle.
Referenced by ~FontBase().
|
virtual |
Implements FIFE::IFont.
Definition at line 121 of file fontbase.cpp.
References m_coloring.
Referenced by ~FontBase().
|
virtual |
Checks if italic style is used.
Implements FIFE::IFont.
Definition at line 97 of file fontbase.cpp.
References m_italicStyle.
Referenced by ~FontBase().
|
virtual |
Checks if strikethrough style is used.
Implements FIFE::IFont.
Definition at line 113 of file fontbase.cpp.
References m_strikeStyle.
Referenced by ~FontBase().
|
virtual |
Checks if underline style is used.
Implements FIFE::IFont.
Definition at line 105 of file fontbase.cpp.
References m_underlineStyle.
Referenced by ~FontBase().
|
pure virtual |
Implemented in FIFE::TrueTypeFont, and FIFE::ImageFontBase.
Referenced by getAsImage(), getAsImageMultiline(), and ~FontBase().
|
virtual |
Sets the use of anti aliasing.
antiAlias | true for use of anti aliasing. |
Implements FIFE::IFont.
Definition at line 77 of file fontbase.cpp.
References m_antiAlias.
Referenced by ~FontBase().
|
virtual |
Sets the use of bold style.
stlye | True for use of bold style. |
Implements FIFE::IFont.
Reimplemented in FIFE::TrueTypeFont.
Definition at line 85 of file fontbase.cpp.
References m_boldStyle.
Referenced by ~FontBase().
|
virtual |
Implements FIFE::IFont.
Definition at line 117 of file fontbase.cpp.
References m_coloring.
Referenced by ~FontBase().
|
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 69 of file fontbase.cpp.
References mGlyphSpacing.
Referenced by ~FontBase().
|
virtual |
Sets the use of italic style.
stlye | True for use of italic style. |
Implements FIFE::IFont.
Reimplemented in FIFE::TrueTypeFont.
Definition at line 93 of file fontbase.cpp.
References m_italicStyle.
Referenced by ~FontBase().
|
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 61 of file fontbase.cpp.
References mRowSpacing.
Referenced by ~FontBase().
|
virtual |
Sets the use of strikethrough style.
stlye | True for use of strikethrough style. |
Implements FIFE::IFont.
Reimplemented in FIFE::TrueTypeFont.
Definition at line 109 of file fontbase.cpp.
References m_strikeStyle.
Referenced by ~FontBase().
|
virtual |
Sets the use of underline style.
stlye | True for use of underline style. |
Implements FIFE::IFont.
Reimplemented in FIFE::TrueTypeFont.
Definition at line 101 of file fontbase.cpp.
References m_underlineStyle.
Referenced by ~FontBase().
|
virtual |
Implements FIFE::IFont.
Definition at line 221 of file fontbase.cpp.
References utf8::append(), utf8::distance(), FIFE::IFont::getWidth(), utf8::next(), and utf8::utf8to32().
Referenced by ~FontBase().
|
protected |
Definition at line 91 of file fontbase.h.
Referenced by isAntiAlias(), FIFE::TrueTypeFont::renderString(), and setAntiAlias().
|
protected |
Definition at line 92 of file fontbase.h.
Referenced by isBoldStyle(), setBoldStyle(), and FIFE::TrueTypeFont::setBoldStyle().
|
protected |
Definition at line 96 of file fontbase.h.
Referenced by isDynamicColoring(), and setDynamicColoring().
|
protected |
Definition at line 93 of file fontbase.h.
Referenced by isItalicStyle(), setItalicStyle(), and FIFE::TrueTypeFont::setItalicStyle().
|
protected |
Definition at line 84 of file fontbase.h.
Referenced by getAsImage(), getAsImageMultiline(), and invalidate().
|
protected |
Definition at line 95 of file fontbase.h.
Referenced by isStrikethroughStyle(), setStrikethroughStyle(), and FIFE::TrueTypeFont::setStrikethroughStyle().
|
protected |
Definition at line 94 of file fontbase.h.
Referenced by isUnderlineStyle(), setUnderlineStyle(), and FIFE::TrueTypeFont::setUnderlineStyle().
|
protected |
Definition at line 86 of file fontbase.h.
Referenced by getColor(), FIFE::TrueTypeFont::renderString(), FIFE::TrueTypeFont::setColor(), and FIFE::TrueTypeFont::TrueTypeFont().
|
protected |
Definition at line 90 of file fontbase.h.
Referenced by FIFE::TrueTypeFont::TrueTypeFont().
|
protected |
Definition at line 87 of file fontbase.h.
Referenced by getGlyphSpacing(), and setGlyphSpacing().
|
protected |
Definition at line 88 of file fontbase.h.
Referenced by getRowSpacing(), and setRowSpacing().