diff options
Diffstat (limited to 'src/graphics/font.c')
-rw-r--r-- | src/graphics/font.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/graphics/font.c b/src/graphics/font.c index c017755..175c571 100644 --- a/src/graphics/font.c +++ b/src/graphics/font.c @@ -84,6 +84,11 @@ int mgl_font_load_from_file(mgl_font *self, const char *filepath, unsigned int c continue; } + /*if(!stbtt_PackFontRange(&pc, filedata.data, 0, self->character_size, 0x00004E00, self->num_packed_chars, self->packed_chars)) { + stbtt_PackEnd(&pc); + continue; + }*/ + stbtt_PackEnd(&pc); atlas_created = true; break; @@ -124,7 +129,7 @@ void mgl_font_unload(mgl_font *self) { int mgl_font_get_glyph(const mgl_font *self, uint32_t codepoint, mgl_font_glyph *glyph) { stbtt_packedchar *packed_chars = self->packed_chars; - if(codepoint >= self->num_packed_chars) + if(codepoint < 0 || codepoint >= 0 + self->num_packed_chars) return -1; float x = 0.0f; |