diff options
author | jao <jao@gnu.org> | 2015-05-04 19:14:59 +0200 |
---|---|---|
committer | jao <jao@gnu.org> | 2015-05-04 19:14:59 +0200 |
commit | 8dd06b986d25230edec260d68426b25a6284744d (patch) | |
tree | 5cf6fddec2636107c7b733ae43ddabcbf479de86 /src | |
parent | a8c4ca8133b7ab0852cb542a63dc219dbd207360 (diff) | |
parent | f182c43ceab950cea54a968af5d57470aadbec15 (diff) | |
download | xmobar-8dd06b986d25230edec260d68426b25a6284744d.tar.gz xmobar-8dd06b986d25230edec260d68426b25a6284744d.tar.bz2 |
Merge branch 'master' of https://github.com/ahgilbert/xmobar
Diffstat (limited to 'src')
-rw-r--r-- | src/XUtil.hsc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/XUtil.hsc b/src/XUtil.hsc index 9cb1def..e37d419 100644 --- a/src/XUtil.hsc +++ b/src/XUtil.hsc @@ -33,6 +33,7 @@ import Control.Concurrent import Control.Monad (when) import Control.Monad.Trans import Control.Exception (SomeException, handle) +import Data.List import Foreign import Graphics.X11.Xlib hiding (textExtents, textWidth) import qualified Graphics.X11.Xlib as Xlib (textExtents, textWidth) @@ -49,7 +50,6 @@ import qualified System.IO as UTF8 (readFile,hGetLine) # endif #endif #if defined XFT -import Data.List import MinXft import Graphics.X11.Xrender #endif @@ -81,12 +81,18 @@ data XFont = Core FontStruct -- to the Xft backend Example: 'xft:Sans-10' initFont :: Display ->String -> IO XFont initFont d s = -#ifdef XFT let xftPrefix = "xft:" in if xftPrefix `isPrefixOf` s then +#ifdef XFT fmap Xft $ initXftFont d s - else +#else + do + hPutStrLn stderr $ "Warning: Xmobar must be built with " + ++ "the with_xft flag to support font '" ++ s + ++ ".' Falling back on default." + initFont d miscFixedFont #endif + else #if defined UTF8 || __GLASGOW_HASKELL__ >= 612 fmap Utf8 $ initUtf8Font d s #else |