gs_typ42.ps 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. % Copyright (C) 1996 Aladdin Enterprises. All rights reserved.
  2. %
  3. % This file is part of AFPL Ghostscript.
  4. %
  5. % AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  6. % distributor accepts any responsibility for the consequences of using it, or
  7. % for whether it serves any particular purpose or works at all, unless he or
  8. % she says so in writing. Refer to the Aladdin Free Public License (the
  9. % "License") for full details.
  10. %
  11. % Every copy of AFPL Ghostscript must include a copy of the License, normally
  12. % in a plain ASCII text file named PUBLIC. The License grants you the right
  13. % to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14. % conditions described in the License. Among other things, the License
  15. % requires that the copyright notice and this notice be preserved on all
  16. % copies.
  17. % $Id: gs_typ42.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
  18. % Type 42 font support code.
  19. % Here are the BuildChar and BuildGlyph implementation for Type 42 fonts.
  20. % The names %Type42BuildChar and %Type42BuildGlyph are known to the
  21. % interpreter. The real work is done in an operator:
  22. % <font> <code|name> <name> <glyphindex> .type42execchar -
  23. (%Type42BuildChar) cvn % <font> <code> %Type42BuildChar -
  24. { 1 index /Encoding get 1 index get .type42build
  25. } bind def
  26. (%Type42BuildGlyph) cvn % <font> <name> %Type42BuildGlyph -
  27. { dup .type42build
  28. } bind def
  29. /.type42build % <font> <code|name> <name> .type42build -
  30. { 2 index begin
  31. dup CharStrings exch .knownget not
  32. { 2 copy eq { exch pop /.notdef exch } if
  33. QUIET not
  34. { (Substituting .notdef for ) print = flush }
  35. { pop }
  36. ifelse
  37. /.notdef CharStrings /.notdef get
  38. } if
  39. end .type42execchar
  40. } bind def
  41. % Register the font type for definefont.
  42. buildfontdict 42 /.buildfont42 cvx put