1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
% Copyright (C) 1994, 1995, 1996 Aladdin Enterprises. All rights reserved.
%
% This file is part of GNU Ghostscript.
%
% GNU Ghostscript is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to
% anyone for the consequences of using it or for whether it serves any
% particular purpose or works at all, unless he says so in writing. Refer to
% the GNU General Public License for full details.
%
% Everyone is granted permission to copy, modify and redistribute GNU
% Ghostscript, but only under the conditions described in the GNU General
% Public License. A copy of this license is supposed to have been given to
% you along with GNU Ghostscript so you can know your rights and
% responsibilities. It should be in a file named COPYING. Among other
% things, the copyright notice and this notice must be preserved on all
% copies.
%
% Aladdin Enterprises is not affiliated with the Free Software Foundation or
% the GNU Project. GNU Ghostscript, as distributed by Aladdin Enterprises,
% does not depend on any other GNU software.
% markhint.ps
% Draw the hints for a Type 1 font.
(type1ops.ps) runlibfile
/mhsetup % <matrix> <print> mhsetup -
{ /mhprint exch def
/mhmx exch def
/mhdash 0 9 gsave initmatrix dtransform grestore idtransform add abs def
gsave
clippath pathbbox
2 index sub /bbh exch def
2 index sub /bbw exch def
/bby exch def
/bbx exch def
grestore
} def
/markfonthints % <matrix> <print> markfonthints -
{ mhsetup
} def
/hmark % <y> hmark -
{ bbx exch moveto bbw 0 rlineto stroke
} def
/hsmark % <y0> <dy> hsmark -
{ 1 index add exch gsave
[mhdash] 0 setdash 0 exch mhmx transform exch pop hmark
[mhdash 2 div dup 2 mul] 0 setdash 0 exch mhmx transform exch pop hmark
grestore
} def
/vmark % <x> vmark -
{ bby moveto 0 bbh rlineto stroke
} def
/vsmark % <x0> <dx> vsmark -
{ 1 index add exch gsave
[mhdash] mhdash setdash 0 mhmx transform pop vmark
[mhdash 2 div dup 2 mul] 0 setdash 0 mhmx transform pop vmark
grestore
} def
/pmark % <x> <y> pmark -
{ newpath 0 4.5 gsave initmatrix dtransform grestore idtransform add abs
0 360 arc stroke
} def
/mchdict mark
/hsbw { pop 0 mhmx transform translate 0 0 pmark }
/sbw { pop pop mhmx transform translate 0 0 pmark }
/hstem
{ mhprint { (hstem ) print 2 copy 2 packedarray == } if
hsmark
}
/vstem
{ mhprint { (vstem ) print 2 copy 2 packedarray == } if
vsmark
}
/hstem3
{ mhprint { (hstem3 ) print 6 copy 6 packedarray == } if
3 { hsmark } repeat
}
/vstem3
{ mhprint { (vstem3 ) print 6 copy 6 packedarray == } if
3 { vsmark } repeat
}
/div
{ div
}
/callothersubr
{ 3 eq
{ pop
mhprint { (replace) = } if
% We're replacing hints; lighten the color.
currentrgbcolor 3 { 2 mul 3 div 3 1 roll } repeat setrgbcolor
}
{ { pop } repeat
} ifelse
}
/callsubr
{ Private /Subrs get exch get mchinterp
}
/pop
{
}
/return
{
}
.dicttomark def
/mchinterp % <charstring> mchinterp -
{ 4330 exch dup length string .type1decrypt exch pop
dup length lenIV sub lenIV exch getinterval
0 () /SubFileDecode filter
mark exch charstack_read ]
{ dup type /nametype eq
{ mchdict exch .knownget { exec } { cleartomark mark } ifelse
}
if
}
forall
} def
/markcharhints % <charname> <matrix> <print> markcharhints -
{ mhsetup
gsave mark
/Private currentfont /Private get def
Private rcheck % make sure we won't get an access error
{ /lenIV Private /lenIV .knownget not { 4 } if def
currentfont /CharStrings get 3 -1 roll get mchinterp
}
{ (Sorry, this font is protected; I can't show the hints.\n) print flush
exch
}
ifelse
cleartomark grestore
} def
|