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

  1. %    Copyright (C) 1994, 1995, 1996 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: gs_kanji.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
  14. % Scaffolding for Kanji fonts.  This is based on the Wadalab free font
  15. % from the University of Tokyo; it may not be appropriate for other
  16. % Kanji fonts.
  17.  
  18. /currentglobal where
  19.  { pop currentglobal { setglobal } true setglobal }
  20.  { { } }
  21. ifelse
  22.  
  23. % Define the encoding for the root font.
  24.  
  25. /KanjiEncoding
  26. % \x00
  27.     0    0    0    0    0    0    0    0
  28.     0    0    0    0    0    0    0    0
  29.     0    0    0    0    0    0    0    0
  30.     0    0    0    0    0    0    0    0
  31. % \x20
  32.     0    1    2    3    4    5    6    7
  33.     8    0    0    0    0    0    0    0
  34.     9    10    11    12    13    14    15    16
  35.     17    18    19    20    21    22    23    24
  36. % \x40
  37.     25    26    27    28    29    30    31    32
  38.     33    34    35    36    37    38    39    40
  39.     41    42    43    44    45    46    47    48
  40.     49    50    51    52    53    54    55    56
  41. % \x60
  42.     57    58    59    60    61    62    63    64
  43.     65    66    67    68    69    70    71    72
  44.     73    74    75    76    77    0    0    0
  45.     0    0    0    0    0    0    0    0
  46. % \x80
  47.     0    0    0    0    0    0    0    0
  48.     0    0    0    0    0    0    0    0
  49.     0    0    0    0    0    0    0    0
  50.     0    0    0    0    0    0    0    0
  51. % \xA0
  52.     0    1    2    3    4    5    6    7
  53.     8    0    0    0    0    0    0    0
  54.     9    10    11    12    13    14    15    16
  55.     17    18    19    20    21    22    23    24
  56. % \xC0
  57.     25    26    27    28    29    30    31    32
  58.     33    34    35    36    37    38    39    40
  59.     41    42    43    44    45    46    47    48
  60.     49    50    51    52    53    54    55    56
  61. % \xE0
  62.     57    58    59    60    61    62    63    64
  63.     65    66    67    68    69    70    71    72
  64.     73    74    75    76    77    0    0    0
  65.     0    0    0    0    0    0    0    0
  66. 256 packedarray def
  67.  
  68. % Define a stub for the base font encoding.
  69.  
  70.   /KanjiSubEncoding { /KanjiSubEncoding .findencoding } bind def
  71. %% Replace 3 (gs_ksb_e.ps)
  72.   EncodingDirectory /KanjiSubEncoding
  73.    { (gs_ksb_e.ps) //systemdict begin runlibfile KanjiSubEncoding end }
  74.   bind put
  75.  
  76. % Support procedures and data.
  77.  
  78. /T1FontInfo 8 dict begin
  79.   /version (001.001) readonly def
  80.   /FullName (KanjiBase) readonly def
  81.   /FamilyName (KanjiBase) readonly def
  82.   /Weight (Medium) readonly def
  83.   /ItalicAngle 0 def
  84.   /isFixedPitch false def
  85.   /UnderlinePosition 0 def
  86.   /UnderlineThickness 0 def
  87. currentdict end readonly def
  88.  
  89. /T1NF            % <fontname> T1NF <font>
  90. {
  91. 20 dict begin
  92.   /FontName exch def
  93.   /FontType 1 def
  94.   /FontInfo T1FontInfo def
  95.   /FontMatrix [.001 0 0 .001 0 0] def
  96.   /FontBBox [0 0 1000 1000] def
  97.   /Encoding KanjiSubEncoding def
  98.   /CharStrings 150 dict def
  99.   /PaintType 0 def
  100.   /Private 2 dict def
  101.   Private begin
  102.     /BlueValues [] def
  103.     /password 5839 def
  104.   end
  105. FontName currentdict end definefont
  106. } def
  107.  
  108. /T0NF            % <fontname> T0NF <font>
  109. {
  110. 20 dict begin
  111.   /FontName exch def
  112.   /FDepVector exch def
  113.   /FontType 0 def
  114.   /FontMatrix [1 0 0 1 0 0] def
  115.   /FMapType 2 def
  116.   /Encoding KanjiEncoding def
  117. FontName currentdict end definefont
  118. } def
  119.  
  120. % Define the composite font and all the base fonts.
  121.  
  122. /CompNF            % <fontname> CompNF <font>
  123. {
  124. /newname1 exch def
  125. newname1 dup length string cvs /str exch def
  126. str length /len exch def
  127. /fdepvector 78 array def 
  128. /j 1 def
  129. 16#21 1 16#74 {
  130. /i exch def
  131. KanjiEncoding i get 0 gt {
  132. len 4 add string /newstr exch def
  133. newstr 0 str putinterval
  134. newstr len (.r) putinterval
  135. newstr len 2 add  i 16 2 string cvrs putinterval
  136. newstr cvn /newlit exch def
  137. newlit T1NF /newfont exch def
  138. fdepvector j newfont put
  139. /j j 1 add def
  140. } if
  141. } for
  142. fdepvector 0 fdepvector 1 get put
  143. /j 0 def
  144. fdepvector newname1 T0NF
  145. } def
  146.  
  147. % Define an individual character in a composite font.
  148. /CompD            % <charstring> <(HL)> CompD -
  149.  { currentfont /Encoding get 1 index 0 get get    % FDepVector index
  150.    currentfont /FDepVector get exch get        % base font
  151.    dup /Encoding get 3 -1 roll 1 get get    % base font character name
  152.    exch /CharStrings get exch 3 -1 roll put
  153.  } bind def
  154.  
  155. exec
  156.