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