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

  1. %    Copyright (C) 1994, 1995, 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: markhint.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
  14. % markhint.ps
  15. % Draw the hints for a Type 1 font.
  16.  
  17. (type1ops.ps) runlibfile
  18.  
  19. /mhsetup        % <matrix> <print> mhsetup -
  20.  { /mhprint exch def
  21.    /mhmx exch def
  22.    /mhdash 0 9 gsave initmatrix dtransform grestore idtransform add abs def
  23.    gsave
  24.    clippath pathbbox
  25.    2 index sub /bbh exch def
  26.    2 index sub /bbw exch def
  27.    /bby exch def
  28.    /bbx exch def
  29.    grestore
  30.  } def
  31.  
  32. /markfonthints        % <matrix> <print> markfonthints -
  33.  { mhsetup
  34.  } def
  35.  
  36. /hmark            % <y> hmark -
  37.  { bbx exch moveto bbw 0 rlineto stroke
  38.  } def
  39. /hsmark            % <y0> <dy> hsmark -
  40.  { 1 index add exch gsave
  41.    [mhdash] 0 setdash 0 exch mhmx transform exch pop hmark
  42.    [mhdash 2 div dup 2 mul] 0 setdash 0 exch mhmx transform exch pop hmark
  43.    grestore
  44.  } def
  45. /vmark            % <x> vmark -
  46.  { bby moveto 0 bbh rlineto stroke
  47.  } def
  48. /vsmark            % <x0> <dx> vsmark -
  49.  { 1 index add exch gsave
  50.    [mhdash] mhdash setdash 0 mhmx transform pop vmark
  51.    [mhdash 2 div dup 2 mul] 0 setdash 0 mhmx transform pop vmark
  52.    grestore
  53.  } def
  54. /pmark            % <x> <y> pmark -
  55.  { newpath 0 4.5 gsave initmatrix dtransform grestore idtransform add abs
  56.    0 360 arc stroke
  57.  } def
  58. /mchdict mark
  59.   /hsbw { pop 0 mhmx transform translate 0 0 pmark }
  60.   /sbw { pop pop mhmx transform translate 0 0 pmark }
  61.   /hstem
  62.    { mhprint { (hstem ) print 2 copy 2 packedarray == } if
  63.      hsmark
  64.    }
  65.   /vstem
  66.    { mhprint { (vstem ) print 2 copy 2 packedarray == } if
  67.      vsmark
  68.    }
  69.   /hstem3
  70.    { mhprint { (hstem3 ) print 6 copy 6 packedarray == } if
  71.      3 { hsmark } repeat
  72.    }
  73.   /vstem3
  74.    { mhprint { (vstem3 ) print 6 copy 6 packedarray == } if
  75.      3 { vsmark } repeat
  76.    }
  77.   /div
  78.    { div
  79.    }
  80.   /callothersubr
  81.    { 3 eq
  82.       { pop
  83.     mhprint { (replace) = } if
  84.         % We're replacing hints; lighten the color.
  85.     currentrgbcolor 3 { 2 mul 3 div 3 1 roll } repeat setrgbcolor
  86.       }
  87.       { { pop } repeat
  88.       } ifelse
  89.    }
  90.   /callsubr
  91.    { Private /Subrs get exch get mchinterp
  92.    }
  93.   /pop
  94.    {
  95.    }
  96.   /return
  97.    {
  98.    }
  99. .dicttomark def
  100.  
  101. /mchinterp        % <charstring> mchinterp -
  102.  { 4330 exch dup length string .type1decrypt exch pop
  103.    dup length lenIV sub lenIV exch getinterval
  104.    0 () /SubFileDecode filter
  105.    mark exch charstack_read ]
  106.     { dup type /nametype eq
  107.        { mchdict exch .knownget { exec } { cleartomark mark } ifelse
  108.        }
  109.       if
  110.     }
  111.    forall
  112.  } def
  113.  
  114. /markcharhints        % <charname> <matrix> <print> markcharhints -
  115.  { mhsetup
  116.    gsave mark
  117.    /Private currentfont /Private get def
  118.    Private rcheck    % make sure we won't get an access error
  119.     { /lenIV Private /lenIV .knownget not { 4 } if def
  120.       currentfont /CharStrings get 3 -1 roll get mchinterp
  121.     }
  122.     { (Sorry, this font is protected; I can't show the hints.\n) print flush
  123.       exch
  124.     }
  125.    ifelse
  126.    cleartomark grestore
  127.  } def
  128.