-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Bindings to SDL2_ttf.
--   
--   Haskell bindings to SDL2_ttf C++ library
--   https://github.com/libsdl-org/SDL_ttf.
@package sdl2-ttf
@version 2.1.3

-- | Raw bindings to the SDL2_ttf library. No error-handling is
--   done here. For more information about specific function behaviour, see
--   the SDL2_ttf documentation.
module SDL.Raw.Font
init :: MonadIO m => m CInt
wasInit :: MonadIO m => m CInt
quit :: MonadIO m => m ()
getVersion :: MonadIO m => m (Ptr Version)

-- | The raw, underlying TTF_Font struct.
data Font

-- | A path to a font file.
type FontPath = CString

-- | Point size (based on 72DPI). Translates to pixel height.
type PointSize = CInt
openFont :: MonadIO m => FontPath -> PointSize -> m (Ptr Font)

-- | Should the Ptr RWops be freed after an operation? 1 for
--   yes, 0 for no.
type Free = CInt
openFont_RW :: MonadIO m => Ptr RWops -> Free -> PointSize -> m (Ptr Font)

-- | Indicates the font face we're loading. First face is always 0.
type Index = CLong
openFontIndex :: MonadIO m => FontPath -> PointSize -> Index -> m (Ptr Font)
openFontIndex_RW :: MonadIO m => Ptr RWops -> Free -> PointSize -> Index -> m (Ptr Font)
closeFont :: MonadIO m => Ptr Font -> m ()
getFontStyle :: MonadIO m => Ptr Font -> m CInt
setFontStyle :: MonadIO m => Ptr Font -> CInt -> m ()
pattern TTF_STYLE_NORMAL :: (Eq a, Num a) => a
pattern TTF_STYLE_BOLD :: (Eq a, Num a) => a
pattern TTF_STYLE_ITALIC :: (Eq a, Num a) => a
pattern TTF_STYLE_UNDERLINE :: (Eq a, Num a) => a
pattern TTF_STYLE_STRIKETHROUGH :: (Eq a, Num a) => a
getFontOutline :: MonadIO m => Ptr Font -> m CInt
setFontOutline :: MonadIO m => Ptr Font -> CInt -> m ()
getFontHinting :: MonadIO m => Ptr Font -> m CInt
setFontHinting :: MonadIO m => Ptr Font -> CInt -> m ()
pattern TTF_HINTING_NORMAL :: (Eq a, Num a) => a
pattern TTF_HINTING_LIGHT :: (Eq a, Num a) => a
pattern TTF_HINTING_MONO :: (Eq a, Num a) => a
pattern TTF_HINTING_NONE :: (Eq a, Num a) => a
getFontKerning :: MonadIO m => Ptr Font -> m CInt
setFontKerning :: MonadIO m => Ptr Font -> CInt -> m ()
fontHeight :: MonadIO m => Ptr Font -> m CInt
fontAscent :: MonadIO m => Ptr Font -> m CInt
fontDescent :: MonadIO m => Ptr Font -> m CInt
fontLineSkip :: MonadIO m => Ptr Font -> m CInt
fontFaces :: MonadIO m => Ptr Font -> m CLong
fontFaceIsFixedWidth :: MonadIO m => Ptr Font -> m CInt
fontFaceFamilyName :: MonadIO m => Ptr Font -> m CString
fontFaceStyleName :: MonadIO m => Ptr Font -> m CString
glyphIsProvided :: MonadIO m => Ptr Font -> CUShort -> m CInt
glyphMetrics :: MonadIO m => Ptr Font -> CUShort -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> m CInt
getFontKerningSize :: MonadIO m => Ptr Font -> CInt -> CInt -> m CInt
sizeText :: MonadIO m => Ptr Font -> CString -> Ptr CInt -> Ptr CInt -> m CInt
sizeUTF8 :: MonadIO m => Ptr Font -> CString -> Ptr CInt -> Ptr CInt -> m CInt
sizeUNICODE :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr CInt -> Ptr CInt -> m CInt
renderText_Solid :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface)
renderText_Shaded :: MonadIO m => Ptr Font -> CString -> Ptr Color -> Ptr Color -> m (Ptr Surface)
renderText_Blended :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface)
renderText_Blended_Wrapped :: MonadIO m => Ptr Font -> CString -> Ptr Color -> CUInt -> m (Ptr Surface)
renderUTF8_Solid :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface)
renderUTF8_Shaded :: MonadIO m => Ptr Font -> CString -> Ptr Color -> Ptr Color -> m (Ptr Surface)
renderUTF8_Blended :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface)
renderUTF8_Blended_Wrapped :: MonadIO m => Ptr Font -> CString -> Ptr Color -> CUInt -> m (Ptr Surface)
renderUNICODE_Solid :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> m (Ptr Surface)
renderUNICODE_Shaded :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> Ptr Color -> m (Ptr Surface)
renderUNICODE_Blended :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> m (Ptr Surface)
renderUNICODE_Blended_Wrapped :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> CUInt -> m (Ptr Surface)
renderGlyph_Solid :: MonadIO m => Ptr Font -> CUShort -> Ptr Color -> m (Ptr Surface)
renderGlyph_Shaded :: MonadIO m => Ptr Font -> CUShort -> Ptr Color -> Ptr Color -> m (Ptr Surface)
renderGlyph_Blended :: MonadIO m => Ptr Font -> CUShort -> Ptr Color -> m (Ptr Surface)
byteSwappedUNICODE :: MonadIO m => CInt -> m ()
pattern UNICODE_BOM_NATIVE :: (Eq a, Num a) => a
pattern UNICODE_BOM_SWAPPED :: (Eq a, Num a) => a

-- | Bindings to the SDL2_ttf library
--   http://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html which
--   itself is a wrapper around the FreeType library. The bindings should
--   allow you to load fonts and render Text in various styles to an
--   SDL Surface.
--   
--   You can safely assume that any monadic function listed here is capable
--   of throwing an SDLException in case it encounters an error.
module SDL.Font

-- | Initializes the library.
--   
--   Unless noted otherwise, this must be called before any other part of
--   the library is used.
--   
--   You may call this multiple times.
initialize :: MonadIO m => m ()

-- | Gets the major, minor, patch versions of the linked SDL2_ttf
--   library.
--   
--   You may call this without initializing the library with
--   initialize.
version :: (Integral a, MonadIO m) => m (a, a, a)

-- | Cleans up any resources still in use by the library.
--   
--   If called, you must call initialize again before using any
--   other parts of the library.
quit :: MonadIO m => m ()

-- | Represents a loaded font.
newtype Font
Font :: Ptr Font -> Font
[unwrap] :: Font -> Ptr Font

-- | Point size (based on 72DPI) to load font as. Translates to pixel
--   height.
type PointSize = Int

-- | Given a path to a font file, loads it for use as a Font at a
--   certain PointSize.
load :: MonadIO m => FilePath -> PointSize -> m Font

-- | Designates a font face, the default and first one being 0.
type Index = Int

-- | Given a path to a font file, loads one of its font faces (designated
--   by the given index) for use as a Font at a certain
--   PointSize.
--   
--   The first face is always index 0, and is the one chosen by default
--   when using load.
loadIndex :: MonadIO m => FilePath -> PointSize -> Index -> m Font

-- | Same as load, but accepts a ByteString containing a font
--   instead.
decode :: MonadIO m => ByteString -> PointSize -> m Font

-- | Same as loadIndex, but accepts a ByteString containing a
--   font instead.
decodeIndex :: MonadIO m => ByteString -> PointSize -> Index -> m Font

-- | Frees a loaded Font.
free :: MonadIO m => Font -> m ()

-- | Color as an RGBA byte vector.
type Color = V4 Word8

-- | Renders Text using the quick and dirty method.
--   
--   Is the fastest of the rendering methods, but results in text that
--   isn't as smooth.
solid :: MonadIO m => Font -> Color -> Text -> m Surface

-- | Uses the slow and nice, but with a solid box method.
--   
--   Renders slower than solid, but in about the same time as
--   blended.
--   
--   Results in a Surface containing antialiased text of a
--   foreground color surrounded by a box of a background color. This
--   Surface will blit as fast as the one from solid.
shaded :: MonadIO m => Font -> Color -> Color -> Text -> m Surface

-- | The slow slow slow, but ultra nice over another image method,
--   blended renders text at high quality.
--   
--   The text is antialiased and surrounded by a transparent box. Renders
--   slower than solid, but in about the same time as shaded.
--   
--   The resulting Surface will blit slower than the ones from
--   solid or shaded.
blended :: MonadIO m => Font -> Color -> Text -> m Surface

-- | Use this function to discover how wide and tall a Surface needs
--   to be in order to accommodate a given text when it is rendered.
--   
--   Note that no actual rendering takes place.
--   
--   The values returned are the width and height, respectively, in pixels.
--   The height returned is the same one returned by height.
size :: MonadIO m => Font -> Text -> m (Int, Int)

-- | Possible styles that can be applied to a Font.
data Style
Bold :: Style
Italic :: Style
Underline :: Style
Strikethrough :: Style

-- | Gets the rendering styles of a given Font.
--   
--   If none were ever set, this will be an empty list.
getStyle :: MonadIO m => Font -> m [Style]

-- | Sets the rendering style of a Font.
--   
--   Use an empty list to reset the style.
setStyle :: MonadIO m => Font -> [Style] -> m ()

-- | The size of the Font outline, in pixels.
--   
--   Use 0 to turn off outlining.
type Outline = Int

-- | Gets the current outline size of a given Font.
getOutline :: MonadIO m => Font -> m Outline

-- | Sets the outline size for a given Font.
--   
--   Use 0 to turn off outlining.
setOutline :: MonadIO m => Font -> Outline -> m ()

-- | The hinting setting of a Font.
data Hinting
Normal :: Hinting
Light :: Hinting
Mono :: Hinting
None :: Hinting

-- | Gets the hinting setting of a given Font.
getHinting :: MonadIO m => Font -> m Hinting

-- | Sets the hinting setting of a font.
setHinting :: MonadIO m => Font -> Hinting -> m ()

-- | Whether kerning is enabled or not.
--   
--   The default for a newly-loaded Font is enabled.
type Kerning = Bool

-- | Gets the current kerning setting of a given Font.
getKerning :: MonadIO m => Font -> m Kerning

-- | Sets the kerning setting for a given Font.
--   
--   Use False to turn off kerning.
setKerning :: MonadIO m => Font -> Kerning -> m ()

-- | Tests whether the current face of a Font is a fixed width font
--   or not.
isMonospace :: MonadIO m => Font -> m Bool

-- | Gets the current font face family name, if any.
familyName :: MonadIO m => Font -> m (Maybe Text)

-- | Gets the current font face style name, if any.
styleName :: MonadIO m => Font -> m (Maybe Text)

-- | Gets the maximum pixel height of all glyphs of a given Font.
height :: MonadIO m => Font -> m Int

-- | Gets the maximum pixel ascent of all glyphs of a given Font.
--   
--   This can be interpreted as the distance from the top of the font to
--   the baseline.
ascent :: MonadIO m => Font -> m Int

-- | Gets the maximum pixel descent of all glyphs of a given Font.
--   
--   Also interpreted as the distance from the baseline to the bottom of
--   the font.
descent :: MonadIO m => Font -> m Int

-- | Gets the recommended pixel height of a rendered line of text of a
--   given Font.
--   
--   This is usually larger than what height would return.
lineSkip :: MonadIO m => Font -> m Int

-- | From a given Font get the kerning size of two glyphs.
getKerningSize :: MonadIO m => Font -> Index -> Index -> m Int

-- | Does a Font provide a certain unicode character?
glyphProvided :: MonadIO m => Font -> Char -> m Bool

-- | Same as glyphProvided, but returns an index of the glyph for
--   the given character instead, if one is provided.
glyphIndex :: MonadIO m => Font -> Char -> m (Maybe Int)

-- | Get glyph metrics for a given unicode character. The values returned
--   are:
--   
--   
--   
- minimum x offset
--   
- maximum x offset
--   
- minimum y offset
--   
- maximum y offset
--   
- advance offset
--   
--   
--   You can see more information about these values in the original
--   SDL2_ttf documentation here.
glyphMetrics :: MonadIO m => Font -> Char -> m (Maybe (Int, Int, Int, Int, Int))

-- | Same as solid, but renders a single glyph instead.
solidGlyph :: MonadIO m => Font -> Color -> Char -> m Surface

-- | Same as shaded, but renders a single glyph instead.
shadedGlyph :: MonadIO m => Font -> Color -> Color -> Char -> m Surface

-- | Same as blended, but renders a single glyph instead.
blendedGlyph :: MonadIO m => Font -> Color -> Char -> m Surface

-- | Same as blended, but renders across multiple lines. Text is
--   wrapped to multiple lines on line endings and on word boundaries if it
--   extends beyond wrapLength in pixels.
blendedWrapped :: MonadIO m => Font -> Color -> Int -> Text -> m Surface
instance GHC.Internal.Enum.Bounded SDL.Font.Hinting
instance GHC.Internal.Enum.Bounded SDL.Font.Style
instance GHC.Internal.Enum.Enum SDL.Font.Hinting
instance GHC.Internal.Enum.Enum SDL.Font.Style
instance GHC.Classes.Eq SDL.Font.Font
instance GHC.Classes.Eq SDL.Font.Hinting
instance GHC.Classes.Eq SDL.Font.Style
instance GHC.Internal.Generics.Generic SDL.Font.Hinting
instance GHC.Internal.Generics.Generic SDL.Font.Style
instance GHC.Classes.Ord SDL.Font.Hinting
instance GHC.Classes.Ord SDL.Font.Style
instance GHC.Internal.Read.Read SDL.Font.Hinting
instance GHC.Internal.Read.Read SDL.Font.Style
instance GHC.Internal.Show.Show SDL.Font.Font
instance GHC.Internal.Show.Show SDL.Font.Hinting
instance GHC.Internal.Show.Show SDL.Font.Style
