diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-06 15:55:42 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-06 15:55:42 +0100 |
commit | cb679636f77fe2a03e8dab3a511e28e1ab898316 (patch) | |
tree | b03cada4a37a50eb50cef1e21c75c56d938868a8 /src/graphics/font.c | |
parent | e2e7c0bf0747d55967c4be6374f3611cd96babb6 (diff) |
Fix exit being called when closing window, respond to wm ping, add is_open function to window
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; |