🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #2460

Re: ps commands to print "DRAFT"

#2460
From: Ben Cranston
Date: Thu, 05 Jul 1990 18:11
63 lines
2636 bytes
In article <3937@dogie.macc.wisc.edu> yahnke@vms.macc.wisc.edu
(Ross Yahnke, MACC) writes:

> August 1990 MacUser had a tip on how to print the large word "DRAFT"
> over a document, using a PS escape font. I've sort of gotten it to
> work in Nisus, only problem is the word "DRAFT" obscures the
> underlying text - unlike the example in the magazine. Can anybody
> suggest what must be done to make the word "DRAFT" transparent?
> Here's the code, thanks!:

> gsave
> initgraphics
> /font /Helvetica-Bold def
> /pointsize 100 def
> /text (DRAFT) def
> /center {dup stringwidth pop
> 2 div neg 0 rmoveto} def
> 306 396 moveto
> 90 setgray
  ==  I certainly hope this is a mistype of .9 !!!
> font findfont pointsize scalefont setfont
> 45 rotate
> 24 0 text center ashow
> grestore

Anyway, here's my current slashed banner program, the gore is to avoid
having to have magic constants like 306 and 396 for each different page size.

%!-Adobe-1.0
%%Title: smudge.ps
%%Creator: Ben Cranston <zben@umd2.umd.edu>
%%CreationDate: June 12, 1990
%%Pages 0
% Print a word or phrase in gray on every succeeding page

/smudgepage {
    gsave
	(BUSHLIPS) .95 /Helvetica-Bold
	findfont dup setfont clippath pathbbox
	dup 3 index add 2 div 5 1 roll 1 index 4 index add 2 div 6 1 roll
	3 -1 roll sub 3 1 roll exch sub exch 2 copy exch atan 3 1 roll
	dup dup mul 2 index dup mul add sqrt 3 1 roll 2 copy lt {exch} if div
	newpath 0 0 moveto 7 index true charpath pathbbox
	dup 3 index add 2 div 5 1 roll 1 index 4 index add 2 div 6 1 roll
	3 -1 roll sub 3 1 roll exch sub exch
	6 -2 roll 3 -1 roll mul 3 -1 roll add div dup 7 1 roll
	dup 4 -1 roll mul neg exch 3 -1 roll mul neg 3 -1 roll 5 -2 roll
	translate rotate moveto scalefont setfont setgray show
    grestore
} bind def

/showpage [
	/showpage load dup type (operatortype) ne {/exec load} if
	/smudgepage load /exec load
] cvx def
smudgepage

% (YOUR POSTSCRIPT GOES HERE)
-- 

Ben Cranston <zben@umd2.umd.edu>
Warm and Fuzzy Networking Group, Egregious State University
My cat is named "Perpetually Hungry Autonomous Carbon Unit"; I call him "Sam".
Technical Details
Message-ID: <6822@umd5.umd.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!purdue!haven!umd5!zben
References: <3937@dogie.macc.wisc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!purdue!haven!umd5!zben
From: zben@umd5.umd.edu (Ben Cranston)
Newsgroups: comp.lang.postscript
Subject: Re: ps commands to print "DRAFT"
Summary: Please find enclosed the canonical slash banner printer
Message-ID: <6822@umd5.umd.edu>
Date: 5 Jul 90 18:11:01 GMT
References: <3937@dogie.macc.wisc.edu>
Reply-To: zben@umd5.umd.edu (Ben Cranston)
Organization: University of Maryland, College Park
Lines: 63