Check for errors when loading fonts
This commit is contained in:
parent
b734390388
commit
c2949edcd7
|
@ -160,8 +160,10 @@ RenFont* ren_load_font(const char *filename, float size) {
|
||||||
font->size = size;
|
font->size = size;
|
||||||
|
|
||||||
font->renderer = FontRendererNew(FONT_RENDERER_HINTING);
|
font->renderer = FontRendererNew(FONT_RENDERER_HINTING);
|
||||||
// FIXME check for errors
|
if (FontRendererLoadFont(font->renderer, filename)) {
|
||||||
FontRendererLoadFont(font->renderer, filename);
|
free(font);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
font->height = FontRendererGetFontHeight(font->renderer, size);
|
font->height = FontRendererGetFontHeight(font->renderer, size);
|
||||||
|
|
||||||
/* make tab and newline glyphs invisible */
|
/* make tab and newline glyphs invisible */
|
||||||
|
|
Loading…
Reference in New Issue