aboutsummaryrefslogtreecommitdiff
path: root/include/mglpp/graphics/Font.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mglpp/graphics/Font.hpp')
-rw-r--r--include/mglpp/graphics/Font.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/mglpp/graphics/Font.hpp b/include/mglpp/graphics/Font.hpp
index 6818277..b032e13 100644
--- a/include/mglpp/graphics/Font.hpp
+++ b/include/mglpp/graphics/Font.hpp
@@ -1,11 +1,23 @@
#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();
@@ -13,7 +25,10 @@ namespace mgl {
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;