aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/Font.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-28 17:33:57 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-29 14:31:31 +0200
commit8d525bc1c3506f15a5f68672245f845cebe18eef (patch)
tree243376e2cae0be40b6870ec8fe0082845996df87 /src/graphics/Font.cpp
parenta80bf6bb6cb8ab8c5a1430f9f9dbc214f71bdddf (diff)
More, todo interfaces
Diffstat (limited to 'src/graphics/Font.cpp')
-rw-r--r--src/graphics/Font.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/graphics/Font.cpp b/src/graphics/Font.cpp
index 7b5dd68..ae87625 100644
--- a/src/graphics/Font.cpp
+++ b/src/graphics/Font.cpp
@@ -1,5 +1,7 @@
#include "../../include/mglpp/graphics/Font.hpp"
+#include "../../include/mglpp/graphics/Texture.hpp"
#include <string.h>
+
namespace mgl {
Font::Font() {
memset(&font, 0, sizeof(font));
@@ -19,6 +21,21 @@ namespace mgl {
return font.character_size;
}
+ FontGlyph Font::get_glyph(uint32_t codepoint) const {
+ FontGlyph font_glyph;
+ if(font.texture.id == 0)
+ return font_glyph;
+
+ mgl_font_get_glyph(&font, codepoint, (mgl_font_glyph*)&font_glyph);
+ return font_glyph;
+ }
+
+ Texture Font::get_texture() const {
+ if(font.texture.id == 0)
+ return Texture();
+ return Texture::reference(font.texture);
+ }
+
mgl_font* Font::internal_font() {
return &font;
}