Go to the documentation of this file.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 <Gosu/Platform.hpp>
00011 #include <Gosu/TR1.hpp>
00012 #include <string>
00013
00014 namespace Gosu
00015 {
00020 class Font
00021 {
00022 struct Impl;
00023 std::tr1::shared_ptr<Impl> pimpl;
00024
00025 public:
00032 Font(Graphics& graphics, const std::wstring& fontName,
00033 unsigned fontHeight, unsigned fontFlags = ffBold);
00034
00036 std::wstring name() const;
00037
00039 unsigned height() const;
00040
00042 unsigned flags() const;
00043
00045 double textWidth(const std::wstring& text, double factorX = 1) const;
00046
00049 void draw(const std::wstring& text, double x, double y, ZPos z,
00050 double factorX = 1, double factorY = 1,
00051 Color c = Color::WHITE, AlphaMode mode = amDefault) const;
00052
00059 void drawRel(const std::wstring& text, double x, double y, ZPos z,
00060 double relX, double relY, double factorX = 1, double factorY = 1,
00061 Color c = Color::WHITE, AlphaMode mode = amDefault) const;
00062
00067 void setImage(wchar_t wc, unsigned fontFlags, const Gosu::Image& image);
00070 void setImage(wchar_t wc, const Gosu::Image& image);
00071
00072 #ifndef SWIG
00073 GOSU_DEPRECATED
00074 #endif
00075
00076
00077 void drawRot(const std::wstring& text, double x, double y, ZPos z, double angle,
00078 double factorX = 1, double factorY = 1,
00079 Color c = Color::WHITE, AlphaMode mode = amDefault) const;
00080 };
00081 }
00082
00083 #endif