1 % Copyright (C) 1994, 1995, 1996 Aladdin Enterprises. All rights reserved.
3 % This software is provided AS-IS with no warranty, either express or
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.
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.
16 % $Id: gs_kanji.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
17 % Scaffolding for Kanji fonts. This is based on the Wadalab free font
18 % from the University of Tokyo; it may not be appropriate for other
22 { pop currentglobal { setglobal } true setglobal }
26 % Define the encoding for the root font.
37 9 10 11 12 13 14 15 16
38 17 18 19 20 21 22 23 24
40 25 26 27 28 29 30 31 32
41 33 34 35 36 37 38 39 40
42 41 42 43 44 45 46 47 48
43 49 50 51 52 53 54 55 56
45 57 58 59 60 61 62 63 64
46 65 66 67 68 69 70 71 72
57 9 10 11 12 13 14 15 16
58 17 18 19 20 21 22 23 24
60 25 26 27 28 29 30 31 32
61 33 34 35 36 37 38 39 40
62 41 42 43 44 45 46 47 48
63 49 50 51 52 53 54 55 56
65 57 58 59 60 61 62 63 64
66 65 66 67 68 69 70 71 72
71 % Define a stub for the base font encoding.
73 /KanjiSubEncoding { /KanjiSubEncoding .findencoding } bind def
74 %% Replace 3 (gs_ksb_e.ps)
75 EncodingDirectory /KanjiSubEncoding
76 { (gs_ksb_e.ps) //systemdict begin runlibfile KanjiSubEncoding end }
79 % Support procedures and data.
81 /T1FontInfo 8 dict begin
82 /version (001.001) readonly def
83 /FullName (KanjiBase) readonly def
84 /FamilyName (KanjiBase) readonly def
85 /Weight (Medium) readonly def
87 /isFixedPitch false def
88 /UnderlinePosition 0 def
89 /UnderlineThickness 0 def
90 currentdict end readonly def
92 /T1NF % <fontname> T1NF <font>
97 /FontInfo T1FontInfo def
98 /FontMatrix [.001 0 0 .001 0 0] def
99 /FontBBox [0 0 1000 1000] def
100 /Encoding KanjiSubEncoding def
101 /CharStrings 150 dict def
108 FontName currentdict end definefont
111 /T0NF % <fontname> T0NF <font>
117 /FontMatrix [1 0 0 1 0 0] def
119 /Encoding KanjiEncoding def
120 FontName currentdict end definefont
123 % Define the composite font and all the base fonts.
125 /CompNF % <fontname> CompNF <font>
128 newname1 dup length string cvs /str exch def
129 str length /len exch def
130 /fdepvector 78 array def
134 KanjiEncoding i get 0 gt {
135 len 4 add string /newstr exch def
136 newstr 0 str putinterval
137 newstr len (.r) putinterval
138 newstr len 2 add i 16 2 string cvrs putinterval
139 newstr cvn /newlit exch def
140 newlit T1NF /newfont exch def
141 fdepvector j newfont put
145 fdepvector 0 fdepvector 1 get put
147 fdepvector newname1 T0NF
150 % Define an individual character in a composite font.
151 /CompD % <charstring> <(HL)> CompD -
152 { currentfont /Encoding get 1 index 0 get get % FDepVector index
153 currentfont /FDepVector get exch get % base font
154 dup /Encoding get 3 -1 roll 1 get get % base font character name
155 exch /CharStrings get exch 3 -1 roll put