| Copyright | (c) 2013 Diagrams team (see LICENSE) |
|---|---|
| License | BSD-style (see LICENSE) |
| Maintainer | diagrams-discuss@googlegroups.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Diagrams.Backend.Postscript
Description
A Postscript rendering backend for diagrams.
To build diagrams for Postscript rendering use the Postscript
type in the diagram type construction
d :: Diagram Postscript R2 d = ...
and render giving the Postscript token
renderDia Postscript (PostscriptOptions "file.eps" (Width 400) EPS) d
This IO action will write the specified file.
- data Postscript = Postscript
- type B = Postscript
- data family Options b v
- psfileName :: Lens' (Options Postscript R2) String
- psSizeSpec :: Lens' (Options Postscript R2) SizeSpec2D
- psOutputFormat :: Lens' (Options Postscript R2) OutputFormat
- data OutputFormat = EPS
- renderDias :: (Semigroup m, Monoid m) => Options Postscript R2 -> [QDiagram Postscript R2 m] -> IO [()]
Backend token
data Postscript Source
This data declaration is simply used as a token to distinguish this rendering engine.
Constructors
| Postscript |
Instances
| Eq Postscript | |
| Ord Postscript | |
| Read Postscript | |
| Show Postscript | |
| Typeable * Postscript | |
| Renderable Text Postscript | |
| Backend Postscript R2 | |
| Mainable [(String, Diagram Postscript R2)] | |
| Mainable [Diagram Postscript R2] | |
| Renderable (Trail R2) Postscript | |
| Renderable (Path R2) Postscript | |
| Show (Options Postscript R2) | |
| Monoid (Render Postscript R2) | |
| Hashable (Options Postscript R2) | |
| Mainable (Diagram Postscript R2) | |
| Mainable (Animation Postscript R2) | |
| Renderable (Segment Closed R2) Postscript | |
| type Result Postscript R2 = IO () | |
| data Render Postscript R2 = C (Render ()) | |
data Options Postscript R2 = PostscriptOptions {
| |
| type MainOpts [(String, Diagram Postscript R2)] = (DiagramOpts, DiagramMultiOpts) | |
| type MainOpts [Diagram Postscript R2] = DiagramOpts | |
| type MainOpts (Diagram Postscript R2) = DiagramOpts | |
| type MainOpts (Animation Postscript R2) = (DiagramOpts, DiagramAnimOpts) |
type B = Postscript Source
Postscript-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 Postscript R2 = PostscriptOptions
{ psfileName :: String -- ^ the name of the file you want generated
, psSizeSpec :: SizeSpec2D -- ^ the requested size of the output
, psOutputFormat :: OutputFormat -- ^ the output format and associated options
}data family Options b v
Instances
| Show (Options Postscript R2) | |
| Hashable (Options Postscript R2) | |
| data Options NullBackend | |
data Options Postscript R2 = PostscriptOptions {
|
psfileName :: Lens' (Options Postscript R2) String Source
psSizeSpec :: Lens' (Options Postscript R2) SizeSpec2D Source
Postscript-supported output formats
data OutputFormat Source
Postscript only supports EPS style output at the moment. Future formats would each have their own associated properties that affect the output.
Constructors
| EPS | Encapsulated Postscript output. |
renderDias :: (Semigroup m, Monoid m) => Options Postscript R2 -> [QDiagram Postscript R2 m] -> IO [()] Source