dtappbuilder: apply graceful degradation for font loading to avoid a

segmentation fault.
This commit is contained in:
Liang Chang 2021-02-08 05:47:05 +08:00
parent 7b2aae0911
commit bb0b2838a5
1 changed files with 7 additions and 5 deletions

View File

@ -1881,12 +1881,14 @@ setup_vwr_graphics(
GCForeground|GCBackground|GCGraphicsExposures|GCLineWidth, &gcvalues);
}
if (!ui_handle->sm_font)
{
if (!ui_handle->sm_font)
ui_handle->sm_font = (XFontStruct *)XLoadQueryFont(dpy, sm_font_name);
XSetFont(dpy, ui_handle->normal_gc, ui_handle->sm_font->fid);
XSetFont(dpy, ui_handle->select_gc, ui_handle->sm_font->fid);
}
if (!ui_handle->sm_font)
ui_handle->sm_font = (XFontStruct *)XLoadQueryFont(dpy, XmDEFAULT_FONT);
XSetFont(dpy, ui_handle->normal_gc, ui_handle->sm_font->fid);
XSetFont(dpy, ui_handle->select_gc, ui_handle->sm_font->fid);
}
/*