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(SDL_SWSURFACE,
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 getWidth(const std::string &text) const
Get the width in pixels a given text would occupy.
int32_t getGlyphSpacing() const
Gets the spacing between letters in pixels.
virtual void setColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a=255)
uint32_t next(octet_iterator &it, octet_iterator end)
virtual ~ImageFontBase()
Destructor.
Abstract Font Base Class Uses a pool for rendered strings.
virtual SDL_Surface * renderString(const std::string &text)
virtual int32_t getHeight() const
Get the height in pixels a text line would occupy.
ImageFontBase()
Constructor.