Re: [Haskell-cafe] Cairo and Haskell

2011-04-16 Thread Hans van Thiel
Hello Paulo,

 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. 

With regard to export to pdf and other formats this might be useful:
http://muitovar.com/gtk2hs/app1.html (There's a Spanish translation
too.) However, this tutorial is a few years old now, and I don't know if
it's still up to date for the later Gtk2Hs versions.

Best Regards,

Hans van Thiel



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Cairo and Haskell

2011-04-15 Thread 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


Re: [Haskell-cafe] Cairo and Haskell

2011-04-15 Thread Robert Wills
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 pocma...@gmail.com wrote:
 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


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cairo and Haskell

2011-04-15 Thread 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.

http://hackage.haskell.org/package/cairo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cairo and Haskell

2011-04-15 Thread Chris Smith
To answer my own email, yes, PDF support is there.
On Apr 15, 2011 8:17 AM, Chris Smith cdsm...@gmail.com 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.

 http://hackage.haskell.org/package/cairo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cairo and Haskell

2011-04-15 Thread John Obbele
On Fri, Apr 15, 2011 at 08:19:02AM -0600, Chris Smith wrote:
 On Apr 15, 2011 8:17 AM, Chris Smith cdsm...@gmail.com 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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cairo and Haskell

2011-04-15 Thread Paulo J. Matos

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

http://hackage.haskell.org/package/Hieroglyph





___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cairo and Haskell

2011-04-15 Thread Paulo J. Matos

On 15/04/11 15:19, Chris Smith wrote:

To answer my own email, yes, PDF support is there.



Great, I assume it would also allow me to preview it on a GTK canvas, right?

--
PMatos


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cairo and Haskell

2011-04-15 Thread Paulo J. Matos

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


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe