diff options
Diffstat (limited to 'include/mglpp/graphics/Font.hpp')
-rw-r--r-- | include/mglpp/graphics/Font.hpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/mglpp/graphics/Font.hpp b/include/mglpp/graphics/Font.hpp index b032e13..440dabe 100644 --- a/include/mglpp/graphics/Font.hpp +++ b/include/mglpp/graphics/Font.hpp @@ -9,13 +9,14 @@ extern "C" { namespace mgl { class Texture; + class MemoryMappedFile; struct FontGlyph { - vec2f position; - vec2f size; - vec2f texture_position; - vec2f texture_size; - float advance = 0.0f; + vec2i position; + vec2i size; + vec2i texture_position; /* In pixel space */ + vec2i texture_size; /* In pixel space */ + int advance = 0; }; class Font { @@ -23,10 +24,11 @@ namespace mgl { Font(); ~Font(); - bool load_from_file(const char *filepath, unsigned int character_size); + 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) const; + FontGlyph get_glyph(uint32_t codepoint); + int get_kerning(uint32_t prev_codepoint, uint32_t codepoint); Texture get_texture() const; mgl_font* internal_font(); |