星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gs_typ42.ps 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 8954 2008-08-08 04:22:38Z ray $
  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
  44. { % check for bogus sfnts -- this happens in Genoa FTS 421-01.ps
  45. dup /sfnts get 0 get length 14 lt { % smallest valid sfnts is 14 bytes
  46. % HACK: Add a BuildGlyph and make this a Type 3 font instead
  47. dup /FontType 3 put
  48. dup /BuildGlyph {
  49. 1 index /CharStrings get exch 2 copy known not { pop /.notdef } if get exec
  50. } bind put
  51. //.buildfont3 exec
  52. } {
  53. systemdict /.buildfont42 get exec
  54. } ifelse
  55. } bind
  56. put