54 FL_LOG(
_log,
LMsg(
"fifechan_image_font, loading ") << filename <<
" glyphs " << glyphs);
61 throw CannotOpenFile(filename);
66 SDL_Surface *tmp = SDL_CreateRGBSurface(0,
67 surface->w,surface->h,32,
70 SDL_BlitSurface(surface,0,tmp,0);
88 while(x < surface->w && pixels[x] == separator) {
100 <<
" glyph separator is " 101 <<
pprint(reinterpret_cast<void*>(separator))
102 <<
" transparent color is " 103 <<
pprint(reinterpret_cast<void*>(colorkey)));
106 std::string::const_iterator text_it = glyphs.begin();
107 while(text_it != glyphs.end()) {
109 while(x < surface->w && pixels[x] == separator)
111 if( x == surface->w )
114 while(x + w < surface->w && pixels[x + w] != separator)
120 tmp = SDL_CreateRGBSurface(0,
124 SDL_FillRect(tmp,0,colorkey);
125 SDL_BlitSurface(surface,&src,tmp,0);
130 SDL_SetSurfaceBlendMode(tmp, SDL_BLENDMODE_NONE);
131 SDL_SetColorKey(tmp, SDL_TRUE, colorkey);
134 m_glyphs[ codepoint ].surface = tmp;
148 SDL_FreeSurface(surface);
const SDL_Color & getColorKey() const
Gets the global colorkey setting.
Helper class to create log strings out from separate parts Usage: LMsg("some text") << variable << "...
uint32_t next(octet_iterator &it, octet_iterator end)
static Logger _log(LM_AUDIO)
static ImageManager * instance()
SDL_Surface * getSurface()
#define FL_LOG(logger, msg)
Helper for printing a pointer.
SubImageFont(const std::string &filename, const std::string &glyphs)
Constructor.
#define FL_DBG(logger, msg)
virtual ImagePtr load(const std::string &name, IResourceLoader *loader=0)
Creates a blank resource and loads it from disk.