home *** CD-ROM | disk | FTP | other *** search
/ jppd.dyndns.org / jppd.dyndns.org.tar / jppd.dyndns.org / QUERYPRO / Impressora_PDF / converter.exe / GPLGS / winmaps.ps < prev    next >
Text File  |  2002-02-22  |  4KB  |  107 lines

  1. %    Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2. % This software is provided AS-IS with no warranty, either express or
  3. % implied.
  4. % This software is distributed under license and may not be copied,
  5. % modified or distributed except as expressly authorized under the terms
  6. % of the license contained in the file LICENSE in this distribution.
  7. % For more information about licensing, please refer to
  8. % http://www.ghostscript.com/licensing/. For information on
  9. % commercial licensing, go to http://www.artifex.com/licensing/ or
  10. % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. % San Rafael, CA  94903, U.S.A., +1(415)492-9861.
  12.  
  13. % $Id: winmaps.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
  14. % winmaps.ps - make maps between PostScript encodings and Windows
  15. % character sets.
  16.  
  17. % Define the two Windows encodings.
  18.  
  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.  
  25. /OEMEncoding [
  26.   /.notdef /.notdef /.notdef /heart /diamond /club /spade /bullet
  27.     8 { /.notdef } repeat
  28.   /.notdef /.notdef /.notdef /.notdef /paragraph /section /.notdef /.notdef
  29.     /arrowup /arrowdown /arrowright /arrowleft /.notdef /arrowboth /.notdef /.notdef
  30.   StandardEncoding 32 96 getinterval aload pop
  31.   /Ccedilla /udieresis /eacute /acircumflex /adieresis /agrave /aring /ccedilla
  32.     /ecircumflex /edieresis /egrave /idieresis /igrave /Adieresis /Aring
  33.   /Eacute /ae /AE /ocircumflex /odieresis /ograve /ucircumflex /ugrave
  34.     /ydieresis /Odieresis /Udieresis /cent /sterling /yen /.notdef /florin
  35.   /aacute /iacute /oacute /uacute /ntilde /Ntilde /ordfeminine /ordmasculine
  36.     /questiondown /.notdef /logicalnot /onehalf /onequarter /exclamdown /guillemotleft /guillemotright
  37.   48 { /.notdef } repeat
  38.   /alpha /beta /Gamma /Pi /Sigma /sigma /mu /tau
  39.     /Phi /Theta /Omega /delta /infinity /phi /element /intersection
  40.   /equivalence /plusminus /greaterequal /lessequal /integraltp /integralbt /divide /.notdef
  41.     /degree /dotmath /periodcentered /radical /.notdef /twosuperior /.notdef /.notdef
  42. ] def
  43.  
  44. % Utility procedures
  45.  
  46. /invertencoding        % <array> invertencoding <dict>
  47.  { 256 dict exch dup length 1 sub -1 0
  48.     {    % stack: dict array index
  49.       2 copy get /.notdef ne
  50.        { 2 copy get exch 3 index 3 1 roll put }
  51.        { pop }
  52.       ifelse
  53.     } for
  54.    pop
  55.  } def
  56.  
  57. /pmarray 256 array def
  58. /printmap        % <chars> <decode> printmap -
  59.  { mark 3 1 roll exch
  60.     { 2 copy known { 1 index exch get } { pop 0 } ifelse exch
  61.     }
  62.    forall pop
  63.    pmarray 0 counttomark 2 sub getinterval astore
  64.    ([) print dup length =only 0 exch (] = {\n  ) exch
  65.     { exch print =only
  66.       1 add 15 and dup 0 eq { (,\n  ) } { (, ) } ifelse
  67.     }
  68.    forall pop pop (\n};\n) print pop
  69.  } def
  70.  
  71. /decodeStd StandardEncoding invertencoding def
  72. /decodeISO ISOLatin1Encoding
  73.     % Remove the redundant characters
  74.   dup length array copy
  75.   [8#222 8#225 8#230 8#233 8#240] { 2 copy /.notdef put pop } forall
  76. invertencoding def
  77. /decodeSym SymbolEncoding invertencoding def
  78.  
  79. /decodeANSI ANSIEncoding invertencoding def
  80. /decodeOEM OEMEncoding invertencoding def
  81.  
  82. % Construct the map from Symbol to OEM.
  83.  
  84. (\nprivate const byte far_data gs_map_symbol_to_oem) print
  85. SymbolEncoding decodeOEM printmap
  86.  
  87. % Construct the map from ISOLatin1 to OEM.
  88.  
  89. (\nprivate const byte far_data gs_map_iso_to_oem) print
  90. ISOLatin1Encoding decodeOEM printmap
  91.  
  92. % Construct the map from Standard to ISOLatin1.
  93.  
  94. (\nprivate const byte far_data gs_map_std_to_iso) print
  95. StandardEncoding decodeISO printmap
  96.  
  97. % Construct the map from ISOLatin1 to Standard.
  98. % The Windows driver doesn't need this, but the X11 driver does.
  99.  
  100. (\nprivate const byte far_data gs_map_iso_to_std) print
  101. ISOLatin1Encoding decodeStd printmap
  102.  
  103. quit
  104.