]> git.localhorst.tv Git - blank.git/blob - src/graphics/Font.hpp
implemented font redering
[blank.git] / src / graphics / Font.hpp
1 #ifndef BLANK_GRAPHICS_FONT_HPP_
2 #define BLANK_GRAPHICS_FONT_HPP_
3
4 #include <SDL_ttf.h>
5 #include <glm/glm.hpp>
6
7
8 namespace blank {
9
10 class Texture;
11
12 class Font {
13
14 public:
15         Font(const char *src, int size, long index = 0);
16         ~Font();
17
18         Font(Font &&) noexcept;
19         Font &operator =(Font &&) noexcept;
20
21         Font(const Font &) = delete;
22         Font &operator =(const Font &) = delete;
23
24 public:
25         bool Kerning() const noexcept;
26         void Kerning(bool) noexcept;
27
28         int Height() const noexcept;
29         int Ascent() const noexcept;
30         int Descent() const noexcept;
31         int LineSkip() const noexcept;
32
33         bool HasGlyph(Uint16) const noexcept;
34
35         glm::tvec2<int> TextSize(const char *) const;
36
37         Texture Render(const char *, SDL_Color) const;
38
39 private:
40         TTF_Font *handle;
41
42 };
43
44 }
45
46 #endif