diagrams-cairo-0.5: Cairo backend for diagrams drawing EDSL

Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellSafe-Infered

Diagrams.Backend.Cairo

Contents

Description

A full-featured rendering backend for diagrams using the cairo rendering engine.

Synopsis

Cairo-supported output formats

data OutputType Source

Output types supported by cairo, including four different file types (PNG, PS, PDF, SVG) as well as Gtk windows.

Constructors

forall dw . DrawableClass dw => GTK

Output directly to a Gtk window. See Diagrams.Backends.Cairo.Gtk.

Fields

gtkWindow :: dw

The window on which to draw.

gtkBypass :: Bool

Should the adjustDia step be bypassed during rendering?

PNG

Portable Network Graphics output.

PS

PostScript output

PDF

Portable Document Format output.

SVG

Scalable Vector Graphics output.

Cairo-specific options

Unfortunately, Haddock does not yet support documentation for associated data families, so we must just provide it manually. This module defines

 data family Options Cairo R2 = CairoOptions
           { cairoFileName   :: String     -- ^ The name of the file you want generated
           , cairoSizeSpec   :: SizeSpec2D -- ^ The requested size of the output
           , cairoOutputType :: OutputType -- ^ the output format and associated options
           }

So, for example, you could call the renderDia function (from Graphics.Rendering.Diagrams.Core) like this:

 renderDia Cairo (CairoOptions "foo.png" (Width 250) PNG) myDiagram

Important note: a bug in GHC 7.0.x prevents re-exporting this data family. To bring CairoOptions into scope when using GHC 7.0.x you must import Diagrams.Backend.Cairo.Internal.

Backend token

data Cairo Source

This data declaration is simply used as a token to distinguish this rendering engine.

Constructors

Cairo