home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
elvis22g.zip
/
ELVIS_PS.zip
/
elvis.ps
< prev
next >
Wrap
Text File
|
1999-10-21
|
7KB
|
190 lines
% lib/elvis.ps
%
% This file is inserted into any PostScript generated by elvis. It defines
% the following symbols:
% ElvisN push a 12-point normal font
% ElvisB push a 12-point bold font
% ElvisI push a 12-point italic font
% ElvisPage translate & scale a page to fit the paper
% ElvisLeftPage translate, rotate & scale to fit left half of paper
% ElvisRightPage translate, rotate & scale to fit right half of paper
%
% In addition, the implementations of the Elvis*Page procedures given here
% depend on the following measurements, expressed in Points:
% ElvisLeftEdge offset to left edge of printable area
% ElvisTopEdge offset to right edge of printable area
% ElvisWidth width of printable area
% ElvisHeight height of printable area
% Define the printing offsets. These indicate where the *PRINTABLE* portion
% of each page starts. This is likely to vary from one printer to another.
% The unit of measurement is a Point, approximately 1/72 of an inch.
/ElvisLeftEdge 12 def
/ElvisTopEdge 36 def
% Define the width and height of the printable area. This will vary with
% the type of paper. The unit of measurement is a Point, ~ 1/72 of an inch.
(letter) ElvisPaper eq {
/ElvisWidth 576 def
/ElvisHeight 720 def } if
(legal) ElvisPaper eq {
/ElvisWidth 576 def
/ElvisHeight 936 def } if
(executive) ElvisPaper eq {
/ElvisWidth 486 def
/ElvisHeight 634 def } if
(a4) ElvisPaper eq {
/ElvisWidth 558 def
/ElvisHeight 770 def } if
(a3) ElvisPaper eq {
/ElvisWidth 770 def
/ElvisHeight 1116 def } if
% The following should be true to enable the feature, or false to disable it
/ElvisBar false def % bar separating pages in two-up format
/ElvisFrame true def % frame around each page in two-up format
/ElvisPunch false def % increase left margin to leave room for a 3-hole punch
/ElvisClip false def % increase top margin for use with a clipboard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% %%%%%%%%%%%%
%%%%%%%%%% You probably won't need to modify anything after this %%%%%%%%%%%%
%%%%%%%%%% %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% If ElvisWidth/ElvisHeight undefined, use default values
true userdict { pop /ElvisWidth eq { pop false } if } forall {
/ElvisWidth 576 def
/ElvisHeight 720 def } if
% Adjust for punch
ElvisPunch ElvisLeftEdge 60 le and {
userdict /ElvisWidth ElvisWidth ElvisLeftEdge add 60 sub put
userdict /ElvisLeftEdge 60 put
} if
%Adjust for clipboard
ElvisClip ElvisTopEdge 72 le and {
userdict /ElvisHeight ElvisHeight ElvisTopEdge add 72 sub put
userdict /ElvisTopEdge 72 put
} if
% The virtual width/height varies with the number of rows/columns. For
% 80 columns by 60 rows, it is always 576 by 720 regardless of the paper size.
/ElvisVWidth ElvisColumns 80 div 576 mul def
/ElvisVHeight ElvisLines 60 div 720 mul def
% This array lists the shapes of every Latin-1 character.
/Latin1
[/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright
/parenleft /parenright /asterisk /plus /comma /minus /period /slash
/zero /one /two /three /four /five /six /seven
/eight /nine /colon /semicolon /less /equal /greater /question
/at /A /B /C /D /E /F /G
/H /I /J /K /L /M /N /O
/P /Q /R /S /T /U /V /W
/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
/quoteleft /a /b /c /d /e /f /g
/h /i /j /k /l /m /n /o
/p /q /r /s /t /u /v /w
/x /y /z /braceleft /bar /braceright /asciitilde /space
/space /space /space /space /space /space /space /space
/space /space /space /space /space /space /space /space
/space /space /space /space /space /space /space /space
/space /space /space /space /space /space /space /space
/space /exclamdown /cent /sterling /currency /yen /brokenbar /section
/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron
/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered
/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown
/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls
/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icurcumflex /idieresis
/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] def
% This procedure is passed two names - The name of a new font to create, and
% the name of an existing font to create it from. Upon completion, the
% args have been removed from the stack and the new font is defined. The
% only difference between the two is that the new font uses the Latin-1
% encoding.
/DoTheLatinShuffle
{
findfont
dup maxlength dict /Temp exch def
{ exch dup dup /FID ne exch /UniqueID ne and
{ exch Temp 3 1 roll put }
{ pop pop }
ifelse
} forall
Temp dup /Encoding Latin1 put
definefont pop
} def
% Derive 3 Latin-1 fonts from the existing courier fonts
/Elvis-Normal /Courier DoTheLatinShuffle
/Elvis-Bold /Courier-Bold DoTheLatinShuffle
/Elvis-Italic /Courier-Oblique DoTheLatinShuffle
% Define symbolic names for the 12-point versions of those fonts
/ElvisN /Elvis-Normal findfont 12 scalefont def
/ElvisB /Elvis-Bold findfont 12 scalefont def
/ElvisI /Elvis-Italic findfont 12 scalefont def
% Define the page-scaling functions
/ElvisPage
{
ElvisLeftEdge ElvisTopEdge translate
ElvisWidth ElvisVWidth div ElvisHeight ElvisVHeight div scale
} def
/ElvisLeftPage
{
ElvisLeftEdge ElvisWidth add ElvisTopEdge translate
90 rotate
ElvisHeight ElvisVWidth 2 mul div ElvisWidth ElvisVHeight div scale
ElvisWidth 0.02 mul ElvisHeight 0.02 mul translate 0.94 0.96 scale
0 setlinewidth
% Draw a frame around page
ElvisFrame {
-5 -5 moveto
ElvisVWidth 10 add 0 rlineto
0 ElvisVHeight 10 add rlineto
ElvisVWidth 10 add neg 0 rlineto
closepath stroke
} if
} def
/ElvisRightPage
{
% Draw a line between left & right pages
ElvisBar {
newpath
ElvisLeftEdge ElvisTopEdge ElvisHeight 2 div add moveto
ElvisWidth 0 rlineto
stroke
} if
ElvisLeftEdge ElvisWidth add ElvisTopEdge ElvisHeight 2 div add translate
90 rotate
ElvisHeight ElvisVWidth 2 mul div ElvisWidth ElvisVHeight div scale
ElvisWidth 0.04 mul ElvisHeight 0.02 mul translate 0.94 0.96 scale
0 setlinewidth
% Draw a frame around page
ElvisFrame {
-5 -5 moveto
ElvisVWidth 10 add 0 rlineto
0 ElvisVHeight 10 add rlineto
ElvisVWidth 10 add neg 0 rlineto
closepath stroke
} if
} def