🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1575

Re: Reverse video font?

#1575
From: Paul Stath
Date: Fri, 19 Jan 1990 21:22
52 lines
2716 bytes
Well, I got around to testing this sooner than I thought.  So here is the
tested version of rVideo.ps!  This program prints "Hello World!" in
"reverse video."  I forgot about little things like "nocurrentpoit"
problems and such, but this works great.  The letters do NOT "leak" out
of the edges of the inverse bounding box, but you might want to play with
the assignment of LLx LLy URx URy to produce larger borders.  Have fun,
I know I did!!

-------------------------------------------------------------------------------
%!
%%Title: rVideo.ps

% Rvideo - expects the string to display in "reverse video" to be on
%          the top of the stack.  You must also have a currentpoint.
/Rvideo {
gsave
	dup		% Make two copies of the string on the stack
	currentpoint	% Save current point on stack
	3 -1 roll	% bring one string to top of stack
	0 setgray	% Set background video color
	false charpath flattenpath pathbbox	% get Bounding box of string
	/URy exch def	% These can be added or subtracted
	/URx exch def	% 	from in order to get thicker
	/LLy exch def	% 	borders around the inverse text
	/LLx exch def
	LLx LLy moveto	% move to lower left hand corner of box
	LLx URy lineto	% line to UL-hand corner of bounding box
	URx URy lineto	% line to UR-hand corner of bounding box
	URx LLy lineto	% line to LR-hand corner of bounding box
	closepath fill	% close path and fill with background color
	moveto		% Move to point saved with currentpoint
	1 setgray	% Switch to "reverse" video color
	show		% Show string
grestore
} def

%%----Global Variables---------------------------------------------------
/Times-Bold findfont 44 scalefont
/Times-Roman44 exch def

%%----Program Script-----------------------------------------------------
Times-Roman44 setfont
72 72 moveto
(Hello World!) Rvideo
showpage
-------------------------------------------------------------------------------
-- 
===============================================================================
Paul R. Stath       The Computer Solution Co., Inc.       Voice: 804-794-3491
------------------------------------------------+------------------------------
INTERNET:	prs@tcsc3b2.tcsc.com		| "There was no diety involved,
Technical Details
Message-ID: <1990Jan19.212246.13145@tcsc3b2.tcsc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!aplcen!wb3ffv!ka3ovk!tcsc3b2!prs
References: <37700001@osiris.cso.uiuc.edu> <1990Jan19.194829.12906@tcsc3b2.tcsc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!aplcen!wb3ffv!ka3ovk!tcsc3b2!prs
From: prs@tcsc3b2.tcsc.com (Paul Stath)
Newsgroups: comp.lang.postscript
Subject: Re: Reverse video font?
Message-ID: <1990Jan19.212246.13145@tcsc3b2.tcsc.com>
Date: 19 Jan 90 21:22:46 GMT
References: <37700001@osiris.cso.uiuc.edu> <1990Jan19.194829.12906@tcsc3b2.tcsc.com>
Organization: The Computer Solution Company, Inc.
Lines: 52