From: gatecat Date: Mon, 3 Jan 2022 20:09:37 +0000 (+0000) Subject: xyagle: Fallback if fonts don't exist X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51f3572fee7fa240a3ba590e339cd04aa9939835;p=tas-yagle.git xyagle: Fallback if fonts don't exist Signed-off-by: gatecat --- diff --git a/distrib/sources/yagle/xyagle/XMX_color.c b/distrib/sources/yagle/xyagle/XMX_color.c index afda0a5..22aa31b 100644 --- a/distrib/sources/yagle/xyagle/XMX_color.c +++ b/distrib/sources/yagle/xyagle/XMX_color.c @@ -170,11 +170,14 @@ XyagInitializeGraphicContext() XyagLargeTextGC = XCreateGC(XyagGraphicDisplay, Root, (GCForeground|GCBackground|GCPlaneMask), &GraphicValue); - XSetFont(XyagGraphicDisplay, XyagSmallTextGC, XyagSmallTextFont->fid); + if (XyagSmallTextFont) + XSetFont(XyagGraphicDisplay, XyagSmallTextGC, XyagSmallTextFont->fid); - XSetFont(XyagGraphicDisplay, XyagMediumTextGC, XyagMediumTextFont->fid); + if (XyagMediumTextFont) + XSetFont(XyagGraphicDisplay, XyagMediumTextGC, XyagMediumTextFont->fid); - XSetFont(XyagGraphicDisplay, XyagLargeTextGC, XyagLargeTextFont->fid); + if (XyagLargeTextFont) + XSetFont(XyagGraphicDisplay, XyagLargeTextGC, XyagLargeTextFont->fid); GraphicValue.background = XyagColor[2]; /* Xor Color */ GraphicValue.foreground = XyagColor[2]; /* Xor Color */