UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
font.h
Go to the documentation of this file.
1 #ifndef UGDK_TEXT_FONT_H_
2 #define UGDK_TEXT_FONT_H_
3 
4 #include <ugdk/text.h>
5 #include <ugdk/math/vector2D.h>
6 
7 #include <memory>
8 #include <string>
9 
10 struct texture_atlas_t;
11 struct texture_font_t;
12 
13 namespace ugdk {
14 namespace text {
15 
16 class Font {
17  public:
18  Font(const std::string& path, double size);
19  ~Font();
20 
21  double size() const { return size_; }
22  double height() const;
23 
25  void HintString(const std::wstring&);
26 
27  texture_font_t* freetype_font() const {
28  return freetype_font_;
29  }
30 
31  private:
32  double size_;
33  void* ttf_memory_;
34  texture_atlas_t* atlas_;
35  texture_font_t* freetype_font_;
36 };
37 
38 } // namespace text
39 } // namespace ugdk
40 
41 #endif // UGDK_TEXT_FONT_H_
Font(const std::string &path, double size)
double height() const
Definition: font.h:16
Definition: animation.h:11
texture_font_t * freetype_font() const
Definition: font.h:27
double size() const
Definition: font.h:21
void HintString(const std::wstring &)
Generates all glyphs in the given string and caches then for later use.