home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / showcp.zip / printkb.psh < prev    next >
Text File  |  1995-04-25  |  6KB  |  155 lines

  1. %%BeginProcSet: printkb 1.4 0
  2. % printkb (C) Copyright IBM Corp. 1994, 1995
  3. /PrintKb 120 dict def
  4. PrintKb begin
  5. /bd {bind def} bind def
  6. /ar .7 def  % rounded corner size
  7. /sw .34 def % size of shadow
  8. /adj .4 def % size adjust for key size
  9. /hadj 0 def % name adjustment for scancodes
  10. /f {setfont} bd
  11. /gs {gsave} bd /gr {grestore} bd
  12. /cp {currentpoint translate} bd
  13. /m {moveto} bd /rm {rmoveto} bd
  14. /sm {sw sw translate} bd
  15. /lw {.07 setlinewidth} bd /lt {lineto} bd
  16. /a {ar arcto pop pop pop pop} bd /r {rlineto} bd
  17. /setsize {100 div dup scale} bd
  18.  
  19. % Define key outlines
  20. /keystart {
  21.   gs lw cp 1 eq {.96}{1} ifelse /gray exch def
  22.   /y exch adj add def /x exch adj add def
  23.   /y2 y 2 div def /x2 x 2 div def
  24. } bd
  25. /keybody { 0 y2 m 0 y x2 y a x y x y2 a x 0 x2 0 a 0 0 0 y2 a closepath } bd
  26. /keyend { gs gray setgray fill gr 0 setgray stroke gr } bd
  27. /key {
  28.   keystart
  29.   sw 0 ne {
  30.     0 setgray keybody fill sm
  31.   } if
  32.   keybody keyend
  33. } bd
  34. /keye {
  35.   keystart
  36.   /dy exch adj add def /dx exch adj add def
  37.   /y3 dy 2 div def /y4 y dy sub 2 div dy add def
  38.   /x3 dx 2 div def /x4 x dx sub 2 div dx add def
  39.   sw 0 ne {
  40.     0 setgray keybodye fill sm
  41.   } if
  42.   keybodye keyend
  43. } bd
  44. /keybodye {
  45.   0  y3 m 0  dy x3 dy a dx dy dx y4 a dx y  x4 y  a x  y  x  y2 a
  46.   x  0  x2 0  a 0  0  0  y2 a closepath
  47. } bd
  48.  
  49. %/capslock {BS smallf f 0 .45 neg m (\240) ES} bd
  50. /capslock {BS 1 setgray 0 1 r 1 0 r 0 -1 r closepath fill gr} bd
  51. /BS {gs cp sm} def
  52. /ES {show gr} def
  53. /scan  {BS f cvx exec gs show gr 100 div exch 100 div exch rm ES} bd
  54. /scan0 {BS smallf f m0 ES} bd
  55. /scan1 {BS smallf f m1 ES} bd
  56. /scan2 {BS smallf f m2 ES} bd
  57. /scan3 {BS smallf f m3 ES} bd
  58. /scan4 {BS bigf f m4 ES} bd
  59. /dkey0 {BS smallf f m0 dkey ES} bd
  60. /dkey1 {BS smallf f m1 dkey ES} bd
  61. /dkey2 {BS smallf f m2 dkey ES} bd
  62. /dkey3 {BS smallf f m3 dkey ES} bd
  63. /dkey4 {BS bigf f m4 dkeyb ES} bd
  64. /m0 {0.8 0.7 m} bd
  65. /m1 {0.8 3.0 m} bd
  66. /m2 {3.1 0.7 m} bd
  67. /m3 {3.1 3.0 m} bd
  68. /m4 {0.7 2.2 m} bd
  69. /m5 {0 0 m}     bd
  70. /dkey  {gs .90 setgray 0 1 r .8 0 r 0 -1 r closepath fill gr} bd
  71. /dkeyb {gs .90 setgray 0 1.3 r 1 0 r 0 -1.3 r closepath fill gr} bd
  72. /scanhex  { BS hexf f .8 1.5 m ES} bd
  73. /scanhex2 { BS littlef f 3.2 3.4 m ES} bd
  74. /scanname  { BS namef f .7 2 hadj sub m ES} bd
  75. /scanname1 { BS namef1 f .5 2 hadj sub m ES} bd
  76. /rjpos [45 90 135 180 225 270] def
  77. /rjname {currentpoint /NameY exch def /NameX exch def rjfont f show} bd
  78. /rjsyn  {NameX rjpos 0 get add NameY m rjfont f show} bd
  79. /rjhex  {rjfont2 f show} bd
  80. /rjm    {rjpos exch get NameX add NameY m} bd
  81. /geti {currentfile exch readhexstring pop} bd
  82.  
  83. %  image character
  84. %  <incr> <x-move> <y-move>  <widebytes> <high> <kind> ic
  85. /ic {
  86.   icwide exch get /Cm exch def
  87.   /Cy exch def /Cx exch def /Cb exch def /Cl exch def /Ci exch def
  88.   /Cz Cx 8 mul def
  89.   Cx Cy mul string /Im exch def Im geti pop
  90.   gs Cl Cm div Cb Cm div rm cp Cz Cm div Cy Cm div scale
  91.   Cz Cy true [Cz 0 0 Cy neg 0 Cy] {Im} imagemask gr
  92.   Ci Cm div 0 rmoveto
  93. } bd
  94. /icwide [21 21 21 21 16 4] def
  95.  
  96. % font related items
  97. /cp819 [
  98. /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  99. /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  100. /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  101. /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  102. /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quotesingle
  103. /parenleft/parenright/asterisk/plus/comma/hyphen/period/slash
  104. /zero/one/two/three/four/five/six/seven
  105. /eight/nine/colon/semicolon/less/equal/greater/question
  106. /at/A/B/C/D/E/F/G
  107. /H/I/J/K/L/M/N/O
  108. /P/Q/R/S/T/U/V/W
  109. /X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore
  110. /grave/a/b/c/d/e/f/g
  111. /h/i/j/k/l/m/n/o
  112. /p/q/r/s/t/u/v/w
  113. /x/y/z/braceleft/bar/braceright/asciitilde/.notdef
  114. /florin/dotlessi/trademark/lslash/Lslash/oe/OE/dagger
  115. /daggerdbl/bullet1/breve/caron/ogonek/hungarumlaut/dotaccent/Eth
  116. /quotedblleft/quotedblright/scaron/Scaron/zcaron/Zcaron/circumflex/tilde
  117. /ring/quoteleft/quoteright/quotedblbase/perthousand/emdash/.notdef/.notdef
  118. /bullet/exclamdown/cent/sterling/currency/yen/brokenbar/section
  119. /dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron
  120. /degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered
  121. /cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown
  122. /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
  123. /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
  124. /Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply
  125. /Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
  126. /agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
  127. /egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
  128. /eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide
  129. /oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis
  130. ] def
  131. /recode {
  132.   /encode exch def
  133.   dup maxlength dict /nf exch def
  134.   { 1 index /FID ne 2 index /Encoding ne and
  135.     {nf 3 1 roll put} {pop pop} ifelse
  136.   } forall
  137.   nf /Encoding encode put Nfn nf definefont
  138. } bd
  139. /Nfn /Helvetica def
  140. /Helvetica findfont cp819 recode /nfont exch def
  141. /Nfn /Helvetica-Bold def
  142. /Helvetica-Bold findfont cp819 recode /bfont exch def
  143. /namef  nfont 2 scalefont def
  144. /namef1 nfont 1.8 scalefont def
  145. /hexf   nfont 3 scalefont def
  146. /bigf   nfont 3 scalefont def
  147. /smallf bfont 2.2 scalefont def
  148. /littlef nfont 1.5 scalefont def
  149. /rjfont  nfont 10 scalefont def
  150. /rjfont2 /Courier-Bold findfont [5 0 0 9 0 0] makefont def
  151. /symbf  /Symbol findfont 3 scalefont def
  152. /symsf  /Symbol findfont 2.2 scalefont def
  153. end
  154. %%EndProcSet
  155.