gui_font.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FIFE_GUI_FONT_H
00023 #define FIFE_GUI_FONT_H
00024
00025
00026
00027
00028 #include <guichan/font.hpp>
00029
00030
00031
00032
00033
00034 #include "video/fonts/abstractfont.h"
00035
00036
00037 namespace FIFE {
00038
00039 class GuiFont : public gcn::Font, public AbstractFont {
00040 public:
00044 GuiFont(AbstractFont* font);
00045 virtual ~GuiFont();
00046
00047 int getStringIndexAt(const std::string& text, int x) const;
00048 void drawString(gcn::Graphics* graphics, const std::string& text, int x, int y);
00049 void drawMultiLineString(gcn::Graphics* graphics, const std::string& text, int x, int y);
00050 std::string splitTextToWidth (const std::string& text, int render_width);
00051
00052 void setRowSpacing (int spacing);
00053 int getRowSpacing() const;
00054 void setGlyphSpacing(int spacing);
00055 int getGlyphSpacing() const;
00056 void setAntiAlias(bool antiAlias);
00057 bool isAntiAlias();
00058 Image* getAsImage(const std::string& text);
00059 Image* getAsImageMultiline(const std::string& text);
00060 void setColor(uint8_t r,uint8_t g,uint8_t b);
00061 SDL_Color getColor() const;
00062 int getWidth(const std::string& text) const;
00063 int getHeight() const;
00064
00065 private:
00066 AbstractFont* m_font;
00067 };
00068 }
00069
00070 #endif