home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / os2 / gspm25.zip / pcharstr.ps < prev    next >
Text File  |  1992-08-20  |  2KB  |  56 lines

  1. %    Copyright (C) 1990, 1992 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. % pcharstr.ps
  21. % Print the CharStrings and Subrs (if present) from a Type 1 font,
  22. % in symbolic form.
  23.  
  24. % Load the Type 1 utilities.
  25. (type1ops.ps) run
  26.  
  27. /printcs
  28.  { dup type /stringtype eq
  29.     { printcs1 (\n) print }
  30.     { ( ) print == }
  31.    ifelse
  32.  } bind def
  33. /printcs1
  34.  { 4330 exch dup length string type1decrypt exch pop
  35.    dup length lenIV sub lenIV exch getinterval
  36.    save exch 0 () /SubFileDecode filter
  37.    mark exch charstack_read
  38.    counttomark 1 sub -1 0
  39.     { index ( ) print =only
  40.     }
  41.    for cleartomark restore
  42.  } bind def
  43.  
  44. /printfont
  45.  { currentfont begin Private begin 10 dict begin
  46.    CharStrings { exch ==only printcs } forall
  47.    /Subrs where
  48.     { pop    % the dictionary
  49.       0 1 Subrs length 1 sub
  50.        { dup =only
  51.          Subrs exch get printcs
  52.        } for
  53.     } if
  54.    end end end
  55.  } bind def
  56.