hcg-minus-cairo-0.14: haskell cg (minus) (cairo rendering)

Safe HaskellNone

Render.CG.Minus

Contents

Description

CG (minus) rendering in terms of Render.

Synopsis

Paths

nil :: Render ()Source

Render nothing.

line :: Ls R -> Render ()Source

Render Ls as moveTo then sequence of lineTo.

polygon :: Ls R -> Render ()Source

Variant of line that runs closePath.

points :: R -> Ls R -> Render ()Source

Render Ls as set of square points with R dimension. Runs fill on each square.

circle :: Pt R -> R -> Render ()Source

Circle centred at Pt with radius R.

Context & drawing

grey :: R -> Render ()Source

Greyscale call to setSourceRGBA.

pen :: R -> Ca -> Render ()Source

Set line width R and Ca.

Composite

area :: R -> Ca -> Ca -> Ls R -> Render ()Source

Run polygon on Ls then fill and stroke.

area' :: Ca -> Ls R -> Render ()Source

Variant of area with fixed grey border of width 0.005 and grey 0.15.

outline :: R -> Ca -> Ls R -> Render ()Source

Run polygon on Ls then pen and stroke.

rect :: Ca -> Pt R -> (R, R) -> Render ()Source

Render rectangle given colour Ca, upper-left Pt and (width,height).

Text

text :: Ca -> Pt R -> R -> String -> Render ()Source

Render text String in colour Ca at Pt in font size sz.

Rendering

data File_Type Source

Enumeration of file types.

Constructors

F_PDF 
F_SVG 

render_to_file :: File_Type -> (R, R) -> FilePath -> Render () -> IO ()Source

Render to File_Type. (w,h) give the page size. The appropriate extension is appended to FilePath.