Check for errors when loading fonts

This commit is contained in:
Francesco Abbate 2020-06-01 17:01:42 +02:00
parent b734390388
commit c2949edcd7
1 changed files with 4 additions and 2 deletions

View File

@ -160,8 +160,10 @@ RenFont* ren_load_font(const char *filename, float size) {
font->size = size;
font->renderer = FontRendererNew(FONT_RENDERER_HINTING);
// FIXME check for errors
FontRendererLoadFont(font->renderer, filename);
if (FontRendererLoadFont(font->renderer, filename)) {
free(font);
return NULL;
}
font->height = FontRendererGetFontHeight(font->renderer, size);
/* make tab and newline glyphs invisible */