FIFE
|
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... | |
void | setAntiAlias (bool antiAlias) |
Sets the use of anti aliasing. More... | |
bool | isAntiAlias () |
Checks if anti aliasing is used. More... | |
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 |
![]() | |
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 |
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.
|
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(), FIFE::RenderBackend::createImage(), FIFE::TextRenderPool::getRenderedText(), FIFE::DynamicSingleton< RenderBackend >::instance(), m_pool, and renderString().
|
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::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().
|
virtual |
Get the color the text was rendered in.
Implements FIFE::IFont.
Definition at line 80 of file fontbase.cpp.
References mColor.
Referenced by FIFE::TextRenderPool::addRenderedText(), and FIFE::TextRenderPool::getRenderedText().
|
virtual |
Gets the spacing between letters in pixels.
Implements FIFE::IFont.
Definition at line 68 of file fontbase.cpp.
References mGlyphSpacing.
Referenced by FIFE::TextRenderPool::addRenderedText(), FIFE::TextRenderPool::getRenderedText(), FIFE::ImageFontBase::getWidth(), and FIFE::ImageFontBase::renderString().
|
virtual |
Gets the spacing between rows in pixels.
Implements FIFE::IFont.
Definition at line 60 of file fontbase.cpp.
References mRowSpacing.
Referenced by FIFE::TextRenderPool::addRenderedText(), getAsImageMultiline(), FIFE::TrueTypeFont::getHeight(), and FIFE::TextRenderPool::getRenderedText().
|
virtual |
Implements FIFE::IFont.
Definition at line 84 of file fontbase.cpp.
References FIFE::IFont::getWidth(), utf8::is_valid(), and utf8::next().
|
virtual |
Implements FIFE::IFont.
Definition at line 52 of file fontbase.cpp.
References FIFE::TextRenderPool::invalidateCachedText(), and m_pool.
|
virtual |
Checks if anti aliasing is used.
Implements FIFE::IFont.
Definition at line 76 of file fontbase.cpp.
References m_antiAlias.
Referenced by FIFE::TextRenderPool::addRenderedText(), and FIFE::TextRenderPool::getRenderedText().
|
pure virtual |
Implemented in FIFE::TrueTypeFont, and FIFE::ImageFontBase.
Referenced by getAsImage(), and getAsImageMultiline().
|
virtual |
Sets the use of anti aliasing.
antiAlias | true for use of anti aliasing. |
Implements FIFE::IFont.
Definition at line 72 of file fontbase.cpp.
References m_antiAlias.
|
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 64 of file fontbase.cpp.
References mGlyphSpacing.
|
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 56 of file fontbase.cpp.
References mRowSpacing.
|
virtual |
Implements FIFE::IFont.
Definition at line 174 of file fontbase.cpp.
References utf8::append(), utf8::distance(), FIFE::IFont::getWidth(), utf8::next(), and utf8::utf8to32().
|
protected |
Definition at line 78 of file fontbase.h.
Referenced by isAntiAlias(), FIFE::TrueTypeFont::renderString(), and setAntiAlias().
|
protected |
Definition at line 71 of file fontbase.h.
Referenced by getAsImage(), getAsImageMultiline(), and invalidate().
|
protected |
Definition at line 73 of file fontbase.h.
Referenced by getColor(), FIFE::TrueTypeFont::renderString(), FIFE::TrueTypeFont::setColor(), and FIFE::TrueTypeFont::TrueTypeFont().
|
protected |
Definition at line 77 of file fontbase.h.
|
protected |
Definition at line 74 of file fontbase.h.
Referenced by getGlyphSpacing(), and setGlyphSpacing().
|
protected |
Definition at line 75 of file fontbase.h.
Referenced by getRowSpacing(), and setRowSpacing().