r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Postscript] Emitting Postscript from REBOL

Graham
10-Apr-2007
[1302]
Doing it programmatically without being able to interpret the eps 
is just trial and error.
Henrik
10-Apr-2007
[1303]
yeah, that's the problem
Graham
10-Apr-2007
[1304]
you would need a postscript interpreter to find out where the image 
is going to go.
Henrik
10-Apr-2007
[1305]
it seems Preview insists on using Letter as page size for postscript.r 
output. I have to assume that a real printer does the same. I need 
A4 and A5 both in portrait and landscape.
Graham
10-Apr-2007
[1306x2]
because eps is just a special postscript file that does not permanently 
alter the environment
Preview ?
Henrik
10-Apr-2007
[1308]
Preview.app
Graham
10-Apr-2007
[1309]
have you specified the bounding box correctly?
Henrik
10-Apr-2007
[1310x2]
it ignores it
only works for EPS
Graham
10-Apr-2007
[1312x2]
Odd ...
gsview works for me ...
Henrik
10-Apr-2007
[1314]
I think I need to specify this in the PS file, otherwise the printer 
just prints everything in Letter/portrait
Graham
10-Apr-2007
[1315x2]
yes ...
you need a bounding box in your ps file
Henrik
10-Apr-2007
[1317x2]
oh, hang on. there was a combination of things I didn't try here...
nope, happily ignored
Graham
10-Apr-2007
[1319]
try some other ps files generated by other apps
Henrik
10-Apr-2007
[1320x6]
still ignores it, but I think I figured out why it does that.
it behaves like a printer with letter paper in it. and just scales 
anything to fit in it.
if I ask for a print preview and specifically ask for A5 paper, it 
clips the drawing like a printer would
created a postscript knowlegde base checklist
caving in and trying to do this with imagemagick. :-(


however it does not load .ps files (no delegate), even though it 
says so with "identify -list format" in the console
oh, ghostscript is needed for this....
Geomol
10-Apr-2007
[1326]
A couple of useful PS links:

How to generate portable Postscript: http://alumni.media.mit.edu/~szummer/postscript/

What is the physical size of the page?: http://www.postscript.org/FAQs/language/node64.html

How to use Adobe PostScript language files properly.: http://www-cdf.fnal.gov/offline/PostScript/AdobePS.html

(Look under "Paper bin, tray, size, feed mode, etc. selection", where 
you also find a link to:)
PostScript Sins: http://www.byte.com/art/9508/sec13/art3.htm
Gripes: http://www.cs.wisc.edu/~ghost/doc/gripes.htm
Henrik
10-Apr-2007
[1327]
Geomol, I made a checklist for links
Geomol
10-Apr-2007
[1328]
oki
Henrik
10-Apr-2007
[1329x3]
feel free to put stuff in there :-)
Geomol, I've added EPS output, bounding box and page orientation 
to postscript.r. This is done with a 'preamble which is followed 
by a block.
and then the page [...] stuff comes.
Geomol
10-Apr-2007
[1332]
Ok, about your page size, I think, it'll give more problems, if you 
specify A4 or Letter explicit. It's better to make some margin, so 
the pages can be printed on both types of paper.
Henrik
10-Apr-2007
[1333]
possibly... I've noticed that Preview doesn't care much about page 
sizes or page orientation while Ghostview does.
Geomol
10-Apr-2007
[1334]
Regarding landscape, then I think, it's just a comment in PS (%%PageOrientation) 
used for previewing.
Henrik
10-Apr-2007
[1335]
yes, tried it.
Geomol
10-Apr-2007
[1336x2]
It may be more clear, if we look at PS as a low level language to 
control some type of printer or typesetter. It goes like: move to 
this position, print this text using this font, move to this other 
position, print text, ...

Landscape is done with 90 degree rotation before doing the print 
command.
If the position is off the side of the paper, it's tough luck and 
will be cut.
Henrik
10-Apr-2007
[1338]
which is also why it would be tough to do in VID, since it does not 
have a method for easy 90 degree rotation of text
Geomol
10-Apr-2007
[1339]
Yup, better to use the DRAW dialect.
Henrik
10-Apr-2007
[1340]
well, DRAW can't use proper centering and right alignment... somehow 
this reminds me of a toolbox with a broken hammer and bent nails...
Geomol
10-Apr-2007
[1341]
hmm... *thinking*
Henrik
10-Apr-2007
[1342]
I've discussed this with Gabriele and it was thought that it would 
be enough to have the bounding box available for each char. This 
way we could do proper typesetting.
Graham
10-Apr-2007
[1343]
Must be a change of heart occuring .. Carl said he never imagined 
anyone doing type setting with Rebol!
Geomol
10-Apr-2007
[1344]
That's the force of REBOL! :-) You can't possible think of all the 
things, you can and will do with it.
Henrik
10-Apr-2007
[1345]
well, DRAW uses bounding box to render text, but it does not bring 
that information further up to REBOL level, so we can take advantage 
of it.
Geomol
10-Apr-2007
[1346]
Henrik, is it some thing like the function SIZE-TEXT, you're after 
with text in DRAW?
Henrik
10-Apr-2007
[1347]
geomol, yes. SIZE-TEXT does not work that well with DRAW text.
Geomol
10-Apr-2007
[1348]
right :/
Henrik
10-Apr-2007
[1349]
but a basic thing like placing text according to the baseline is 
also missing. this is also not brought up to REBOL level.
Geomol
10-Apr-2007
[1350x2]
Have you played with MATRIX and text in DRAW?
I remember, I got some funny results, when I made Canvas RPaint. 
There's the mirror effect. I can't remember, how it affected text, 
and I can't test it right now, as my PC is packed away and it DRAW 
text doesn't work under OS X.