[Coco] Printing on a Coco with modern printers.
Mark J. Blair
nf6x at nf6x.net
Sat Jan 11 15:07:18 EST 2014
On Jan 11, 2014, at 11:46 , Gene Heskett <gheskett at wdtv.com> wrote:
> Frosting on the cake then. But how do they represent the real?
Postscript is a complete programming language, designed for the primary purpose of describing vector graphics. When you print to a Postscript printer, you send the printer a Postscript program which describes what you want to be printed. The printer executes that program, and renders its output in whatever native resolution the printer uses. The Postscript code is plain old ASCII text, and numbers are represented just like you would in most computer programming languages, i.e. "1.23456".
Postscript is stack-based and uses postfix notation (hence, the name).
Here's an example from the Wikipedia page which prints "Hello world!" at 1 inch (72 points) from the left edge, and 6.944 inches (500 points) from the bottom edge:
------ 8< cut here 8< ------
%!PS
/Courier % name the desired font
20 selectfont % choose the size in points and establish
% the font as the current one
72 500 moveto % position the current point at
% coordinates 72, 500 (the origin is at the
% lower-left corner of the page)
(Hello world!) show % stroke the text in parentheses
showpage % print all on the page
------ 8< cut here 8< ------
The coordinates are in units of 1/72 of an inch, but they don't have to be integers. For example, line with the coordinates could have stated "72.12345 499.5 moveto" and the text would be rendered at those coordinates, limited by the native resolution of the printer.
Postscript code is most commonly machine-generated, but you can also write native Postscript code if that floats your boat.
--
Mark J. Blair, NF6X <nf6x at nf6x.net>
http://www.nf6x.net/
More information about the Coco
mailing list