~alcinnz/fontconfig-pure

a327c852daa751de8d395ea1412b26ec6ff89a0f — Adrian Cochrane 2 years ago 2665872
Fix linking issues, still has issues decoding patterns.
M Graphics/Text/Font/Choose/Pattern.hs => Graphics/Text/Font/Choose/Pattern.hs +1 -1
@@ 86,7 86,7 @@ withPattern pat cb = withNewPattern $ \pat' -> do
            (fcPatternAdd_ pat' obj' (strength == Strong) True)
    cb pat'
-- Does Haskell FFI support unboxed structs? Do I really need to write a C wrapper?
foreign import ccall "my_FCPatternAdd" fcPatternAdd_ ::
foreign import ccall "my_FcPatternAdd" fcPatternAdd_ ::
    Pattern_ -> CString -> Bool -> Bool -> Value_ -> IO Bool

patternAsPointer :: Pattern -> IO Pattern_

M Graphics/Text/Font/Choose/Value.hs => Graphics/Text/Font/Choose/Value.hs +1 -1
@@ 38,7 38,7 @@ instance Hashable Value

type Value_ = Ptr Int

foreign import ccall "sizeof_Value" value'Size :: Int
foreign import ccall "size_value" value'Size :: Int
pokeUnion ptr x = castPtr (ptr `advancePtr` 1) `poke` x

withValue :: Value -> (Value_ -> IO a) -> IO a

M Main.hs => Main.hs +14 -1
@@ 1,4 1,17 @@
{-# LANGUAGE PackageImports #-}
module Main where

import "fontconfig-pure" Graphics.Text.Font.Choose as Font

import System.Environment (getArgs)

main :: IO ()
main = putStrLn "Hello, Haskell!"
main = do
    print "a"
    args <- getArgs
    print "b"
    let query = nameParse $ case args of {
        [] -> "serif";
        words -> unwords words}
    print "c"
    print query

M fontconfig-pure.cabal => fontconfig-pure.cabal +1 -1
@@ 92,7 92,7 @@ executable fontconfig-pure
  -- other-extensions:

  -- Other library packages from which modules are imported.
  build-depends:       base >=4.12 && <4.13
  build-depends:       base >=4.12 && <4.13, fontconfig-pure

  -- Directories containing source files.
  -- hs-source-dirs: