summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/kanji/kmapping.ps
blob: 9c3c94232dfd7a7c6db34f96ffd9b86d75d5dbcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
%
% Mapping from character names to Kanji JIS code
%
% Apr.10,1992 Written by N.Katayama
%

%
% JIS
%

/JISMappingDict 94 dict begin
	3 string dup 0 (c) putinterval dup 1 2 getinterval
	16#21 1 16#7E {
		dup 16 3 index cvrs pop
		2 index cvn exch def
	} for
	pop pop
currentdict end readonly def

%
% Shift JIS
%

/SJMappingDict 188 dict begin
	3 string dup 0 (c) putinterval dup 1 2 getinterval
	16#40 1 16#7E {
		dup 16 3 index cvrs pop
		16#40 sub 16#21 add
		2 index cvn exch def
	} for
	16#80 1 16#9E {
		dup 16 3 index cvrs pop
		16#80 sub 16#60 add
		2 index cvn exch def
	} for
	16#9F 1 16#FC {
		dup 16 3 index cvrs pop
		16#9F sub 16#0121 add
		2 index cvn exch def
	} for
	pop pop
currentdict end readonly def	

%
% Character Name Mapping
%

/CNameMappingDict 512 dict begin
%
% Symbols
%
/space		16#2121	def	/jcomma		16#2122 def
/jperiod	16#2123 def	/comma		16#2124 def
/period		16#2125 def	/periodcentered	16#2126 def
/colon		16#2127 def	/semicolon	16#2128 def
/question	16#2129	def	/exclam		16#212A	def
/jvoiced 	16#212B def	/jsemivoiced	16#212C def
%
/asciicircum	16#2130	def	/overline	16#2131	def
/underscore	16#2132 def	
%
/jprolonged	16#213C def	/hyphen		16#213D def
%
/slash		16#213F	def	/backslash	16#2140 def
%
/bar		16#2143	def
%
/quoteleft	16#2146 def	/quoteright	16#2147	def
%
/quotedbl	16#2149	def
/parenleft	16#214A	def	/parenright	16#214B	def
%
/bracketleft	16#214E	def	/bracketright	16#214F	def	
/braceleft	16#2150	def	/braceright	16#2151	def	
%
/jbracketleft	16#2156 def	/jbracketright	16#2157	def
%
/plus		16#215C	def	/minus		16#215D def
%
/equal		16#2161	def
%
/less		16#2163	def	/greater	16#2164	def
%
/yen		16#216F	def	/dollar		16#2170	def
%
/percent	16#2173	def	/numbersign	16#2174	def
/ampersand	16#2175	def	/asterisk	16#2176	def	
/at		16#2177	def
%
% Digits
%
[
/zero /one /two /three /four /five /six /seven /eight /nine
] 16#2330 1 16#2339 { 2 copy 16#2330 sub get exch def } for pop
%
% Alphabets
%
[
/A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z
] 16#2341 1 16#235A { 2 copy 16#2341 sub get exch def } for pop
%
[
/a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z
] 16#2361 1 16#237A { 2 copy 16#2361 sub get exch def } for pop
%
% Hiragana
%
[
/asmallgana /agana /ismallgana /igana /usmallgana /ugana
/esmallgana /egana /osmallgana /ogana
/kagana	/gagana /kigana /gigana /kugana /gugana
/kegana /gegana /kogana /gogana
/sagana /zagana /shigana /jigana /sugana /zugana
/segana /zegana /sogana /zogana
/tagana /dagana /chigana /digana /tsusmallgana /tsugana /dugana
/tegana /degana /togana /dogana
/nagana /nigana /nugana /negana /nogana
/hagana /bagana /pagana /higana /bigana /pigana /fugana /bugana /pugana
/hegana /begana /pegana /hogana /bogana /pogana
/magana /migana /mugana /megana /mogana
/yasmallgana /yagana /yusmallgana /yugana /yosmallgana /yogana
/ragana /rigana /rugana /regana /rogana 
/wasmallgana /wagana /wigana /yegana /wogana /ngana
] 16#2421 1 16#2473 { 2 copy 16#2421 sub get exch def } for pop
%
% Katakana
%
[
/asmallkana /akana /ismallkana /ikana /usmallkana /ukana
/esmallkana /ekana /osmallkana /okana
/kakana	/gakana /kikana /gikana /kukana /gukana
/kekana /gekana /kokana /gokana
/sakana /zakana /shikana /jikana /sukana /zukana
/sekana /zekana /sokana /zokana
/takana /dakana /chikana /dikana /tsusmallkana /tsukana /dukana
/tekana /dekana /tokana /dokana
/nakana /nikana /nukana /nekana /nokana
/hakana /bakana /pakana /hikana /bikana /pikana /fukana /bukana /pukana
/hekana /bekana /pekana /hokana /bokana /pokana
/makana /mikana /mukana /mekana /mokana
/yasmallkana /yakana /yusmallkana /yukana /yosmallkana /yokana
/rakana /rikana /rukana /rekana /rokana 
/wasmallkana /wakana /wikana /yekana /wokana /nkana
/vukana /kasmallkana /kesmallkana
] 16#2521 1 16#2576 { 2 copy 16#2521 sub get exch def } for pop
currentdict end readonly def

%
% Mapping procedure
%

/StandardMapping {
	Private /MappingDict get exch 2 copy known 
	{ get Private /MappingOffset get add }{ pop pop 16#2121 } ifelse
} def