
Hi, I would like to use Haskell to generate automatically a poster. I guess that would be using Cairo so I can have a 2d canvas to draw in and maybe even preview before exporting to PDF. However, I can't find any documentation on Cairo with Haskell or any code examples related to what I want to do. Any suggestions? Cheers, -- PMatos

Have a look at
http://hackage.haskell.org/package/diagrams
and
http://hackage.haskell.org/package/Hieroglyph
On Fri, Apr 15, 2011 at 2:54 PM, Paulo J. Matos
Hi,
I would like to use Haskell to generate automatically a poster. I guess that would be using Cairo so I can have a 2d canvas to draw in and maybe even preview before exporting to PDF.
However, I can't find any documentation on Cairo with Haskell or any code examples related to what I want to do.
Any suggestions?
Cheers,
-- PMatos
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Thanks I will take a look at those. On 15/04/11 15:12, Robert Wills wrote:
Have a look at
http://hackage.haskell.org/package/diagrams
and

Haskell has Cairo bindings as part of gtk2hs. The package on Hackage is called 'cairo'. You can certainly preview on the screen, but I'm less sure about exporting to PDF, since the bindings were intended for GUI programming. At least PNG output is possible, though; PDF may be, as well. http://hackage.haskell.org/package/cairo

To answer my own email, yes, PDF support is there.
On Apr 15, 2011 8:17 AM, "Chris Smith"
Haskell has Cairo bindings as part of gtk2hs. The package on Hackage is called 'cairo'. You can certainly preview on the screen, but I'm less sure about exporting to PDF, since the bindings were intended for GUI programming. At least PNG output is possible, though; PDF may be, as well.

On Fri, Apr 15, 2011 at 08:19:02AM -0600, Chris Smith wrote:
On Apr 15, 2011 8:17 AM, "Chris Smith"
wrote: Haskell has Cairo bindings as part of gtk2hs. The package on Hackage is called 'cairo'. You can certainly preview on the screen, but I'm less sure about exporting to PDF, since the bindings were intended for GUI programming. At least PNG output is possible, though; PDF may be, as well.
To answer my own email, yes, PDF support is there.
You can also take a look at the demo programs in the cairo package: bash $ mkdir /tmp/uncabal && cd /tmp/uncabal bash $ cabal unpack cairo bash $ cd /tmp/uncabal/cairo-*/demo bash $ runghc StarAndRing.hs The gtk2hs bindings are generaly pretty dumb and just mimic the original C behaviour. So the best source of documentation is the original cairo website: http://cairographics.org/documentation/ regards, /john

On 15/04/11 16:13, John Obbele wrote:
bash $ mkdir /tmp/uncabal&& cd /tmp/uncabal bash $ cabal unpack cairo bash $ cd /tmp/uncabal/cairo-*/demo bash $ runghc StarAndRing.hs
The gtk2hs bindings are generaly pretty dumb and just mimic the original C behaviour. So the best source of documentation is the original cairo website: http://cairographics.org/documentation/
Awesome, just tried it and it worked! Will start off based on that! :) -- PMatos
participants (4)
-
Chris Smith
-
John Obbele
-
Paulo J. Matos
-
Robert Wills