home *** CD-ROM | disk | FTP | other *** search
/ jppd.dyndns.org / jppd.dyndns.org.tar / jppd.dyndns.org / QUERYPRO / Impressora_PDF / converter.exe / GPLGS / showchar.ps < prev    next >
Text File  |  2002-02-22  |  3KB  |  94 lines

  1. %    Copyright (C) 1993, 1994, 1996 Aladdin Enterprises.  All rights reserved.
  2. % This software is provided AS-IS with no warranty, either express or
  3. % implied.
  4. % This software is distributed under license and may not be copied,
  5. % modified or distributed except as expressly authorized under the terms
  6. % of the license contained in the file LICENSE in this distribution.
  7. % For more information about licensing, please refer to
  8. % http://www.ghostscript.com/licensing/. For information on
  9. % commercial licensing, go to http://www.artifex.com/licensing/ or
  10. % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. % San Rafael, CA  94903, U.S.A., +1(415)492-9861.
  12.  
  13. % $Id: showchar.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
  14. % showchar.ps
  15. % Show the outline and rasterized forms of a character.
  16.  
  17. /F where { pop } { /F /Times-Roman def } ifelse
  18. /P where { pop } { /P 16 def } ifelse
  19. /Rx where { pop } { /Rx 100 def } ifelse
  20. /Ry where { pop } { /Ry 100 def } ifelse
  21. /Cs where { pop } { /Cs (M) def } ifelse
  22. /Pr where { pop } { /Pr false def } ifelse
  23. /Delay where { pop } { /Delay 0 def } ifelse
  24.  
  25. 0 setgray
  26. (markpath.ps) runlibfile
  27. (markhint.ps) runlibfile
  28. /mmx [1 0 0 1 0 0] def
  29. /getpath        % - getpath <pathproc>
  30.  { [
  31.     { /moveto cvx } { /lineto cvx } { /curveto cvx } { /closepath cvx }
  32.    pathforall
  33.    ] cvx
  34.  } def
  35. /bitselectfont        % <fontname> <scale> bitselectfont -
  36.  { exch findfont exch scalefont setfont
  37.     % Compute the bounding box in device coordinates.
  38.    gsave [Rx 72 div 0 0 Ry 72 div 0 0] setmatrix
  39.    currentfont /FontMatrix get concat
  40.    currentfont /FontBBox get aload pop
  41.    transform ceiling cvi /ury exch def ceiling cvi /urx exch def
  42.    transform floor cvi /lly exch def floor cvi /llx exch def
  43.    /bbx urx llx sub def /bby ury lly sub def
  44.    grestore
  45.  } def
  46. /bitshow        % <string> bitshow -
  47.  { /S exch def gsave
  48.    /W bbx 8 add 7 or 1 add def
  49.    /H bby 8 add def
  50.    /buf W 8 idiv string def
  51.    /M [Rx 72 div 0 0 Ry -72 div 4 llx sub H 4 sub] def
  52.    M W H <ff 00> makeimagedevice
  53.    /dev exch def
  54.    gsave dev setdevice
  55.    newpath 0 lly idtransform moveto
  56.    0 setgray
  57.    gsave
  58.      /hpath S false charpath getpath def
  59.    grestore
  60.    S show grestore
  61.    20 20 translate
  62.    50000 Rx Ry .max P mul div dup scale
  63.    0.7 setgray
  64.    0 W H true M
  65.     { dup 1 add exch dev exch buf copyscanlines
  66.     } imagemask pop
  67.    0 setlinewidth
  68.    gsave 0.5 1 0.5 setrgbcolor hpath exec mmx markpath grestore
  69.    0 0.5 1 setrgbcolor hpath exec stroke
  70.     % Show the hints for Type 1 fonts also.
  71.    currentfont /FontType get 1 eq
  72.     { gsave 1 0 0 setrgbcolor
  73.       0 lly M idtransform translate
  74.       currentfont /FontMatrix get
  75.       dup Pr markfonthints
  76.       currentfont /Encoding get S 0 get get exch Pr markcharhints
  77.       grestore
  78.     }
  79.    if
  80.  } def
  81. F P bitselectfont
  82. /S1 1 string def
  83. Cs
  84.  { /C exch def
  85.    currentfont /Encoding get C get /.notdef ne
  86.     { save S1 0 C put S1 bitshow
  87.       showpage restore
  88.     } if
  89.  } forall
  90. quit
  91.