diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-16 11:07:49 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-16 11:07:49 +0100 |
commit | 3a29b9984760af0b3a85e35190e1dede39e13891 (patch) | |
tree | c9baa5cb9204d15d081ef73a82729b493e6898fb /include/mglpp/graphics/Font.hpp | |
parent | 01e3403abf86050e4096ecf60466de4139ac78e2 (diff) |
Implement all interfaces to mgl
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(); |