[ruamoko] Handle missing fonts correctly

Carrying on as if the missing font had been loaded leads to way too many
issues for it to be a good thing (not that that really needs to be
said). Fixes the segfaults in my test scene.
This commit is contained in:
Bill Currie 2023-03-28 13:20:29 +09:00
parent 53ae2fe223
commit 25c51e8711

View file

@ -223,9 +223,13 @@ bi (Font_Load)
const char *font_path = P_GSTRING (pr, 0);
int font_size = P_INT (pr, 1);
R_INT (pr) = 0;
QFile *font_file = QFS_FOpenFile (font_path);
font_t *font = Font_Load (font_file, font_size);
if (font) {
R_INT (pr) = alloc_font (res, font);
}
}
bi (Passage_New)