Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Font.h

Go to the documentation of this file.
00001 #ifndef HEADER_FONT_H
00002 #define HEADER_FONT_H
00003 
00004 class Path;
00005 
00006 #include "NoCopy.h"
00007 
00008 #include "SDL.h"
00009 #include "SDL_ttf.h"
00010 
00011 #include <string>
00012 
00013 /**
00014  * TrueType UTF-8 font.
00015  */
00016 class Font : public NoCopy {
00017     private:
00018         TTF_Font *m_ttfont;
00019         SDL_Color m_bg;
00020     public:
00021         Font(const Path &file_ttf, int height);
00022         ~Font();
00023         static void init();
00024         static void shutdown();
00025 
00026         int getHeight() { return TTF_FontHeight(m_ttfont); }
00027         int calcTextWidth(const std::string &text);
00028         SDL_Surface *renderText(const std::string &text,
00029                 const SDL_Color &color) const;
00030         SDL_Surface *renderTextOutlined(const std::string &text,
00031                 const SDL_Color &color, int outlineWidth=1) const;
00032 };
00033 
00034 #endif

Generated on Wed Jun 1 09:54:31 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2