00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00024 #ifndef __ze_zfont_h__
00025 #define __ze_zfont_h__
00026 
00027 #include "ZE_ZEngine.h"
00028 #include "ZE_ZImage.h"
00029 
00030 #ifdef USE_SDL_TTF
00031 
00032 namespace ZE
00033 {
00034 
00040 class ZFont
00041 {
00042     protected:
00044         ZEngine* rEngine;
00046         TTF_Font *rFont;
00048         string rFilename;
00050         SDL_Color rColor;
00052         SDL_Color rBGColor;
00053 
00054     public:
00055 
00057         
00059 
00065         ZFont();
00066 
00074         ZFont(string filename, int size);
00075 
00081         virtual ~ZFont();
00082 
00090         void Open(string filename, int size);
00091 
00097         void Release();
00098 
00100         
00102 
00110         void DrawText(string text, ZImage &image) const;
00111 
00119         void DrawShadedText(string text, ZImage &image) const;
00120 
00129         void SetColor(Uint8 r, Uint8 g, Uint8 b);
00130 
00139         void SetBGColor(Uint8 r, Uint8 g, Uint8 b);
00140 
00149         void SetStyle(bool bold, bool italic, bool underline);
00150 
00157         void Resize(int size);
00158 
00160         
00162 
00169         bool IsLoaded() const;
00170 
00177         bool IsBold() const;
00178 
00185         bool IsItalic() const;
00186 
00193         bool IsUnderlined() const;
00194 
00201         int Height() const;
00202 
00209         int LineSkip() const;
00210 
00218         int StringWidth(string text) const;
00219 
00227         int StringHeight(string text) const;
00228 };
00229 
00230 }
00231 
00232 #endif //USE_SDL_TTF
00233 
00234 #endif //__ze_zfont_h__