I found this post on stackoverflow where someone was trying to use some
old postscript code from the internet and it wasn't quite doing what he wanted due to portability issues in the code.
I'm busy with finals week in school so I can't put in the time to work
on it. But if anyone is looking for a (light) PS programming effort,
I the results will be entertaining for the group.
SO question: https://stackoverflow.com/q/59950318/733077/why-does-this-postscript-ps-file-create-way-more-top-margin-than-specified
%!
%
% From: Jonathan Monsarrat (jgm@cs.brown.edu)
% Subject: PostScript -> ASCII *and* ASCII -> PostScript programs
% Newsgroups: comp.lang.postscript
% Date: 1992-10-01 04:45:38 PST
%
% "If anyone is interested, here is an interesting program written by
% Professor John Hughes here at Brown University that formats ASCII
% in PostScript without a machine generator of any kind."
%
%%%
%%% Plan:
%%% Start with an empty string.
%%% For each character in the input stream,
%%% check to see if it's a carriage return.
%%% if so, show the current string and reset it to empty
%%% if not, add it to the current string.
The bizarre "dup 500 gt" I left alone. I can't see that it hurtsanything,
but I can't imagine a situation where it would accomplish anything either.
In article <dfbf4f4d-4b1b-4acb-8b4e-362cc46fc8cc@googlegroups.com>, luser.droog@gmail.com says...
The bizarre "dup 500 gt" I left alone. I can't see that it hurtsanything,
but I can't imagine a situation where it would accomplish anything either.
I haven't read the code i detail, but surely that is simply preventing
an overflow of the string, which is defined as a 500 element object ?
Though I agree it would have to be a very small point size and large
media width to fit more than 500 characters across it.
On Tuesday, May 12, 2020 at 4:34:26 PM UTC-5, luser droog wrote:
I found this post on stackoverflow where someone was trying to use some
old postscript code from the internet and it wasn't quite doing what he wanted due to portability issues in the code.
I'm busy with finals week in school so I can't put in the time to work
on it. But if anyone is looking for a (light) PS programming effort,
I the results will be entertaining for the group.
SO question: https://stackoverflow.com/q/59950318/733077/why-does-this-postscript-ps-file-create-way-more-top-margin-than-specified
%!
%
% From: Jonathan Monsarrat (jgm@cs.brown.edu)
% Subject: PostScript -> ASCII *and* ASCII -> PostScript programs
% Newsgroups: comp.lang.postscript
% Date: 1992-10-01 04:45:38 PST
%
% "If anyone is interested, here is an interesting program written by
% Professor John Hughes here at Brown University that formats ASCII
% in PostScript without a machine generator of any kind."
%
%%%
%%% Plan:
%%% Start with an empty string.
%%% For each character in the input stream,
%%% check to see if it's a carriage return.
%%% if so, show the current string and reset it to empty
%%% if not, add it to the current string.
I got both my finals turned in, so I looked closer at this code.
It's actually pretty decent overall. I did not make a lot of changes.
Changed some names, factored out the ++ operation, simplify calculation
of the leading (nee lineheight). And most importantly replace the
explicit
/pageheight 11 inch def
with your choice between taking the maximum Y value from the page device
or the clipping path.
The bizarre "dup 500 gt" I left alone. I can't see that it hurts anything, but I can't imagine a situation where it would accomplish anything either.
Modified version:
Text immediately following will be printed on the output device.begin main
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 02:27:47 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,582 |