diagrams-postscript 1.5.2 → 1.5.3
raw patch · 4 files changed
+42/−20 lines, 4 filesdep ~containersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: containers
API changes (from Hackage documentation)
+ Diagrams.Backend.Postscript: renderDia' :: QDiagram Postscript V2 Double Any -> Options Postscript V2 Double -> IO ()
+ Diagrams.Backend.Postscript: renderDias' :: [QDiagram Postscript V2 Double Any] -> Options Postscript V2 Double -> IO ()
- Diagrams.Backend.Postscript.CMYK: styleFillColorCMYK :: Setter' (Style v Double) CMYK
+ Diagrams.Backend.Postscript.CMYK: styleFillColorCMYK :: forall (v :: Type -> Type) f. Settable f => (CMYK -> f CMYK) -> Style v Double -> f (Style v Double)
- Diagrams.Backend.Postscript.CMYK: styleLineColorCMYK :: Setter' (Style v Double) CMYK
+ Diagrams.Backend.Postscript.CMYK: styleLineColorCMYK :: forall (v :: Type -> Type) f. Settable f => (CMYK -> f CMYK) -> Style v Double -> f (Style v Double)
Files
- CHANGES.markdown +13/−0
- diagrams-postscript.cabal +6/−6
- src/Diagrams/Backend/Postscript.hs +23/−3
- src/Diagrams/Backend/Postscript/CmdLine.hs +0/−11
CHANGES.markdown view
@@ -1,3 +1,16 @@+## [1.5.3](https://github.com/diagrams/diagrams-postscript/tree/v1.5.3) (2025-08-13)++ - Export new functions `renderDia'` and `renderDias'`+ - Improve package documentation++## [1.5.2-r2](https://github.com/diagrams/diagrams-postscript/tree/v1.5.2-r2) (2025-06-02)++ - allow `monoid-extras-0.7`++## [1.5.2-r1](https://github.com/diagrams/diagrams-postscript/tree/v1.5.2-r1) (2025-03-28)++ - allow `base-4.21`, `diagrams-lib-1.5`, and test on GHC 9.12+ ## [1.5.2](https://github.com/diagrams/diagrams-postscript/tree/v1.5.2) (2024-10-31) - Require `data-default-0.8`
diagrams-postscript.cabal view
@@ -1,5 +1,5 @@ Name: diagrams-postscript-Version: 1.5.2+Version: 1.5.3 Synopsis: Postscript backend for diagrams drawing EDSL Description: This package provides a modular backend for rendering diagrams created with the diagrams EDSL using Postscript.@@ -24,7 +24,7 @@ Build-type: Simple extra-doc-files: README.markdown, CHANGES.markdown Cabal-version: 1.18-Tested-with: GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1+Tested-with: GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1 || ==9.12.1 Source-repository head type: git location: https://github.com/diagrams/diagrams-postscript.git@@ -35,18 +35,18 @@ Diagrams.Backend.Postscript.CmdLine Graphics.Rendering.Postscript Hs-source-dirs: src- Build-depends: base >= 4.8 && < 4.21,+ Build-depends: base >= 4.8 && < 4.22, bytestring >= 0.9 && <0.13, mtl >= 2.0 && < 2.4, diagrams-core >= 1.3 && < 1.6,- diagrams-lib >= 1.4.5 && < 1.5,+ diagrams-lib >= 1.4.5 && < 1.6, data-default >= 0.8 && < 0.9, statestack >= 0.2 && < 0.4, split >= 0.1.2 && < 0.3,- monoid-extras >= 0.3 && < 0.7,+ monoid-extras >= 0.3 && < 0.8, semigroups >= 0.3.4 && < 0.21, lens >= 4.0 && < 5.4,- containers >= 0.3 && < 0.8,+ containers >= 0.3 && < 0.9, hashable >= 1.1 && < 1.6 default-language: Haskell2010
src/Diagrams/Backend/Postscript.hs view
@@ -24,14 +24,17 @@ -- type in the diagram type construction -- -- > d :: Diagram Postscript--- > d = ...+-- > d = square 10 -- -- and render giving the @Postscript@ token ----- > renderDia Postscript (PostscriptOptions "file.eps" (Width 400) EPS) d+-- > renderDia' d (PostscriptOptions "file.eps" (mkWidth 400) EPS) ----- This IO action will write the specified file.+-- This IO action will write the specified file. If you prefer to generate+-- an in-memory 'ByteString', use 'renderDia'. --+-- Check "Diagrams.Backend.Postscript.CmdLine" for the command-line+-- interface documentation (a great way to start using this package). ----------------------------------------------------------------------------- module Diagrams.Backend.Postscript @@ -40,14 +43,18 @@ , B -- * Postscript-specific options+ -- | #postscript-options# -- $PostscriptOptions , Options(..), psfileName, psSizeSpec, psOutputFormat -- * Postscript-supported output formats+ , OutputFormat(..) , renderDias+ , renderDia'+ , renderDias' ) where import Diagrams.Backend.Postscript.CMYK@@ -67,6 +74,7 @@ import Data.Maybe (catMaybes, isJust) import qualified Data.ByteString.Builder as B+import System.IO (IOMode (..), withFile) import qualified Data.Foldable as F import Data.Hashable (Hashable (..))@@ -200,6 +208,18 @@ rs = map (runRenderM . runC . toRender . toRTree g2o . snd) optsdss sizes = map (specToSize 1 . view psSizeSpec . fst) optsdss V2 w h = foldBy (liftA2 max) zero sizes++-- | Check [Postscript-specific options](#postscript-options) for a+-- description of the available options.+renderDia' :: QDiagram Postscript V2 Double Any -> Options Postscript V2 Double -> IO ()+renderDia' d o = do+ let b = renderDia Postscript o d+ withFile (o ^. psfileName) WriteMode $ \h -> B.hPutBuilder h b++-- | Check [Postscript-specific options](#postscript-options) for a+-- description of the available options.+renderDias' :: [QDiagram Postscript V2 Double Any] -> Options Postscript V2 Double -> IO ()+renderDias' ds o = renderDias o ds >> return () renderC :: (Renderable a Postscript, V a ~ V2, N a ~ Double) => a -> RenderM () renderC = runC . render Postscript
src/Diagrams/Backend/Postscript/CmdLine.hs view
@@ -73,7 +73,6 @@ ) where import qualified Data.ByteString.Builder as B-import System.IO (IOMode (..), withFile) import Diagrams.Backend.CmdLine import Diagrams.Backend.Postscript@@ -163,16 +162,6 @@ renderer (PostscriptOptions (opts^.output) sizeSpec outfmt) | otherwise -> putStrLn $ "Unknown file type: " ++ last ps--renderDias' :: [QDiagram Postscript V2 Double Any] -> Options Postscript V2 Double -> IO ()-renderDias' ds o = renderDias o ds >> return ()--renderDia' :: QDiagram Postscript V2 Double Any -> Options Postscript V2 Double -> IO ()-renderDia' d o = do- let b = renderDia Postscript o d- withFile (o ^. psfileName) WriteMode $ \h -> B.hPutBuilder h b-- -- | @multiMain@ is like 'defaultMain', except instead of a single -- diagram it takes a list of diagrams paired with names as input.