gs_typ42.ps 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. % Copyright (C) 1996 Aladdin Enterprises. All rights reserved.
  2. %
  3. % This software is provided AS-IS with no warranty, either express or
  4. % implied.
  5. %
  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.
  9. %
  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.
  15. % $Id: gs_typ42.ps,v 1.7 2004/12/16 12:34:56 igor Exp $
  16. % Type 42 font support code.
  17. % Here are the BuildChar and BuildGlyph implementation for Type 42 fonts.
  18. % The names %Type42BuildChar and %Type42BuildGlyph are known to the
  19. % interpreter. The real work is done in an operator:
  20. % <font> <code|name> <name> <glyphindex> .type42execchar -
  21. (%Type42BuildChar) cvn % <font> <code> %Type42BuildChar -
  22. { 1 index /Encoding get 1 index get .type42build
  23. } bind def
  24. (%Type42BuildGlyph) cvn % <font> <name> %Type42BuildGlyph -
  25. { dup .type42build
  26. } bind def
  27. /.type42build % <font> <code|name> <name> .type42build -
  28. { 2 index begin
  29. dup CharStrings exch .knownget not
  30. { 2 copy eq { exch pop /.notdef exch } if
  31. QUIET not
  32. { (Substituting .notdef for ) print
  33. =string cvs print ( in the font ) print
  34. 1 index /FontName get = flush
  35. }
  36. { pop }
  37. ifelse
  38. /.notdef CharStrings /.notdef get
  39. } if
  40. end .type42execchar
  41. } bind def
  42. % Register the font type for definefont.
  43. buildfontdict 42 /.buildfont42 cvx put