00001 00002 00003 00004 #ifndef GOSU_FONT_HPP 00005 #define GOSU_FONT_HPP 00006 00007 #include <Gosu/Fwd.hpp> 00008 #include <Gosu/Color.hpp> 00009 #include <Gosu/GraphicsBase.hpp> 00010 #include <boost/scoped_ptr.hpp> 00011 #include <string> 00012 00013 namespace Gosu 00014 { 00019 class Font 00020 { 00021 struct Impl; 00022 boost::scoped_ptr<Impl> pimpl; 00023 00024 public: 00028 Font(Graphics& graphics, const std::wstring& fontName, 00029 unsigned height); 00030 ~Font(); 00031 00033 unsigned height() const; 00034 00036 double textWidth(const std::wstring& text, double factorX = 1) const; 00037 00039 void draw(const std::wstring& text, double x, double y, ZPos z, 00040 double factorX = 1, double factorY = 1, 00041 Color c = Colors::white, AlphaMode mode = amDefault) const; 00042 00049 void drawRel(const std::wstring& text, double x, double y, ZPos z, 00050 double relX, double relY, double factorX = 1, double factorY = 1, 00051 Color c = Colors::white, AlphaMode mode = amDefault) const; 00052 00053 void drawRot(const std::wstring& text, double x, double y, ZPos z, double angle, 00054 double factorX = 1, double factorY = 1, 00055 Color c = Colors::white, AlphaMode mode = amDefault) const; 00056 }; 00057 } 00058 00059 #endif