aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util/Font.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-11-16 13:42:11 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-11-16 13:42:11 +0100
commitfd183f2d7de96fe5561b84c826e05a3ac939dad1 (patch)
tree138d794a3997ce3654f766fdc534735eeeb67e10 /XMonad/Util/Font.hs
parentbbfb921860fdb7a5f6d0a2462ef1192d1525175f (diff)
downloadXMonadContrib-fd183f2d7de96fe5561b84c826e05a3ac939dad1.tar.gz
XMonadContrib-fd183f2d7de96fe5561b84c826e05a3ac939dad1.tar.xz
XMonadContrib-fd183f2d7de96fe5561b84c826e05a3ac939dad1.zip
Use Xft automatically if available
darcs-hash:20071116124211-a5988-2f871dda01cf247852787d9c0d30f85dba73b444.gz
Diffstat (limited to 'XMonad/Util/Font.hs')
-rw-r--r--XMonad/Util/Font.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/XMonad/Util/Font.hs b/XMonad/Util/Font.hs
index 53a83f7..12e7fa9 100644
--- a/XMonad/Util/Font.hs
+++ b/XMonad/Util/Font.hs
@@ -85,7 +85,7 @@ initXMF s =
do
dpy <- asks display
xftdraw <- io $ xftFontOpen dpy (defaultScreenOfDisplay dpy) (drop (length xftPrefix) s)
- return (Right xftdraw)
+ return (Xft xftdraw)
else
#endif
(initCoreFont s >>= (return . Core))
@@ -104,7 +104,7 @@ releaseXMF (Xft xftfont) = do
textWidthXMF :: Display -> XMonadFont -> String -> IO Int
textWidthXMF _ (Core fs) s = return $ fi $ textWidth fs s
#ifdef XFT
-textWidthXMF dpy (Right xftdraw) s = do
+textWidthXMF dpy (Xft xftdraw) s = do
gi <- xftTextExtents dpy xftdraw s
return $ xglyphinfo_width gi
#endif
@@ -112,7 +112,7 @@ textWidthXMF dpy (Right xftdraw) s = do
textExtentsXMF :: Display -> XMonadFont -> String -> IO (FontDirection,Int32,Int32,CharStruct)
textExtentsXMF _ (Core fs) s = return $ textExtents fs s
#ifdef XFT
-textExtentsXMF _ (Right xftfont) _ = do
+textExtentsXMF _ (Xft xftfont) _ = do
ascent <- xftfont_ascent xftfont
descent <- xftfont_descent xftfont
return (error "Font direction touched", fi ascent, fi descent, error "Font overall size touched")
@@ -146,7 +146,7 @@ printStringXMF d p (Core fs) gc fc bc x y s = do
io $ drawImageString d p gc x y s
#ifdef XFT
-printStringXMF dpy drw (Right font) _ fc _ x y s = do
+printStringXMF dpy drw (Xft font) _ fc _ x y s = do
let screen = defaultScreenOfDisplay dpy;
colormap = defaultColormapOfScreen screen;
visual = defaultVisualOfScreen screen;