From e463eb40363ff4c68b1d903f4e0cdd0ac1c5977f Mon Sep 17 00:00:00 2001 From: Taru Karttunen Date: Wed, 30 Mar 2011 16:53:33 +0300 Subject: Import sources from 2011-03-30 iso image - sys/lib --- sys/lib/ghostscript/markhint.ps | 130 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100755 sys/lib/ghostscript/markhint.ps (limited to 'sys/lib/ghostscript/markhint.ps') diff --git a/sys/lib/ghostscript/markhint.ps b/sys/lib/ghostscript/markhint.ps new file mode 100755 index 000000000..94a69769b --- /dev/null +++ b/sys/lib/ghostscript/markhint.ps @@ -0,0 +1,130 @@ +% Copyright (C) 1994, 1995, 1996 Aladdin Enterprises. All rights reserved. +% +% This software is provided AS-IS with no warranty, either express or +% implied. +% +% This software is distributed under license and may not be copied, +% modified or distributed except as expressly authorized under the terms +% of the license contained in the file LICENSE in this distribution. +% +% For more information about licensing, please refer to +% http://www.ghostscript.com/licensing/. For information on +% commercial licensing, go to http://www.artifex.com/licensing/ or +% contact Artifex Software, Inc., 101 Lucas Valley Road #110, +% San Rafael, CA 94903, U.S.A., +1(415)492-9861. + +% $Id: markhint.ps,v 1.4 2002/02/21 21:49:28 giles Exp $ +% markhint.ps +% Draw the hints for a Type 1 font. + +(type1ops.ps) runlibfile + +/mhsetup % 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 % markfonthints - + { mhsetup + } def + +/hmark % hmark - + { bbx exch moveto bbw 0 rlineto stroke + } def +/hsmark % 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 % vmark - + { bby moveto 0 bbh rlineto stroke + } def +/vsmark % 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 % 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 % 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 % 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 -- cgit v1.2.3