{-# LINE 1 "FreeType/Format/BDF.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE PatternSynonyms #-}
module FreeType.Format.BDF
(
BDF_PropertyType
, pattern BDF_PROPERTY_TYPE_NONE
, pattern BDF_PROPERTY_TYPE_ATOM
, pattern BDF_PROPERTY_TYPE_INTEGER
, pattern BDF_PROPERTY_TYPE_CARDINAL
, BDF_Property
, BDF_PropertyRec (..)
, ft_Get_BDF_Charset_ID
, ft_Get_BDF_Property
) where
import FreeType.Core.Base.Types
import FreeType.Exception.Internal
import FreeType.Format.BDF.Internal
import FreeType.Format.BDF.Types
import Foreign.C.String
import Foreign.Marshal.Alloc
import Foreign.Ptr
import Foreign.Storable
ft_Get_BDF_Charset_ID
:: FT_Face
-> IO (String, String)
ft_Get_BDF_Charset_ID face =
alloca $ \encodingPtr ->
alloca $ \registryPtr -> do
ftError "ft_Get_BDF_Charset_ID"
$ ft_Get_BDF_Charset_ID' face encodingPtr registryPtr
(,)
<$> (peekCString . castPtr =<< peek encodingPtr)
<*> (peekCString . castPtr =<< peek registryPtr)
ft_Get_BDF_Property
:: FT_Face
-> String
-> IO BDF_PropertyRec
ft_Get_BDF_Property face name =
withCString name $ \namePtr ->
alloca $ \propPtr -> do
ftError "ft_Get_BDF_Property"
$ ft_Get_BDF_Property' face (castPtr namePtr) propPtr
peek propPtr