Laser-Lovers-Request@WASHINGTON.ARPA.UUCP (07/06/86)
Info-Postscript for Laser Lovers Digest Sunday, July 6, 1986 12:47PM Volume 1, Issue 11 Today's Topics: Adding page hack marks to LinoType film Diablo 630 emulation simple but useful postscript hack... 4.3 BSD lpr bug and TranScript... PS program to see glyph widths ---------------------------------------------------------------------- Date: 14 Mar 1986 21:39-EST From: Mike.Blackwell@ROVER.RI.CMU.EDU Subject: Adding page hack marks to LinoType film Here's a Scribe library file that allows you to redefine the page orientation, and add page hack marks (or page grid, as you like - you know, where to cut the film...), to Allied LinoType output. (We proof on Apple LaserWriters, and do final copy on a LinoTronic 300). The way this works is to redefine Scribe's standard PostScript device initialization string, adding PS code at the end to check to see if the output device is a LinoType. If it is, then the size of each page is enlarged to 9 x 11.5 inches. The BS definition (which Scribe calls at the beginning of each page) is modified to first draw .25 x .25 inch hack marks in the corners of the page, and then translate so the page will be centered between the hack marks. If the output device isn't a LinoType, then nothing is changed, so the same file can be printed on any PS printer with no ill effect. To use this library, the first two lines of the MSS file should be: @device(postscript) @librayfile(hackmarks) Note that you cannot include Macintosh generated pictures with @device(macdraw) when you use this library, because the Mac prolog information in the device initialization string will be replaced. -m- (mkb@rover.ri.cmu.edu) ---------- Begin hackma.lib ---------- @Marker(Library, HackMarks) @Begin(Comment) Device Initialization modification for the standard Scribe PostScript device to include 8.5 x 11 inch hack marks on Linotype output. 4-MAR-86 Mike Blackwell, Carnegie-Mellon University, mkb@rover.ri.cmu.edu @End(Comment) @Style(StringMax = 10000) @Style<DeviceInitialization = "%%EndComments %### Start of standard Unilogic Scribe prolog for PostScript device % PostScript Prelude for Scribe. /BS {/SV save def} def /ES {showpage SV restore} def /SC {setrgbcolor} def /RST {100 div} def /CVTXY {RST 792 sub abs exch RST exch} def /RDF {WFT findfont SLT 0 eq {SSZ scalefont} {[SSZ 0 SLT sin SLT cos div SSZ mul SSZ 0 0]makefont} ifelse setfont} def /SLT 0 def /SI { /SLT exch def RDF } def /WFT /Courier def /SF { /WFT exch def RDF } def /SSZ 10 def /SS { /SSZ exch def RDF } def /MT { CVTXY moveto } def /XM {RST currentpoint exch pop moveto} def /UL {gsave newpath CVTXY moveto RST dup 2 div 0 exch rmoveto setlinewidth RST 0 rlineto stroke grestore} def /PB {/PV save def CVTXY translate pop}def /PE {PV restore}def /SH{show}def /MSS {SSW RST 0 rmoveto} def /SNS { SSW add /SSW exch def MSS} def /MX {/SSW exch def SH MSS} def /M2 {SH MSS MSS} def /M {SH MSS} def /M+ {SH 1 SNS} def /M- {SH -1 SNS} def %### End of standard Unilogic Scribe prolog % Prolog addendum to place 8.5 x 11 inch hack marks on Linotype output. % This is accomplished by setting the page parameters so the imaging % area is 9 x 11.5 inches. The BS operator is redefined to draw % 0.25 x 0.25 inch hack marks, then translate by (0.25, 0.25) inches % before starting on the page. % Check to make sure we're on a Linotype statusdict begin product end (Linotype) eq { /INCH { 72 mul } def /H 11.0 INCH def % Paper height /W 8.5 INCH def % Paper width /HACK 0.25 INCH def % Size of hack marks /HACK2 HACK 2 mul def statusdict begin H HACK2 add W HACK2 add 0 INCH 0 setpageparams % For wide film % W HACK2 add H HACK2 add 0 INCH 1 setpageparams % For narrow film end /BS { /SV save def gsave 0 setlinecap 0.25 setlinewidth newpath HACK 0 moveto HACK HACK lineto 0 HACK lineto W HACK add 0 moveto W HACK add HACK lineto W HACK2 add HACK lineto W HACK add H HACK2 add moveto W HACK add H HACK add lineto W HACK2 add H HACK add lineto HACK H HACK2 add moveto HACK H HACK add lineto 0 H HACK add lineto stroke grestore HACK HACK translate } def } if %%EndProlog "> ---------- End of hackma.lib ---------- ------------------------------ Date: Mon, 17 Mar 86 17:13:35 n From: Niall Mansfield Subject: Diablo 630 emulation To: info-postscript@su-score Does anybody have a Postscript program to emulate a Diablo 630, or a program (C, Pascal, x) to translate Diablo-style output to Postscript prior to sending to the printer? (So that a LaserWriter doesn't need to be repeatedly switched between PostScript and Special modes). ------------------------------ Date: Tue 18 Mar 86 20:23:56-PST From: William "Chops" Westfield <BILLW@SU-SCORE.ARPA> Subject: simple but useful postscript hack... Here is a simple postscript procedure that, given a box (lower right and upper left corners), and some text, scales the text to more or less exactly fill the box. I have found it very useful for composing name tags, badges, business cards, and the like.... Known bugs: It seems to run pretty slowly. Although I have concluded that the fact that charaters with descenders (gjyq) exceed the box is probably correct, it also seems that many characters with curved bottoms dip below the box when using large scales. This is probably wrong. ----------- %! fillbox % % procedure to fill a box with some text % text fontname llx lly urx ury -> - % /fillbox { gsave /height exch def % height <- urx /width exch def % width <- urx 2 copy moveto height sub neg /height exch def width sub neg /width exch def findfont height scalefont setfont % get approximate sized font gsave newpath 0 0 moveto %find bounding box of string dup true charpath flattenpath pathbbox /sheight exch def /swidth exch def pop pop grestore width swidth div % scaling for width height sheight div scale % and height show grestore } def % example follows: Make a "BillW" Personal Business Card /inch { 72 mul } def .25 inch .25 inch translate (BillW) /Helvetica-Bold 0 0 % ll corner 3.5 inch 2 inch % ur corner fillbox .5 setgray (Nice guy) /Helvetica .5 inch .66 inch 3 inch .66 inch 15 add fillbox (497-1407) /Helvetica .5 inch .66 inch 16 sub 3 inch .66 inch 1 sub fillbox showpage ------------------------------ Subject: 4.3 BSD lpr bug and TranScript... Date: Wed, 26 Mar 86 11:49:03 -0500 From: Tony Della Fera <tony@ATHENA.MIT.EDU> Incase anyone else has wasted any time on this: There is bug in the 4.3 BSD lpr/lpd software that prevents TranScript from doing proper printer logging. This problem is fixed by one of the more recent 4.3 patches from Berkeley. If you install the Berkeley patches in /usr/src/usr.lib/lpr everything should work properly. Tony... ------------------------------ Date: 29 Mar 1986 17:26:26 EST Subject: PS program to see glyph widths From: Glen Foster <GFoster@USC-ISI.ARPA> The following is a PS program, kindly provided by Ann Robinson of Adobe, that prints all encoded members of a font. She says that she will be providing a similar program that also shows un-encoded members. I haven't had a chance to run it yet so I don't know about format etc. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /Fontname (Times-Roman) def % change this to get other fonts /in {72 mul} def /y 10 in def /lm .9 in def /ptsize 10 def % size to print in /cr {/y y ptsize sub def % move down column -- at y 1 in le {/y 10 in def /lm lm 1.8 in add def} if % bottom, go to next lm y moveto } def % column /showwidth {dup cvn findfont % get font dictionary dup /fn exch def % save in /fn 1 scalefont /sfn exch def % get size X 1000 /pfn fn ptsize scalefont def % scale for printing fn /Encoding get /enc exch def % get encoding vector /schar 4 string def % string for character /ssize 5 string def % string for size /tab1 {lm .3 in add y moveto} def /tab2 {lm .6 in add y moveto} def pfn setfont gsave 3.5 in 10.4 in moveto 2 2 scale show grestore % print name at 2 x print size lm y moveto % top of page 32 1 255 % go thru all ascii chars {/i exch def sfn setfont enc i get % get encoding /.notdef ne % dont print if undefined {( ) dup 0 i put % put ascii val into string dup stringwidth pop % save copy and get width 1000.0 mul cvi ssize cvs % put width in string pfn setfont i schar cvs show % show ascii value tab1 exch show tab2 show % show char and width cr} if } for showpage} def Fontname showwidth ------------------------------ End of Info-Postscript for Laser Lovers Digest **********************************************