home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 February / INTERNET88.ISO / pc / software / windows / bits / pdf995 / data1.cab / Program_Executable_Files / res / winmaps.ps < prev    next >
Encoding:
Text File  |  2001-12-08  |  4.0 KB  |  110 lines

  1. %    Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2. % This file is part of GNU Ghostscript.
  3. % GNU Ghostscript is distributed in the hope that it will be useful, but
  4. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  5. % to anyone for the consequences of using it or for whether it serves any
  6. % particular purpose or works at all, unless he says so in writing.  Refer
  7. % to the GNU General Public License for full details.
  8. % Everyone is granted permission to copy, modify and redistribute GNU
  9. % Ghostscript, but only under the conditions described in the GNU General
  10. % Public License.  A copy of this license is supposed to have been given
  11. % to you along with GNU Ghostscript so you can know your rights and
  12. % responsibilities.  It should be in a file named COPYING.  Among other
  13. % things, the copyright notice and this notice must be preserved on all
  14. % copies.
  15.  
  16. % $RCSfile: winmaps.ps,v $ $Revision: 1.2.2.1 $
  17. % winmaps.ps - make maps between PostScript encodings and Windows
  18. % character sets.
  19.  
  20. % Define the two Windows encodings.
  21.  
  22. /ANSIEncoding
  23.   ISOLatin1Encoding 256 array copy
  24.   dup 16#90 /.notdef put
  25.   16#93 1 16#9f { 2 copy /.notdef put pop } for
  26. def
  27.  
  28. /OEMEncoding [
  29.   /.notdef /.notdef /.notdef /heart /diamond /club /spade /bullet
  30.     8 { /.notdef } repeat
  31.   /.notdef /.notdef /.notdef /.notdef /paragraph /section /.notdef /.notdef
  32.     /arrowup /arrowdown /arrowright /arrowleft /.notdef /arrowboth /.notdef /.notdef
  33.   StandardEncoding 32 96 getinterval aload pop
  34.   /Ccedilla /udieresis /eacute /acircumflex /adieresis /agrave /aring /ccedilla
  35.     /ecircumflex /edieresis /egrave /idieresis /igrave /Adieresis /Aring
  36.   /Eacute /ae /AE /ocircumflex /odieresis /ograve /ucircumflex /ugrave
  37.     /ydieresis /Odieresis /Udieresis /cent /sterling /yen /.notdef /florin
  38.   /aacute /iacute /oacute /uacute /ntilde /Ntilde /ordfeminine /ordmasculine
  39.     /questiondown /.notdef /logicalnot /onehalf /onequarter /exclamdown /guillemotleft /guillemotright
  40.   48 { /.notdef } repeat
  41.   /alpha /beta /Gamma /Pi /Sigma /sigma /mu /tau
  42.     /Phi /Theta /Omega /delta /infinity /phi /element /intersection
  43.   /equivalence /plusminus /greaterequal /lessequal /integraltp /integralbt /divide /.notdef
  44.     /degree /dotmath /periodcentered /radical /.notdef /twosuperior /.notdef /.notdef
  45. ] def
  46.  
  47. % Utility procedures
  48.  
  49. /invertencoding        % <array> invertencoding <dict>
  50.  { 256 dict exch dup length 1 sub -1 0
  51.     {    % stack: dict array index
  52.       2 copy get /.notdef ne
  53.        { 2 copy get exch 3 index 3 1 roll put }
  54.        { pop }
  55.       ifelse
  56.     } for
  57.    pop
  58.  } def
  59.  
  60. /pmarray 256 array def
  61. /printmap        % <chars> <decode> printmap -
  62.  { mark 3 1 roll exch
  63.     { 2 copy known { 1 index exch get } { pop 0 } ifelse exch
  64.     }
  65.    forall pop
  66.    pmarray 0 counttomark 2 sub getinterval astore
  67.    ([) print dup length =only 0 exch (] = {\n  ) exch
  68.     { exch print =only
  69.       1 add 15 and dup 0 eq { (,\n  ) } { (, ) } ifelse
  70.     }
  71.    forall pop pop (\n};\n) print pop
  72.  } def
  73.  
  74. /decodeStd StandardEncoding invertencoding def
  75. /decodeISO ISOLatin1Encoding
  76.     % Remove the redundant characters
  77.   dup length array copy
  78.   [8#222 8#225 8#230 8#233 8#240] { 2 copy /.notdef put pop } forall
  79. invertencoding def
  80. /decodeSym SymbolEncoding invertencoding def
  81.  
  82. /decodeANSI ANSIEncoding invertencoding def
  83. /decodeOEM OEMEncoding invertencoding def
  84.  
  85. % Construct the map from Symbol to OEM.
  86.  
  87. (\nprivate const byte far_data gs_map_symbol_to_oem) print
  88. SymbolEncoding decodeOEM printmap
  89.  
  90. % Construct the map from ISOLatin1 to OEM.
  91.  
  92. (\nprivate const byte far_data gs_map_iso_to_oem) print
  93. ISOLatin1Encoding decodeOEM printmap
  94.  
  95. % Construct the map from Standard to ISOLatin1.
  96.  
  97. (\nprivate const byte far_data gs_map_std_to_iso) print
  98. StandardEncoding decodeISO printmap
  99.  
  100. % Construct the map from ISOLatin1 to Standard.
  101. % The Windows driver doesn't need this, but the X11 driver does.
  102.  
  103. (\nprivate const byte far_data gs_map_iso_to_std) print
  104. ISOLatin1Encoding decodeStd printmap
  105.  
  106. quit
  107.