#ifndef MGL_FONT_H #define MGL_FONT_H #include "../system/vec.h" #include "texture.h" #include typedef struct mgl_font mgl_font; typedef struct { mgl_vec2f position; mgl_vec2f size; mgl_vec2f texture_position; mgl_vec2f texture_size; float advance; } mgl_font_glyph; typedef struct { unsigned char *atlas; int width; int height; } mgl_font_atlas; struct mgl_font { mgl_texture texture; mgl_font_atlas font_atlas; unsigned int character_size; void *packed_chars; uint32_t num_packed_chars; }; int mgl_font_load_from_file(mgl_font *self, const char *filepath, unsigned int character_size); void mgl_font_unload(mgl_font *self); int mgl_font_get_glyph(const mgl_font *self, uint32_t codepoint, mgl_font_glyph *glyph); #endif /* MGL_FONT_H */