~alcinnz/fontconfig-pure

614373ce2efd58cb374a592f258923de016754ef — Adrian Cochrane 2 years ago fcf1e37
Compile and test Init routines.
M Graphics/Text/Font/Choose/Config.hs => Graphics/Text/Font/Choose/Config.hs +1 -0
@@ 23,6 23,7 @@ type Config_ = Ptr Config'
configCreate :: IO Config
configCreate = newForeignPtr fcConfigDestroy =<< throwNull <$> fcConfigCreate
foreign import ccall "FcConfigCreate" fcConfigCreate :: IO Config_
ptr2config = newForeignPtr fcConfigDestroy
foreign import ccall "&FcConfigDestroy" fcConfigDestroy :: FunPtr (Config_ -> IO ())

configSetCurrent :: Config -> IO ()

M Graphics/Text/Font/Choose/Init.hs => Graphics/Text/Font/Choose/Init.hs +4 -2
@@ 5,8 5,10 @@ import Prelude hiding (init)

import Graphics.Text.Font.Choose.Config

foreign import ccall "FcInitLoadConfig" initLoadConfig :: IO Config
foreign import ccall "FcInitLoadConfigAndFonts" initLoadConfigAndFonts :: IO Config
initLoadConfig = fcInitLoadConfig >>= ptr2config
foreign import ccall "FcInitLoadConfig" fcInitLoadConfig :: IO Config_
initLoadConfigAndFonts = fcInitLoadConfigAndFonts >>= ptr2config
foreign import ccall "FcInitLoadConfigAndFonts" fcInitLoadConfigAndFonts :: IO Config_

foreign import ccall "FcInit" init :: IO Bool
foreign import ccall "FcFini" fini :: IO ()

M fontconfig-pure.cabal => fontconfig-pure.cabal +1 -1
@@ 56,7 56,7 @@ library
                Graphics.Text.Font.Choose.Strings, Graphics.Text.Font.Choose.Range,
                Graphics.Text.Font.Choose.LangSet, Graphics.Text.Font.Choose.Value,
                Graphics.Text.Font.Choose.Pattern, Graphics.Text.Font.Choose.FontSet,
                Graphics.Text.Font.Choose.Config
                Graphics.Text.Font.Choose.Config, Graphics.Text.Font.Choose.Init

  c-sources:    cbits/pattern.c