1
0

gs_ccfnt.ps 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. % Copyright (C) 1994, 2000 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_ccfnt.ps,v 1.8 2003/04/12 18:08:18 ray Exp $
  16. % Find and register all the precompiled font operators in systemdict.
  17. /registerfont % <fontname> <fontdict> registerfont <font>
  18. { CCFONTDEBUG { (Registering ) print 1 index = } if
  19. dup begin
  20. Encoding type /nametype eq
  21. { Encoding .findencoding /Encoding exch def
  22. }
  23. if
  24. dup /PrefEnc known
  25. { PrefEnc type /nametype eq
  26. { PrefEnc .findencoding /PrefEnc exch def
  27. }
  28. if
  29. }
  30. if
  31. dup /FDepVector known
  32. { /FDepVector [ FDepVector
  33. { .FontDirectory 1 index .knownget
  34. { exch pop }
  35. { ccfonts 1 index .knownget
  36. { registerfont
  37. }
  38. { Fontmap 1 index known
  39. { findfont }
  40. { pop NullFont }
  41. ifelse
  42. }
  43. ifelse
  44. }
  45. ifelse
  46. }
  47. forall ] readonly def
  48. }
  49. if
  50. end
  51. % Use the value of definefont appropriate at run-time, not bind-time
  52. /definefont load exec
  53. } bind odef
  54. % Bind recursive call (bind descends into oparrays: feature!)
  55. /registerfont dup load bind def
  56. /.loadinitialfonts {
  57. //.loadinitialfonts exec
  58. NOCCFONTS not {
  59. /ccfonts mark
  60. 0 1 null .getccfont 1 sub { .getccfont dup /FontName get exch } for
  61. .dicttomark def
  62. % Make sure these fonts are registered as "resources".
  63. currentfile {
  64. pop ccfonts {
  65. .FontDirectory 2 index known { pop pop } { registerfont pop } ifelse
  66. } forall
  67. } .execasresource
  68. currentdict /ccfonts .undef
  69. } if
  70. } bind def
  71. currentdict /registerfont .undef