1
0

winmaps.ps 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. % Copyright (C) 1993 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: winmaps.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
  16. % winmaps.ps - make maps between PostScript encodings and Windows
  17. % character sets.
  18. % Define the two Windows encodings.
  19. /ANSIEncoding
  20. ISOLatin1Encoding 256 array copy
  21. dup 16#90 /.notdef put
  22. 16#93 1 16#9f { 2 copy /.notdef put pop } for
  23. def
  24. /OEMEncoding [
  25. /.notdef /.notdef /.notdef /heart /diamond /club /spade /bullet
  26. 8 { /.notdef } repeat
  27. /.notdef /.notdef /.notdef /.notdef /paragraph /section /.notdef /.notdef
  28. /arrowup /arrowdown /arrowright /arrowleft /.notdef /arrowboth /.notdef /.notdef
  29. StandardEncoding 32 96 getinterval aload pop
  30. /Ccedilla /udieresis /eacute /acircumflex /adieresis /agrave /aring /ccedilla
  31. /ecircumflex /edieresis /egrave /idieresis /igrave /Adieresis /Aring
  32. /Eacute /ae /AE /ocircumflex /odieresis /ograve /ucircumflex /ugrave
  33. /ydieresis /Odieresis /Udieresis /cent /sterling /yen /.notdef /florin
  34. /aacute /iacute /oacute /uacute /ntilde /Ntilde /ordfeminine /ordmasculine
  35. /questiondown /.notdef /logicalnot /onehalf /onequarter /exclamdown /guillemotleft /guillemotright
  36. 48 { /.notdef } repeat
  37. /alpha /beta /Gamma /Pi /Sigma /sigma /mu /tau
  38. /Phi /Theta /Omega /delta /infinity /phi /element /intersection
  39. /equivalence /plusminus /greaterequal /lessequal /integraltp /integralbt /divide /.notdef
  40. /degree /dotmath /periodcentered /radical /.notdef /twosuperior /.notdef /.notdef
  41. ] def
  42. % Utility procedures
  43. /invertencoding % <array> invertencoding <dict>
  44. { 256 dict exch dup length 1 sub -1 0
  45. { % stack: dict array index
  46. 2 copy get /.notdef ne
  47. { 2 copy get exch 3 index 3 1 roll put }
  48. { pop }
  49. ifelse
  50. } for
  51. pop
  52. } def
  53. /pmarray 256 array def
  54. /printmap % <chars> <decode> printmap -
  55. { mark 3 1 roll exch
  56. { 2 copy known { 1 index exch get } { pop 0 } ifelse exch
  57. }
  58. forall pop
  59. pmarray 0 counttomark 2 sub getinterval astore
  60. ([) print dup length =only 0 exch (] = {\n ) exch
  61. { exch print =only
  62. 1 add 15 and dup 0 eq { (,\n ) } { (, ) } ifelse
  63. }
  64. forall pop pop (\n};\n) print pop
  65. } def
  66. /decodeStd StandardEncoding invertencoding def
  67. /decodeISO ISOLatin1Encoding
  68. % Remove the redundant characters
  69. dup length array copy
  70. [8#222 8#225 8#230 8#233 8#240] { 2 copy /.notdef put pop } forall
  71. invertencoding def
  72. /decodeSym SymbolEncoding invertencoding def
  73. /decodeANSI ANSIEncoding invertencoding def
  74. /decodeOEM OEMEncoding invertencoding def
  75. % Construct the map from Symbol to OEM.
  76. (\nprivate const byte far_data gs_map_symbol_to_oem) print
  77. SymbolEncoding decodeOEM printmap
  78. % Construct the map from ISOLatin1 to OEM.
  79. (\nprivate const byte far_data gs_map_iso_to_oem) print
  80. ISOLatin1Encoding decodeOEM printmap
  81. % Construct the map from Standard to ISOLatin1.
  82. (\nprivate const byte far_data gs_map_std_to_iso) print
  83. StandardEncoding decodeISO printmap
  84. % Construct the map from ISOLatin1 to Standard.
  85. % The Windows driver doesn't need this, but the X11 driver does.
  86. (\nprivate const byte far_data gs_map_iso_to_std) print
  87. ISOLatin1Encoding decodeStd printmap
  88. quit