postscript generation

M

Martin DeMello

I'm trying to write a ruby program that will output a postscript
representation of a scrabble board. Some of the things I thought of are

1. Generate LaTeX
2. Generate SVG/Dia
3. Generate postscript directly
4. Draw on a canvas and use its ps output method

Has anyone tried anything similar? If I go with option 4, which toolkit
has the nicest canvas class?

martin
 
S

Stefan Schmiedl

I'm trying to write a ruby program that will output a postscript
representation of a scrabble board. Some of the things I thought of are

1. Generate LaTeX
easy

2. Generate SVG/Dia

never done this
3. Generate postscript directly

you'll need to work with low-level stuff like character sizes ...
4. Draw on a canvas and use its ps output method

never done this.
Has anyone tried anything similar? If I go with option 4, which toolkit
has the nicest canvas class?

martin

FWIW, I'm writing my bills via a YAML-Ruby-Lout-combo.

Lout is closer to PostScript and does not have some of TeX's more
awkward parts. And it's *very* small compared to TeX.

It should be very well suited to your problem.

s.
 
M

Martin DeMello

Stefan Schmiedl said:
FWIW, I'm writing my bills via a YAML-Ruby-Lout-combo.

Lout is closer to PostScript and does not have some of TeX's more
awkward parts. And it's *very* small compared to TeX.

It should be very well suited to your problem.

Thanks! I'd never heard of this, but it does indeed look ideal. My
biggest issue with LaTeX was the awkwardness of mixing in graphics, and
lout looks like it solves that.

martin
 
P

Phil Tomson

I'm trying to write a ruby program that will output a postscript
representation of a scrabble board. Some of the things I thought of are

1. Generate LaTeX
2. Generate SVG/Dia
3. Generate postscript directly
4. Draw on a canvas and use its ps output method

Has anyone tried anything similar? If I go with option 4, which toolkit
has the nicest canvas class?

Well, Tk's canvas can already outupt postscript. I don't know if any
other toolkit has that capability.

Phil
 
M

Martin DeMello

Phil Tomson said:
Well, Tk's canvas can already outupt postscript. I don't know if any
other toolkit has that capability.

I think Fox's can - there's a postscript device context listed in the
docs.

martin
 
M

Martin DeMello

Martin DeMello said:
Thanks! I'd never heard of this, but it does indeed look ideal. My
biggest issue with LaTeX was the awkwardness of mixing in graphics, and
lout looks like it solves that.

Okay, this was even easier than I thought :)

There's a preliminary release up at

http://zem.novylen.net/ruby/scrabpp-0.1.zip

Can someone think up a nice platform-independent way of detecting whether
lout is installed and running it as a final step if it is? Or will I
have to require a path_to_lout config variable?

martin
 
S

Stefan Schmiedl

Okay, this was even easier than I thought :)

There's a preliminary release up at

http://zem.novylen.net/ruby/scrabpp-0.1.zip
great!


Can someone think up a nice platform-independent way of detecting whether
lout is installed and running it as a final step if it is? Or will I
have to require a path_to_lout config variable?

path_to_lout would be the best, as it is not widely used under windows,
I think. And, IIRC, you get a zip-archive for windows, which you can
unpack whereever you like.

OTOH, people using it will have lout.exe in their path somewhere, so
if all else fails, you could search the directories ... OTTH, they
might have a batch file somewhere hiding the path from the outside
world...

path_to_lout seems to be the simplest thing that could work.

s.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,155
Messages
2,570,871
Members
47,401
Latest member
CliffGrime

Latest Threads

Top