xyagle: Fallback if fonts don't exist
authorgatecat <gatecat@ds0.me>
Mon, 3 Jan 2022 20:09:37 +0000 (20:09 +0000)
committergatecat <gatecat@ds0.me>
Mon, 3 Jan 2022 20:09:46 +0000 (20:09 +0000)
Signed-off-by: gatecat <gatecat@ds0.me>
distrib/sources/yagle/xyagle/XMX_color.c

index afda0a53de59a54770111a07f390b17b7f784be2..22aa31b1bd3ff595cb6413c43628037ab0a7c364 100644 (file)
@@ -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 */