home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
showcp.zip
/
printcp.psh
< prev
next >
Wrap
Text File
|
1997-11-03
|
7KB
|
225 lines
%%BeginProcSet: printcp 1.0 2
% printcp (C) Copyright IBM Corp. 1995
/Printcp 150 dict def
Printcp begin
% customization values for size
/demosize 17 def % size of font
/baseline 18 def % position of baseline from top
/below 10 def % baseline to bottom annotation
/demofont /Times-Bold def % font for characters
/titlefont /Helvetica-Bold def % title line font
/titlesize 20 def % title size
/smallf /Helvetica findfont 7 scalefont def
% These should not change
/onebox 32 def
/halfbox 16 def
/char ( ) def
/rasterscale 44 demosize div def
/Uni 10 string def
/bd {bind def} bind def
/ln {lineto} bd
/mt {moveto} bd
/rm {rmoveto} bd
/rl {rlineto} bd
/st {stroke} bd
/gs {gsave} bd
/chst {gsave currentpoint translate} bd
/gr {grestore} bd
/fl {closepath fill} bd
% We may override these later, but these are the defaults
/Delta 0 def
/rows 16 def
/cols 16 def
/col1 0 def
/row1 0 def
% Define box
/hline {onebox cols mul dup 0 rl neg onebox neg rm} def
/vline {onebox rows mul dup neg 0 exch rl onebox exch rm} def
/box {
0.5 setlinewidth
topx topy mt
0 1 rows {pop hline} for st
topx topy mt
0 1 cols {pop vline} for st
} bd
% outer box. This is optional and only adds a thicker box
/obox {
topx 0.75 sub topy 0.75 add mt
1.5 setlinewidth
onebox cols mul 1.5 add dup 0 rl
0 onebox rows mul 1.5 add neg rl
neg 0 rl closepath st
} bd
% codepage 819 with extra chars in the upper control area
/cp819 [
/.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/quotesingle
/parenleft/parenright/asterisk/plus/comma/hyphen/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
/grave/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/.notdef
/florin/dotlessi/trademark/lslash/Lslash/oe/OE/dagger
/daggerdbl/bullet1/breve/caron/ogonek/hungarumlaut/dotaccent/Eth
/quotedblleft/quotedblright/scaron/Scaron/zcaron/Zcaron/circumflex/tilde
/ring/quoteleft/quoteright/quotedblbase/perthousand/emdash/.notdef/bullet
/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/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide
/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis
] def
% Recode font
/recode {
dup findfont
dup maxlength dict /nf exch def
{1 index /FID ne {nf 3 1 roll put} {pop pop} ifelse} forall
nf /Encoding cp819 put
nf definefont
} bd
% Show codepoint number in decimal
/cdp {
gs
/int exch def
/dx topx j onebox mul add 20 add def
/dy y below sub def
dx dy mt
smallf setfont
int 10 lt {(0) show} if
int 100 lt {(0) show} if
int ( ) cvs show
gr
} bd
% Show IBM name or unicode name
/ibmn {
gs
/nam exch def
/dx x 14 add def
/dy y below sub def
dx dy mt
smallf setfont
nam dup stringwidth pop neg 0 rm show
gr
} bd
% Normal labels (left to right)
/label {
/Helvetica findfont 14 scalefont setfont
/y topy 7 add def
0 1 cols 1 sub {/j exch def
/x topx j onebox mul 10 add add def
x y mt (-) show
j col1 add 16 char cvrs show
} for
0 1 rows 1 sub {/i exch def
/y topy i onebox mul 23 add sub 1.7 add def
/x topx 20 sub def
x y mt
i row1 add 16 char cvrs show (-) show
} for
} bd
% reversed labels (top to bottom)
/revlabel {
/Helvetica findfont 14 scalefont setfont
/y topy 7 add def
0 1 cols 1 sub {/j exch def
/x topx j onebox mul 10 add add def
x y mt
j col1 add 16 char cvrs show (-) show
} for
0 1 rows 1 sub {/i exch def
/y topy i onebox mul 23 add sub 1.7 add def
/x topx 20 sub def
x y mt
(-) show i row1 add 16 char cvrs show
} for
} bd
% character position
/cpos {
dup /i exch def onebox mul topy exch sub baseline Delta add sub /y exch def
dup /j exch def onebox mul topx add halfbox add /x exch def
x y mt
} bd
% font character
/chr {
gs
char exch 0 exch put
demof setfont
char stringwidth pop 2 div neg 0 rm
char show
gr
} bd
% draw baseline
/basel {
gs .1 setlinewidth -12 0 rm 24 0 rl st gr
} bd
% accented char
/accent {
gs
rasterscale div 8 div /dy exch def rasterscale div 8 div /dx exch def
exch char exch 0 exch put
demof setfont
char stringwidth pop 2 div neg 0 rm
gs char show gr
char exch 0 exch put
dx dy rm char show
gr
} bd
% A few drawn characters
/up {chst -7 0 mt 7 0 ln 0 14 ln fl gr} bd
/down {chst -7 14 mt 0 0 ln 7 14 ln fl gr} bd
/left {chst -6 6 mt 7 0 ln 7 12 ln fl gr} bd
/right {chst -7 0 mt 6 6 ln -7 12 ln fl gr} bd
/bx {-8 -4 mt 8 -4 ln 8 16 ln -8 16 ln closepath fill} bd
/fill25 {chst .95 setgray bx gr} bd
/fill50 {chst .8 setgray bx gr} bd
/fill75 {chst .6 setgray bx gr} bd
/block {chst 0 setgray bx gr} bd
/dbcs {chst .6 setlinewidth -10 16 mt 10 -4 ln -10 -4 mt 10 16 ln st gr} bd
% image character
% <incr> <x-move> <y-move> <widebytes> <high> ic
/geti {currentfile exch readhexstring pop} bd
/ic {
/Cy exch def /Cx exch def /Cb exch def /Cl exch def /Ci exch def
/Cz Cx 8 mul def
Cx Cy mul string /Im exch def Im geti pop
gs Cl rasterscale div Ci rasterscale 2 mul div sub Cb rasterscale div
rm currentpoint translate
Cz rasterscale div Cy rasterscale div scale
Cz Cy true [Cz 0 0 Cy neg 0 Cy] {Im} imagemask gr
} bd
end
%%EndProcSet