{-# LINE 1 "FreeType/Core/Glyph.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE PatternSynonyms #-}
module FreeType.Core.Glyph
(
FT_Glyph
, FT_GlyphRec (..)
, FT_BitmapGlyph
, FT_BitmapGlyphRec (..)
, FT_OutlineGlyph
, FT_OutlineGlyphRec (..)
, ft_New_Glyph
, ft_With_Glyph
, ft_Get_Glyph
, ft_Glyph_Copy
, ft_Glyph_Transform
, pattern FT_GLYPH_BBOX_UNSCALED
, pattern FT_GLYPH_BBOX_SUBPIXELS
, pattern FT_GLYPH_BBOX_GRIDFIT
, pattern FT_GLYPH_BBOX_TRUNCATE
, pattern FT_GLYPH_BBOX_PIXELS
, ft_Glyph_Get_CBox
, ft_Glyph_To_Bitmap
, ft_Done_Glyph
) where
import FreeType.Core.Base.Types
import FreeType.Core.Glyph.Internal
import FreeType.Core.Glyph.Types
import FreeType.Core.Types.Types
import FreeType.Exception.Internal
import Control.Exception
import Data.Bool (bool)
import Foreign.Marshal.Alloc
import Foreign.Marshal.Utils
import Foreign.Ptr
import Foreign.Storable
ft_New_Glyph
:: FT_Library
-> FT_Glyph_Format
-> IO FT_Glyph
ft_New_Glyph =
autoAllocaError "ft_New_Glyph" ft_New_Glyph'
ft_With_Glyph
:: FT_Library
-> FT_Glyph_Format
-> (FT_Glyph -> IO a)
-> IO a
ft_With_Glyph lib format = bracket (ft_New_Glyph lib format) ft_Done_Glyph
ft_Get_Glyph
:: FT_GlyphSlot
-> IO FT_Glyph
ft_Get_Glyph =
autoAllocaError "ft_Get_Glyph" ft_Get_Glyph'
ft_Glyph_Copy
:: FT_Glyph
-> Ptr FT_Glyph
-> IO ()
ft_Glyph_Copy glyph =
ftError "ft_Glyph_Copy" . ft_Glyph_Copy' glyph
ft_Glyph_Transform
:: FT_Glyph
-> FT_Matrix
-> FT_Vector
-> IO ()
ft_Glyph_Transform glyph mat vec =
with mat $ \matPtr ->
with vec $ \vecPtr ->
ftError "ft_Glyph_Transform" $ ft_Glyph_Transform' glyph matPtr vecPtr
pattern FT_GLYPH_BBOX_UNSCALED
, FT_GLYPH_BBOX_SUBPIXELS
, FT_GLYPH_BBOX_GRIDFIT
, FT_GLYPH_BBOX_TRUNCATE
, FT_GLYPH_BBOX_PIXELS
:: (Eq a, Num a) => a
pattern FT_GLYPH_BBOX_UNSCALED = 0
{-# LINE 119 "FreeType/Core/Glyph.hsc" #-}
pattern FT_GLYPH_BBOX_SUBPIXELS = 0
{-# LINE 120 "FreeType/Core/Glyph.hsc" #-}
pattern FT_GLYPH_BBOX_GRIDFIT = 1
{-# LINE 121 "FreeType/Core/Glyph.hsc" #-}
pattern FT_GLYPH_BBOX_TRUNCATE = 2
{-# LINE 122 "FreeType/Core/Glyph.hsc" #-}
pattern FT_GLYPH_BBOX_PIXELS = 3
{-# LINE 123 "FreeType/Core/Glyph.hsc" #-}
ft_Glyph_Get_CBox
:: FT_Glyph
-> FT_UInt
-> IO FT_BBox
ft_Glyph_Get_CBox glyph bbox_mode =
alloca $ \ptr -> do
ft_Glyph_Get_CBox' glyph bbox_mode ptr
peek ptr
ft_Glyph_To_Bitmap
:: Ptr FT_Glyph
-> FT_Render_Mode
-> Ptr FT_Vector
-> Bool
-> IO ()
ft_Glyph_To_Bitmap glyph mode origin destroy =
ftError "ft_Glyph_To_Bitmap"
. ft_Glyph_To_Bitmap' glyph mode origin $ bool 0 1 destroy
foreign import ccall "FT_Done_Glyph"
ft_Done_Glyph
:: FT_Glyph
-> IO ()