From 8d525bc1c3506f15a5f68672245f845cebe18eef Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 28 Oct 2021 17:33:57 +0200 Subject: More, todo interfaces --- src/graphics/Font.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/graphics/Font.cpp') 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 + 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; } -- cgit v1.2.3