wumpus-basic-0.18.0: Basic objects and system code built on Wumpus-Core.

Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>




Font load monad handling IO (file system access), failure and logging.



promoteIO :: IO a -> FontLoadIO aSource

Promote an IO action into the the FontLoadIO monad.

This function is equivalent to liftIO.

sequenceAll :: [FontLoadIO a] -> FontLoadIO [a]Source

The standard monadic sequence would finish on first fail for the FontLoadIO monad. As we want to be able to sequence the loading of a list of fonts, this is not really the behaviour we want for Wumpus. Instead we prefer to use fallback metrics and produce an inaccurate drawing on a font load error rather than fail and produce no drawing.

Font loading

buildAfmFontProps :: MonospaceDefaults AfmUnit -> AfmFile -> FontLoadIO (FontProps AfmUnit)Source

Afm files do not have a default advance vec so use the monospace default.

Afm files hopefully have CapHeight and FontBBox properties in the header. Use the monospace default only if they are missing.