sdl2-ttf-2.1.3: Bindings to SDL2_ttf.

Copyright | (c) 2015 Siniša Biđin
License | MIT
Stability | experimental
Safe Haskell | None
Language | Haskell2010

SDL.Raw.Font

Contents

- General
- Loading fonts
- Font attributes
- Getting text size
- Rendering text
- Other

Description

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.

Synopsis

- init :: MonadIO m => m CInt
- wasInit :: MonadIO m => m CInt
- quit :: MonadIO m => m ()
- getVersion :: MonadIO m => m (Ptr Version)
- data Font
- type FontPath = CString
- type PointSize = CInt
- openFont :: MonadIO m => FontPath -> PointSize -> m (Ptr Font)
- type Free = CInt
- openFont_RW :: MonadIO m => Ptr RWops -> Free -> PointSize -> m (Ptr Font)
- 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

# General

init :: MonadIO m => m CInt Source #

wasInit :: MonadIO m => m CInt Source #

quit :: MonadIO m => m () Source #

getVersion :: MonadIO m => m (Ptr Version) Source #

# Loading fonts

data Font Source #

The raw, underlying `TTF_Font` struct.

type FontPath = CString Source #

A path to a font file.

type PointSize = CInt Source #

Point size (based on 72DPI). Translates to pixel height.

openFont :: MonadIO m => FontPath -> PointSize -> m (Ptr Font) Source #

type Free = CInt Source #

Should the `Ptr` `RWops` be freed after an operation? 1 for yes, 0 for no.

openFont_RW :: MonadIO m => Ptr RWops -> Free -> PointSize -> m (Ptr Font) Source #

type Index = CLong Source #

Indicates the font face we're loading. First face is always 0.

openFontIndex :: MonadIO m => FontPath -> PointSize -> Index -> m (Ptr Font) Source #

openFontIndex_RW :: MonadIO m => Ptr RWops -> Free -> PointSize -> Index -> m (Ptr Font) Source #

closeFont :: MonadIO m => Ptr Font -> m () Source #

# Font attributes

getFontStyle :: MonadIO m => Ptr Font -> m CInt Source #

setFontStyle :: MonadIO m => Ptr Font -> CInt -> m () Source #

pattern TTF_STYLE_NORMAL :: (Eq a, Num a) => a Source #

pattern TTF_STYLE_BOLD :: (Eq a, Num a) => a Source #

pattern TTF_STYLE_ITALIC :: (Eq a, Num a) => a Source #

pattern TTF_STYLE_UNDERLINE :: (Eq a, Num a) => a Source #

pattern TTF_STYLE_STRIKETHROUGH :: (Eq a, Num a) => a Source #

getFontOutline :: MonadIO m => Ptr Font -> m CInt Source #

setFontOutline :: MonadIO m => Ptr Font -> CInt -> m () Source #

getFontHinting :: MonadIO m => Ptr Font -> m CInt Source #

setFontHinting :: MonadIO m => Ptr Font -> CInt -> m () Source #

pattern TTF_HINTING_NORMAL :: (Eq a, Num a) => a Source #

pattern TTF_HINTING_LIGHT :: (Eq a, Num a) => a Source #

pattern TTF_HINTING_MONO :: (Eq a, Num a) => a Source #

pattern TTF_HINTING_NONE :: (Eq a, Num a) => a Source #

getFontKerning :: MonadIO m => Ptr Font -> m CInt Source #

setFontKerning :: MonadIO m => Ptr Font -> CInt -> m () Source #

fontHeight :: MonadIO m => Ptr Font -> m CInt Source #

fontAscent :: MonadIO m => Ptr Font -> m CInt Source #

fontDescent :: MonadIO m => Ptr Font -> m CInt Source #

fontLineSkip :: MonadIO m => Ptr Font -> m CInt Source #

fontFaces :: MonadIO m => Ptr Font -> m CLong Source #

fontFaceIsFixedWidth :: MonadIO m => Ptr Font -> m CInt Source #

fontFaceFamilyName :: MonadIO m => Ptr Font -> m CString Source #

fontFaceStyleName :: MonadIO m => Ptr Font -> m CString Source #

glyphIsProvided :: MonadIO m => Ptr Font -> CUShort -> m CInt Source #

glyphMetrics :: MonadIO m => Ptr Font -> CUShort -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> m CInt Source #

getFontKerningSize :: MonadIO m => Ptr Font -> CInt -> CInt -> m CInt Source #

# Getting text size

sizeText :: MonadIO m => Ptr Font -> CString -> Ptr CInt -> Ptr CInt -> m CInt Source #

sizeUTF8 :: MonadIO m => Ptr Font -> CString -> Ptr CInt -> Ptr CInt -> m CInt Source #

sizeUNICODE :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr CInt -> Ptr CInt -> m CInt Source #

# Rendering text

renderText_Solid :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface) Source #

renderText_Shaded :: MonadIO m => Ptr Font -> CString -> Ptr Color -> Ptr Color -> m (Ptr Surface) Source #

renderText_Blended :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface) Source #

renderText_Blended_Wrapped :: MonadIO m => Ptr Font -> CString -> Ptr Color -> CUInt -> m (Ptr Surface) Source #

renderUTF8_Solid :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface) Source #

renderUTF8_Shaded :: MonadIO m => Ptr Font -> CString -> Ptr Color -> Ptr Color -> m (Ptr Surface) Source #

renderUTF8_Blended :: MonadIO m => Ptr Font -> CString -> Ptr Color -> m (Ptr Surface) Source #

renderUTF8_Blended_Wrapped :: MonadIO m => Ptr Font -> CString -> Ptr Color -> CUInt -> m (Ptr Surface) Source #

renderUNICODE_Solid :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> m (Ptr Surface) Source #

renderUNICODE_Shaded :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> Ptr Color -> m (Ptr Surface) Source #

renderUNICODE_Blended :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> m (Ptr Surface) Source #

renderUNICODE_Blended_Wrapped :: MonadIO m => Ptr Font -> Ptr CUShort -> Ptr Color -> CUInt -> m (Ptr Surface) Source #

renderGlyph_Solid :: MonadIO m => Ptr Font -> CUShort -> Ptr Color -> m (Ptr Surface) Source #

renderGlyph_Shaded :: MonadIO m => Ptr Font -> CUShort -> Ptr Color -> Ptr Color -> m (Ptr Surface) Source #

renderGlyph_Blended :: MonadIO m => Ptr Font -> CUShort -> Ptr Color -> m (Ptr Surface) Source #

# Other

byteSwappedUNICODE :: MonadIO m => CInt -> m () Source #

pattern UNICODE_BOM_NATIVE :: (Eq a, Num a) => a Source #

pattern UNICODE_BOM_SWAPPED :: (Eq a, Num a) => a Source #