home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / clipart / gs22.zip / PCHARSTR.PS < prev    next >
Text File  |  1991-05-29  |  3KB  |  83 lines

  1. %    Copyright (C) 1990, 1991 Aladdin Enterprises.  All rights reserved.
  2. %    Distributed by Free Software Foundation, Inc.
  3. %
  4. % This file is part of Ghostscript.
  5. %
  6. % Ghostscript is distributed in the hope that it will be useful, but
  7. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. % to anyone for the consequences of using it or for whether it serves any
  9. % particular purpose or works at all, unless he says so in writing.  Refer
  10. % to the Ghostscript General Public License for full details.
  11. %
  12. % Everyone is granted permission to copy, modify and redistribute
  13. % Ghostscript, but only under the conditions described in the Ghostscript
  14. % General Public License.  A copy of this license is supposed to have been
  15. % given to you along with Ghostscript so you can know your rights and
  16. % responsibilities.  It should be in a file named COPYING.  Among other
  17. % things, the copyright notice and this notice must be preserved on all
  18. % copies.
  19.  
  20. % Print the CharStrings and Subrs from a Type 1 font in symbolic form.
  21.  
  22. 30 dict dup begin
  23.   1 (hstem) def   3 (vstem) def   4 (vmoveto) def
  24.   5 (rlineto) def   6 (hlineto) def   7 (vlineto) def
  25.   8 (rrcurveto) def   9 (closepath) def   10 (callsubr) def
  26.   11 (return) def   13 (hsbw) def   14 (endchar) def
  27.   21 (rmoveto) def   22 (hmoveto) def   30 (vhcurveto) def
  28.   31 (hvcurveto) def
  29.   32 (dotsection) def   33 (vstem3) def   34 (hstem3) def
  30.   38 (seac) def   39 (sbw) def   44 (div) def
  31.   48 (callothersubr) def   49 (pop) def   65 (setcurrentpoint) def
  32. end /csdict exch def
  33.  
  34. /printcs
  35.  { dup type /stringtype eq
  36.     { printcs1 (\n) print }
  37.     { ( ) print == }
  38.    ifelse
  39.  } bind def
  40. /printcs1
  41.  { 4330 exch dup length string type1decrypt exch pop
  42.    dup /s exch def length /n exch def
  43.    /lenIV where { pop lenIV } { 4 } ifelse
  44.    1 sub
  45.     { 1 add dup n ge { exit } if
  46.       ( ) print dup s exch get
  47.       dup 31 le
  48.        { dup 12 eq { pop 1 add dup s exch get 32 add } if
  49.          dup csdict exch known
  50.       { csdict exch get print }
  51.       { =only (?) print }
  52.      ifelse
  53.        }
  54.        { dup 247 lt
  55.              { 139 sub }
  56.       { dup 255 eq
  57.          { pop 4 add (****)
  58.          }
  59.          { 247 sub {108 364 620 876 -108 -364 -620 -876} exch get
  60.            exch 1 add exch s 2 index get add
  61.          }
  62.         ifelse
  63.       }
  64.      ifelse =only
  65.        }
  66.       ifelse
  67.     } loop
  68.    pop
  69.  } bind def
  70.  
  71. /printfont
  72.  { currentfont begin Private begin 10 dict begin
  73.    CharStrings { exch ==only printcs } forall
  74.    0 1 Subrs length 1 sub
  75.     { dup =only
  76.       Subrs exch get printcs
  77.     } for
  78.    end end end
  79.  } bind def
  80.  
  81. % /Times-Roman findfont setfont
  82. % printfont
  83.