summary refs log tree commit diff stats
path: root/src/font.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/font.h')
-rw-r--r--src/font.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..fd24830 --- /dev/null +++ b/src/font.h
@@ -0,0 +1,33 @@
1#ifndef FONT_H_C80183A7
2#define FONT_H_C80183A7
3
4#include <string_view>
5#include <vector>
6#include "vector.h"
7
8class Renderer;
9
10class Font {
11public:
12
13 Font(std::string_view filename, Renderer& renderer);
14
15 int getTextureId() const { return textureId_; }
16
17 vec2i getCharacterLocation(char ch) const;
18
19 vec2i getCharacterSize(char ch) const;
20
21 int getCharacterWidth(char ch) const;
22
23 int getCharacterHeight() const { return tileSize_.h(); }
24
25private:
26
27 int textureId_;
28 int columns_;
29 vec2i tileSize_;
30 std::vector<int> widths_;
31};
32
33#endif /* end of include guard: FONT_H_C80183A7 */