luser-dr00g / xpost

A PostScript interpreter in C
Other
93 stars 12 forks source link

itp does not accept '-DDEVICE=XXX' option and '-o Filename%d' option to render output to named file(s) in a standard interchange format. #4

Closed GoogleCodeExporter closed 7 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make, make install
2. itp -DDEVICE=pgm -o fern.pgm fern.ps
3. no file created

What is the expected output? What do you see instead?

Expected to create a pgm file (for example) containing a rendering of the image 
described by fern.ps.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by luser.droog on 28 Oct 2013 at 8:55

GoogleCodeExporter commented 9 years ago

Original comment by luser.droog on 28 Oct 2013 at 9:19

GoogleCodeExporter commented 9 years ago
we could use getlong-like options (see 
http://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Option-Example.htm
l#Getopt-Long-Option-Example)

so the use of itp would be :

itp [options] -o foo.pgm foo.ps

with options :

-h or --help
-v or --version
-d the_device or --device the device

we can add more options in that issue

Original comment by vincent....@gmail.com on 29 Oct 2013 at 5:43

GoogleCodeExporter commented 9 years ago
The short-form -d should be for definitions, so it's not actually any
shorter. To specify a device, it's

 -dDEVICE=???

Then the initgraphics operator will look for that definition to open the
device.

Original comment by luser.droog on 29 Oct 2013 at 5:58

GoogleCodeExporter commented 9 years ago
The above options are not yet available, but as of revision 8929337c8597 
(http://code.google.com/p/xpost/source/detail?r=8929337c859763bce5825d581d39808e
4e5ca48e), you can get a pgm file of the graphics output by defining 
/OutputFileName. Eg.

  /OutputFileName (out.pgm)
  loadgraphics
  0 0 moveto
  50 50 lineto
  0 setlinewidth %currently only supports zero-width lines
  stroke
  showpage

Be sure to make your terminal really big, because it's a 50x50 text dump of the 
image.

Original comment by luser.droog on 10 Nov 2013 at 5:17

GoogleCodeExporter commented 9 years ago
Whoops! Jumped tracks there. You'll see the text dump if you DON'T specify a 
file as shown. If you specify a file, it writes to the file and does not print 
the text dump to the screen.

Original comment by luser.droog on 10 Nov 2013 at 5:18

GoogleCodeExporter commented 9 years ago
So. The options are implemented (thanks Vincent). But the graphics code doesn't 
make use of it. The main function needs to make definitions for the graphics 
code to find (or not, for default behavior).

Original comment by luser.droog on 2 Dec 2013 at 11:35

GoogleCodeExporter commented 9 years ago
I've connected the device option '-d' to the code that instantiates the device. 
Need to deal with the filename now.

Original comment by luser.droog on 4 Jan 2014 at 11:57

GoogleCodeExporter commented 9 years ago
Using the filename is implemented now. But the background is black instead of 
white.

Original comment by luser.droog on 18 Jan 2014 at 12:25

luser-dr00g commented 7 years ago

This is all fixed for a while now. Closing.