From e09b645052245e8bfc1db29d80ef1d20575dc2a7 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Fri, 10 Aug 2007 20:24:33 +0200 Subject: Decoration: don't crash when given a non-existent font darcs-hash:20070810182433-32816-4cd3499d70822947cbe622bf632a93a5ab2c6c72.gz --- Decoration.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Decoration.hs') diff --git a/Decoration.hs b/Decoration.hs index 424021c..1b971ef 100644 --- a/Decoration.hs +++ b/Decoration.hs @@ -66,7 +66,8 @@ withGC w fn f = withDisplay $ \d -> do gc <- io $ createGC d w let fontname = if fn == "" then "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" else fn - font <- io $ loadQueryFont d fontname + font <- io $ catch (loadQueryFont d fontname) + (const $ loadQueryFont d "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*") io $ setFont d gc (fontFromFontStruct font) f d w gc font io $ freeGC d gc -- cgit v1.2.3