wumpus-microprint-0.5.0: Microprints - "greek-text" pictures.Source codeContentsIndex
Wumpus.MicroPrint
PortabilityGHC
Stabilityunstable
Maintainerstephen.tetley@gmail.com
Contents
Re-export all MicroPrint.Render
Top level rendering functions
Re-export some from MicroPrint.DrawMonad
Description
MicroPrints
Synopsis
type DrawWordF = (Int, Double) -> (Double, Double) -> RGBi -> DGraphicF
data MicroPrintConfig = MicroPrintConfig {
char_height :: Double
char_width :: Double
line_spacing :: Double
drawWordF :: DrawWordF
}
greekF :: DrawWordF
borderedF :: Double -> DrawWordF
drawMicroPrint :: MicroPrintConfig -> ([Tile], Height) -> Maybe DPicture
renderMicroPrint :: MicroPrintConfig -> MicroPrint a -> Maybe DPicture
renderMicroPrintU :: MicroPrintConfig -> MicroPrint a -> DPicture
data MicroPrint a
data Tile
= LineBreak
| Space Int
| Word RGBi Int
type Height = Int
linebreak :: MicroPrint ()
setRGB :: RGBi -> MicroPrint ()
char :: MicroPrint ()
space :: MicroPrint ()
Re-export all MicroPrint.Render
type DrawWordF = (Int, Double) -> (Double, Double) -> RGBi -> DGraphicFSource

DrawWordF : (num_chars, char_unit_width) * (full_width, full_height) -> rgb -> DGraphicF

The libraries currently provides two styles - greekF and borderedF.

data MicroPrintConfig Source
Style properties for micro-print drawing.
Constructors
MicroPrintConfig
char_height :: Double
char_width :: Double
line_spacing :: Double
drawWordF :: DrawWordF
show/hide Instances
greekF :: DrawWordFSource
Draw the word as a single coloured rectangle.
borderedF :: Double -> DrawWordFSource
Draw the word as a coloured rectangle, with a border grid.
drawMicroPrint :: MicroPrintConfig -> ([Tile], Height) -> Maybe DPictureSource
Top level rendering functions
renderMicroPrint :: MicroPrintConfig -> MicroPrint a -> Maybe DPictureSource

Build a picture from a MicroPrint.

This function returns Nothing if the picture is empty.

renderMicroPrintU :: MicroPrintConfig -> MicroPrint a -> DPictureSource

Build a picture from a MicroPrint - unsafe version.

This function throws a runtime error if the picture is empty.

Re-export some from MicroPrint.DrawMonad
data MicroPrint a Source

Build a microprint within a monad...

Drawings are made in a teletype fashion emitting a character, space or line-break at each step.

show/hide Instances
data Tile Source
Constructors
LineBreak
Space Int
Word RGBi Int
type Height = IntSource
linebreak :: MicroPrint ()Source
Emit a linebreak in the output.
setRGB :: RGBi -> MicroPrint ()Source

Change the current drawing colour.

Note - it is permissible to change colour mid-word, but this is the same as having a no-space break.

char :: MicroPrint ()Source
Draw a character - note in the microprint, characters will be concatenated together to make a word.
space :: MicroPrint ()Source
Draw a space.
Produced by Haddock version 2.6.1