11c0 %! screencomp.ps % a program to compare graytone rendering at several different % halftone screen frequencies % munged from previously posted work, notably that of: % From: cplai@daisy.UUCP (Chung-Pang Lai) % Subject: halftone parameters % Message-ID: <3143@daisy.UUCP> % Date: 10 Jul 89 19:47:21 GMT % Organization: Daisy Systems, Mt. View, CA % This program hacked by Ishmael J. Stefanov-Wagner, eplunix!ijs % Eaton-Peabody Laboratory, Boston, MA May, 1992 % comment out ShowPrinterParams call if it hangs your printer % works on LW, LWIINTX; fails on IIg Why? 14 dict begin % set up local dictionary /ShowPrinterParams { serverdict begin % no matching end statusdict begin 200 50 moveto (Printer Name is ) show ( ) printername show 200 37 moveto pagecount 10 string cvs show ( Copies printed) show flush end end } bind def % define variables to draw the stripes /str 20 string def % tmp string holder /DataString 256 string def /strip { % screen => - draw a graduated gray bar /scrfreq exch def gsave 0 -12 moveto scrfreq str cvs show ( screen) show 256 1 8 [256 0 0 1 0 0] { DataString } 700 72 scale image grestore newpath 0 setlinewidth 0 setgray 701 0 moveto 0 36 rlineto stroke } bind def /page { % draw a page of halftoned graduated bars currentscreen % get default setting % stack : freq angle spot-func 3 1 roll % stack : spot-func freq angle 3 1 roll % stack : angle spot-func freq % divide it with change fctr dup /freq exch def % save a copy for display 3 1 roll % stack : freq angle spot-func pop pop pop 36 0 translate ShowPrinterParams % breaks badly on a IIg via Gatorbox gsave 350 24 translate 24 24 scale 1 1 8 [1 0 0 1 0 0] { (\000) } image grestore gsave 400 24 translate 24 24 scale 1 1 8 [1 0 0 1 0 0] { (\100) } image grestore gsave 450 24 translate 24 24 scale 1 1 8 [1 0 0 1 0 0] { (\200) } image grestore gsave 500 24 translate 24 24 scale 1 1 8 [1 0 0 1 0 0] { (\300) } image grestore gsave 550 24 translate 0 setlinewidth 0 0 moveto 0 24 lineto 24 24 lineto 24 0 lineto closepath stroke 24 24 scale 1 1 8 [1 0 0 1 0 0] { (\377) } image grestore 0 50 moveto (Default Screen: ) show freq str cvs show 0 100 translate freq strip % draw a strip with default screen currentscreen % get default setting % stack : freq angle spot-func 3 1 roll % stack : spot-func freq angle 3 1 roll % stack : angle spot-func freq pop 100 % divide it with change fctr dup /freq exch def % save a copy for display 3 1 roll % stack : freq angle spot-func setscreen 0 100 translate freq strip % draw a strip with 10 overlapping boxes currentscreen % get default setting % stack : freq angle spot-func 3 1 roll % stack : spot-func freq angle 3 1 roll % stack : angle spot-func freq pop 75 % divide it with change fctr dup /freq exch def % save a copy for display 3 1 roll % stack : freq angle spot-func setscreen 0 100 translate freq strip currentscreen % get default setting % stack : freq angle spot-func 3 1 roll % stack : spot-func freq angle 3 1 roll % stack : angle spot-func freq pop 60 % divide it with change fctr dup /freq exch def % save a copy for display 3 1 roll % stack : freq angle spot-func setscreen 0 100 translate freq strip currentscreen % get default setting % stack : freq angle spot-func 3 1 roll % stack : spot-func freq angle 3 1 roll % stack : angle spot-func freq pop 45 % divide it with change fctr dup /freq exch def % save a copy for display 3 1 roll % stack : freq angle spot-func setscreen 0 100 translate freq strip showpage } bind def % end of prolog 0 1 255 { DataString exch dup put } bind for % fill gray data array /Times-Roman findfont 12 scalefont setfont 0 792 translate -90 rotate % 90 rotate % feed paper round the other way % 0 -612 translate % to see if the tones match (Ha! :-( ) page end . 0