Font.hpp
Go to the documentation of this file.
1 
2 
3 
4 #ifndef GOSU_FONT_HPP
5 #define GOSU_FONT_HPP
6 
7 #include <Gosu/Fwd.hpp>
8 #include <Gosu/Color.hpp>
9 #include <Gosu/GraphicsBase.hpp>
10 #include <Gosu/Platform.hpp>
11 #include <Gosu/TR1.hpp>
12 #include <string>
13 
14 namespace Gosu
15 {
20  class Font
21  {
22  struct Impl;
23  std::tr1::shared_ptr<Impl> pimpl;
24 
25  public:
32  Font(Graphics& graphics, const std::wstring& fontName,
33  unsigned fontHeight, unsigned fontFlags = ffBold);
34 
36  std::wstring name() const;
37 
39  unsigned height() const;
40 
42  unsigned flags() const;
43 
45  double textWidth(const std::wstring& text, double factorX = 1) const;
46 
49  void draw(const std::wstring& text, double x, double y, ZPos z,
50  double factorX = 1, double factorY = 1,
51  Color c = Color::WHITE, AlphaMode mode = amDefault) const;
52 
59  void drawRel(const std::wstring& text, double x, double y, ZPos z,
60  double relX, double relY, double factorX = 1, double factorY = 1,
61  Color c = Color::WHITE, AlphaMode mode = amDefault) const;
62 
67  void setImage(wchar_t wc, unsigned fontFlags, const Gosu::Image& image);
70  void setImage(wchar_t wc, const Gosu::Image& image);
71 
72  #ifndef SWIG
74  #endif
75 
76 
77  void drawRot(const std::wstring& text, double x, double y, ZPos z, double angle,
78  double factorX = 1, double factorY = 1,
79  Color c = Color::WHITE, AlphaMode mode = amDefault) const;
80  };
81 }
82 
83 #endif