blob: b032e136901967019df39268ca03e4500f7a9058 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#ifndef MGLPP_FONT_HPP
#define MGLPP_FONT_HPP
#include "../system/vec.hpp"
extern "C" {
#include <mgl/graphics/font.h>
}
namespace mgl {
class Texture;
struct FontGlyph {
vec2f position;
vec2f size;
vec2f texture_position;
vec2f texture_size;
float advance = 0.0f;
};
class Font {
public:
Font();
~Font();
bool load_from_file(const char *filepath, unsigned int character_size);
unsigned int get_character_size() const;
// Returns 0 sized glyph if the font doesn't have the codepoint
FontGlyph get_glyph(uint32_t codepoint) const;
Texture get_texture() const;
mgl_font* internal_font();
private:
mgl_font font;
};
}
#endif /* MGLPP_FONT_HPP */
|