Copyright | (c) 2018 Schell Scivally |
---|---|
License | MIT |
Maintainer | Schell Scivally <schell@takt.com> |
Safe Haskell | None |
Language | Haskell2010 |
A storage context an ops for rendering text with multiple fonts and sizes, hiding the details of the Atlas and WordCache.
Synopsis
- data RenderedText t m = RenderedText {
- drawRenderedText :: t -> m ()
- sizeOfRenderedText :: V2 Int
- data Font t = Font {
- fontAtlas :: Atlas
- fontWordCache :: WordCache t
- data TextRenderingData t = TextRenderingData {
- textRenderingDataAllocWord :: Atlas -> String -> IO (Either TypograffitiError (AllocatedRendering t))
- textRenderingDataFontMap :: Map (FilePath, GlyphSize) (Font t)
- textRenderingDataCharSet :: Set Char
- newtype FontStore t = FontStore {
- unFontStore :: TMVar (TextRenderingData t)
- getTextRendering :: (MonadIO m, MonadError TypograffitiError m, Layout t) => FontStore t -> FilePath -> GlyphSize -> String -> m (RenderedText t m)
- newDefaultFontStore :: (MonadIO m, MonadError TypograffitiError m, Integral i) => IO (V2 i) -> m (FontStore [TextTransform])
- allocFont :: (MonadIO m, MonadError TypograffitiError m, Layout t) => FontStore t -> FilePath -> GlyphSize -> m (Font t)
Documentation
data RenderedText t m Source #
A pre-rendered bit of text, ready to display given some post compilition transformations. Also contains the text size.
RenderedText | |
|
data TextRenderingData t Source #
TextRenderingData | |
|
Stored fonts at specific sizes.
:: (MonadIO m, MonadError TypograffitiError m, Layout t) | |
=> FontStore t | The font store. |
-> FilePath | The path to the font to use for rendering. |
-> GlyphSize | The size of the font glyphs. |
-> String | The string to render. |
-> m (RenderedText t m) | The rendered text, ready to draw to the screen. |
newDefaultFontStore :: (MonadIO m, MonadError TypograffitiError m, Integral i) => IO (V2 i) -> m (FontStore [TextTransform]) Source #