add check for missing fonts

This commit is contained in:
Dagen Brock 2018-07-27 14:06:33 -05:00
parent dca0a68abb
commit 7d82873478

View File

@ -15,6 +15,7 @@
#include <X11/keysym.h> #include <X11/keysym.h>
#include <time.h> #include <time.h>
#include <stdlib.h> #include <stdlib.h>
#include <glog.h>
#include <signal.h> #include <signal.h>
#ifdef X_SHARED_MEM #ifdef X_SHARED_MEM
@ -596,6 +597,10 @@ dev_video_init()
} }
fflush(stdout); fflush(stdout);
g_text_FontSt = XLoadQueryFont(g_display, FONT_NAME_STATUS); g_text_FontSt = XLoadQueryFont(g_display, FONT_NAME_STATUS);
if (g_text_FontSt == NULL) {
glog("Could not load font, possibly missing xorg-x11-fonts-misc");
exit(1);
}
vid_printf("font # returned: %08x\n", (word32)(g_text_FontSt->fid)); vid_printf("font # returned: %08x\n", (word32)(g_text_FontSt->fid));
font_height = g_text_FontSt->ascent + g_text_FontSt->descent; font_height = g_text_FontSt->ascent + g_text_FontSt->descent;
vid_printf("font_height: %d\n", font_height); vid_printf("font_height: %d\n", font_height);