Maintainer | diagrams-discuss@googlegroups.com |
---|---|
Safe Haskell | Safe-Infered |
A full-featured rendering backend for diagrams using the cairo rendering engine.
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.
forall dw . DrawableClass dw => GTK | Output directly to a Gtk window. See Diagrams.Backends.Cairo.Gtk. |
PNG | Portable Network Graphics output. |
PS | PostScript output |
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
This data declaration is simply used as a token to distinguish this rendering engine.