27 #include <SDL_image.h> 47 type_glyphs::iterator i =
m_glyphs.begin();
49 SDL_FreeSurface(i->second.surface);
56 std::string::const_iterator text_it = text.begin();
57 while(text_it != text.end()) {
59 type_glyphs::const_iterator it =
m_glyphs.find( codepoint );
78 SDL_Surface *surface = SDL_CreateRGBSurface(0,
82 SDL_FillRect(surface,0,0x00000000);
88 std::string::const_iterator text_it = text.begin();
89 while(text_it != text.end()) {
91 type_glyphs::iterator it =
m_glyphs.find( codepoint );
99 glyph = &(it->second);
104 SDL_BlitSurface(glyph->
surface,0,surface,&dst);
virtual int32_t getHeight() const
Get the height in pixels a text line would occupy.
virtual void setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Set the color the text should be rendered in.
uint32_t next(octet_iterator &it, octet_iterator end)
virtual ~ImageFontBase()
Destructor.
Abstract Font Base Class Uses a pool for rendered strings.
virtual int32_t getWidth(const std::string &text) const
Get the width in pixels a given text would occupy.
virtual SDL_Surface * renderString(const std::string &text)
ImageFontBase()
Constructor.
int32_t getGlyphSpacing() const
Gets the spacing between letters in pixels.