#ifndef MGLPP_FONT_HPP #define MGLPP_FONT_HPP #include "../system/vec.hpp" extern "C" { #include } namespace mgl { class Texture; class MemoryMappedFile; struct FontGlyph { vec2i position; vec2i size; vec2i texture_position; /* In pixel space */ vec2i texture_size; /* In pixel space */ int advance = 0; }; class Font { public: Font(); ~Font(); bool load_from_file(const MemoryMappedFile &mapped_file, 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); int get_kerning(uint32_t prev_codepoint, uint32_t codepoint); Texture get_texture() const; mgl_font* internal_font(); private: mgl_font font; }; } #endif /* MGLPP_FONT_HPP */