Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Fonts
It includes default atlas management, font configuration and glyph ranges.
Synopsis
- newtype Font = Font (Ptr ImFont)
- newtype GlyphRanges = GlyphRanges (Ptr ImWchar)
- addFontDefault :: MonadIO m => m Font
- addFontFromFileTTF :: MonadIO m => CString -> CFloat -> FontConfig -> GlyphRanges -> m Font
- addFontFromMemoryTTF :: MonadIO m => CStringLen -> CFloat -> FontConfig -> GlyphRanges -> m Font
- pushFont :: MonadIO m => Font -> m ()
- popFont :: MonadIO m => m ()
- clearFontAtlas :: MonadIO m => m ()
- buildFontAtlas :: MonadIO m => m ()
Types
Adding fonts
Add the default font (ProggyClean.ttf
, 13 px) to the atlas.
:: MonadIO m | |
=> CString | Font file path |
-> CFloat | Font size in pixels |
-> FontConfig | Configuration data |
-> GlyphRanges | Glyph ranges to use |
-> m Font | Returns font handle for future usage |
Add a custom OTF/TTF font from a file.
addFontFromMemoryTTF :: MonadIO m => CStringLen -> CFloat -> FontConfig -> GlyphRanges -> m Font Source #
Transfer a buffer with TTF data to font atlas builder.
Using fonts
pushFont :: MonadIO m => Font -> m () Source #
Pushes a font into the parameters stack, so ImGui would render following text using it.
popFont :: MonadIO m => m () Source #
Pops a font pushed into the parameters stack
Should be called only after a corresponding pushFont
call.
Atlas management
clearFontAtlas :: MonadIO m => m () Source #
Clear all font atlas input and output data
buildFontAtlas :: MonadIO m => m () Source #
Explicitly build pixels data for the atlas.