1 % Copyright (C) 1994, 1995, 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: markhint.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
18 % Draw the hints for a Type 1 font.
20 (type1ops.ps) runlibfile
22 /mhsetup % <matrix> <print> mhsetup -
25 /mhdash 0 9 gsave initmatrix dtransform grestore idtransform add abs def
28 2 index sub /bbh exch def
29 2 index sub /bbw exch def
35 /markfonthints % <matrix> <print> markfonthints -
40 { bbx exch moveto bbw 0 rlineto stroke
42 /hsmark % <y0> <dy> hsmark -
43 { 1 index add exch gsave
44 [mhdash] 0 setdash 0 exch mhmx transform exch pop hmark
45 [mhdash 2 div dup 2 mul] 0 setdash 0 exch mhmx transform exch pop hmark
49 { bby moveto 0 bbh rlineto stroke
51 /vsmark % <x0> <dx> vsmark -
52 { 1 index add exch gsave
53 [mhdash] mhdash setdash 0 mhmx transform pop vmark
54 [mhdash 2 div dup 2 mul] 0 setdash 0 mhmx transform pop vmark
57 /pmark % <x> <y> pmark -
58 { newpath 0 4.5 gsave initmatrix dtransform grestore idtransform add abs
62 /hsbw { pop 0 mhmx transform translate 0 0 pmark }
63 /sbw { pop pop mhmx transform translate 0 0 pmark }
65 { mhprint { (hstem ) print 2 copy 2 packedarray == } if
69 { mhprint { (vstem ) print 2 copy 2 packedarray == } if
73 { mhprint { (hstem3 ) print 6 copy 6 packedarray == } if
77 { mhprint { (vstem3 ) print 6 copy 6 packedarray == } if
86 mhprint { (replace) = } if
87 % We're replacing hints; lighten the color.
88 currentrgbcolor 3 { 2 mul 3 div 3 1 roll } repeat setrgbcolor
94 { Private /Subrs get exch get mchinterp
104 /mchinterp % <charstring> mchinterp -
105 { 4330 exch dup length string .type1decrypt exch pop
106 dup length lenIV sub lenIV exch getinterval
107 0 () /SubFileDecode filter
108 mark exch charstack_read ]
109 { dup type /nametype eq
110 { mchdict exch .knownget { exec } { cleartomark mark } ifelse
117 /markcharhints % <charname> <matrix> <print> markcharhints -
120 /Private currentfont /Private get def
121 Private rcheck % make sure we won't get an access error
122 { /lenIV Private /lenIV .knownget not { 4 } if def
123 currentfont /CharStrings get 3 -1 roll get mchinterp
125 { (Sorry, this font is protected; I can't show the hints.\n) print flush