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
00063 #ifndef SWIG
00064 GOSU_DEPRECATED
00065 #endif
00066
00067
00068 void drawRot(const std::wstring& text, double x, double y, ZPos z, double angle,
00069 double factorX = 1, double factorY = 1,
00070 Color c = Color::WHITE, AlphaMode mode = amDefault) const;
00071 };
00072 }
00073
00074 #endif