8fbe389221527d87ab4fe3039f463e082a2c8b2a
[chise/xemacs-chise.git-] / lisp / mule / mule-conf.el
1 ;;; mule-conf.el --- configure multilingual environment
2
3 ;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 1997,1999,2000,2002,2003 MORIOKA Tomohiko
6
7 ;; Keywords: mule, multilingual, character set, coding system
8
9 ;; This file is part of XEmacs.
10
11 ;; XEmacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; XEmacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with XEmacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Code:
27
28 ;; PinYin-ZhuYin
29 (make-charset 'sisheng "PinYin-ZhuYin"
30               '(registry "sisheng_cwnn\\|OMRON_UDC_ZH"
31                 dimension 1
32                 chars 94
33                 final ?0
34                 graphic 0
35                 ))
36
37 ;; Lao script.
38 ;; ISO10646's 0x0E80..0x0EDF are mapped to 0x20..0x7F.
39 (make-charset 'lao "Lao script"
40               '(registry "MuleLao-1"
41                 dimension 1
42                 chars 94
43                 final ?1
44                 graphic 1))
45
46 ;; IPA (International Phonetic Alphabet)
47 (make-charset 'ipa "International Phonetic Alphabet"
48               '(registry "MuleIPA"
49                 dimension 1
50                 chars 96
51                 final ?0
52                 graphic 1))
53
54 ;; Ethiopic
55 (make-charset 'ethiopic "Ethiopic"
56               '(registry "Ethio"
57                 dimension 2
58                 chars 94
59                 final ?3
60                 graphic 0
61                 ))
62
63 ;; ISO-IR-165 (CCITT Extended GB)
64 ;;    It is based on CCITT Recommendation T.101, includes GB 2312-80 +
65 ;;    GB 8565-88 table A4 + 293 characters.
66 (make-charset
67  'chinese-isoir165
68  "ISO-IR-165 (CCITT Extended GB; Chinese simplified)"
69  `(registry "isoir165"
70    dimension 2
71    chars 94
72    final ?E
73    graphic 0))
74
75 ;; CNS11643 Plane3 thru Plane7
76 ;; These represent more and more obscure Chinese characters.
77 ;; By the time you get to Plane 7, we're talking about characters
78 ;; that appear once in some ancient manuscript and whose meaning
79 ;; is unknown.
80
81 (flet
82     ((make-chinese-cns11643-charset
83       (name plane final)
84       (make-charset
85        name (concat "CNS 11643 Plane " plane " (Chinese traditional)")
86        `(registry 
87          ,(concat "CNS11643[.-]\\(.*[.-]\\)?" plane "$")
88          dimension 2
89          chars 94
90          final ,final
91          graphic 0))
92       ))
93   (make-chinese-cns11643-charset 'chinese-cns11643-3 "3" ?I)
94   (make-chinese-cns11643-charset 'chinese-cns11643-4 "4" ?J)
95   (make-chinese-cns11643-charset 'chinese-cns11643-5 "5" ?K)
96   (make-chinese-cns11643-charset 'chinese-cns11643-6 "6" ?L)
97   (make-chinese-cns11643-charset 'chinese-cns11643-7 "7" ?M)
98   )
99
100 ;; JIS X 0213:2000
101 (if (featurep 'utf-2000)
102     (progn
103       (make-charset
104        '=jis-x0213-1-2000
105        "JIS X 0213:2000 Plain 1"
106        '(registry "jisx0213\\(\\.2000\\)-1"
107                   dimension 2
108                   chars 94
109                   mother =jis-x0208-1990
110                   final ?O
111                   graphic 0))
112       (make-charset
113        '=jis-x0213-2-2000
114        "JIS X 0213:2000 Plain 2"
115        '(registry "jisx0213\\(\\.2000\\)-2"
116                   dimension 2
117                   chars 94
118                   final ?P
119                   graphic 0))
120       (define-charset-alias 'japanese-jisx0213-1 '=jis-x0213-1-2000)
121       (define-charset-alias 'japanese-jisx0213-2 '=jis-x0213-2-2000)
122       )
123   (make-charset
124    'japanese-jisx0213-1
125    "JIS X 0213:2000 Plain 1"
126    '(registry "jisx0213\\(\\.2000\\)-1"
127               dimension 2
128               chars 94
129               final ?O
130               graphic 0))
131   (make-charset
132    'japanese-jisx0213-2
133    "JIS X 0213:2000 Plain 2"
134    '(registry "jisx0213\\(\\.2000\\)-2"
135               dimension 2
136               chars 94
137               final ?P
138               graphic 0))
139   )
140
141 (when (featurep 'utf-2000)
142   (define-charset-alias 'ucs '=ucs)
143   (define-charset-alias 'japanese-jisx0208-1990 '=jis-x0208-1990)
144   (make-charset '=ucs@gb
145                 "UCS for GB"
146                 `(long-name     "ISO/IEC 10646 for GB"
147                   chars         256
148                   dimension     3
149                   columns       2
150                   graphic       2
151                   direction     l2r
152                   mother        =ucs))
153   (define-charset-alias 'ucs-gb '=ucs@gb)
154   (make-charset 'ucs-cns
155                 "UCS for CNS"
156                 `(long-name     "ISO/IEC 10646 for CNS 11643"
157                   chars         256
158                   dimension     3
159                   columns       2
160                   graphic       2
161                   direction     l2r
162                   mother        =ucs))
163   (make-charset 'ucs-jis
164                 "UCS for JIS"
165                 `(long-name     "ISO/IEC 10646 for JIS X0208/0212/0213"
166                   chars         256
167                   dimension     3
168                   columns       2
169                   graphic       2
170                   direction     l2r
171                   mother        =ucs))
172   (make-charset '=ucs-jis-1990
173                 "UCS for JIS:1990"
174                 `(long-name     "ISO/IEC 10646 for JIS X 0208/0212:1990"
175                   chars         256
176                   dimension     3
177                   columns       2
178                   graphic       2
179                   direction     l2r
180                   mother        ucs-jis))
181   (make-charset '=ucs-jis-2000
182                 "UCS for JIS:2000"
183                 `(long-name     "ISO/IEC 10646 for JIS X 0213:2000"
184                   chars         256
185                   dimension     3
186                   columns       2
187                   graphic       2
188                   direction     l2r
189                   mother        ucs-jis))
190   (make-charset 'ucs-ks
191                 "UCS for KS"
192                 `(long-name     "ISO/IEC 10646 for Korean Standards"
193                   chars         256
194                   dimension     3
195                   columns       2
196                   graphic       2
197                   direction     l2r
198                   mother        =ucs))
199   (make-charset 'ucs-big5
200                 "UCS for Big5"
201                 `(long-name     "ISO/IEC 10646 for Big5"
202                   chars         256
203                   dimension     3
204                   columns       2
205                   graphic       2
206                   direction     l2r
207                   mother        =ucs))
208
209   (make-charset 'ideograph-daikanwa
210                 "Daikanwa"
211                 `(long-name     "Daikanwa dictionary (revised version 2)"
212                   chars         256
213                   dimension     2
214                   columns       2
215                   graphic       2
216                   direction     l2r
217                   registry      "Daikanwa\\(\\.[0-9]+\\)?-3"
218                   min-code      #xE00000
219                   max-code      ,(+ #xE00000 50100)
220                   code-offset   #xE00000))
221
222   (make-charset '=daikanwa-rev1
223                 "Daikanwa Rev."
224                 `(long-name     "Daikanwa dictionary (revised version)"
225                   chars         256
226                   dimension     2
227                   columns       2
228                   graphic       2
229                   direction     l2r
230                   registry      "Daikanwa\\(\\.[0-9]+\\)?-2"))
231   (define-charset-alias 'ideograph-daikanwa-2 '=daikanwa-rev1)
232
233   (make-charset '=daikanwa-rev2
234                 "Daikanwa"
235                 `(long-name     "Daikanwa dictionary (revised version 2)"
236                   chars         256
237                   dimension     2
238                   columns       2
239                   graphic       2
240                   direction     l2r
241                   registry      "Daikanwa\\(\\.[0-9]+\\)?-3"
242                   min-code      #xE00000
243                   max-code      ,(+ #xE00000 50100)
244                   code-offset   #xE00000))
245
246   (make-charset '=big5-pua
247                 "Big5-PUA"
248                 `(long-name     "Big5 with private used area"
249                   chars         256
250                   dimension     2
251                   columns       2
252                   graphic       2
253                   direction     l2r
254                   mother        chinese-big5
255                   registry      "Big5\\.ETEN"))
256   (define-charset-alias 'chinese-big5-pua '=big5-pua)
257   (make-charset '=big5-eten
258                 "Big5-ETEN"
259                 `(long-name     "Big5 ETEN"
260                   chars         256
261                   dimension     2
262                   columns       2
263                   graphic       2
264                   direction     l2r
265                   mother        chinese-big5
266                   min-code      #x8140
267                   max-code      #xFEFE
268                   registry      "Big5\\.ETEN"))
269   (define-charset-alias 'chinese-big5-eten '=big5-eten)
270   (make-charset 'chinese-big5-eten-a
271                 "Big5-ETEN-a"
272                 `(long-name     "Big5 ETEN (#xF9D6 .. #xF9FE)"
273                   chars         256
274                   dimension     2
275                   columns       2
276                   graphic       2
277                   direction     l2r
278                   mother        chinese-big5
279                   min-code      #xF9D6
280                   max-code      #xF9FE
281                   registry      "Big5\\.ETEN"))
282   (make-charset 'chinese-big5-eten-b
283                 "Big5-ETEN-b"
284                 `(long-name     "Big5 ETEN (#xC6A1 .. #xC8FE)"
285                   chars         256
286                   dimension     2
287                   columns       2
288                   graphic       2
289                   direction     l2r
290                   mother        chinese-big5
291                   min-code      #xC6A1
292                   max-code      #xC8FE
293                   registry      "Big5\\.ETEN"))
294   (make-charset '=big5-cdp
295                 "Big5-CDP"
296                 `(long-name     "Big5 with CDP extension"
297                   chars         256
298                   dimension     2
299                   columns       2
300                   graphic       2
301                   direction     l2r
302                   registry      "big5\\.cdp-0"
303                   mother        chinese-big5
304                   min-code      #x8140
305                   max-code      #x8DFE))
306   (define-charset-alias 'chinese-big5-cdp '=big5-cdp)
307   (let* ((i 1)
308          (hzk-min (+ (lsh #x6200 16) 65536))
309          (hzk-max (+ hzk-min 65535)))
310     (while (<= i 12)
311       (make-charset
312        (intern (format "=hanziku-%d" i))
313        (format "HANZIKU-%d" i)
314        `(long-name ,(format "HANZIKU (pseudo BIG5 encoding) part %d" i)
315                    chars 256
316                    dimension 2
317                    columns 2
318                    graphic 2
319                    direction l2r
320                    registry ,(format "hanziku-%d$" i i)
321                    min-code ,hzk-min
322                    max-code ,hzk-max
323                    code-offset ,hzk-min))
324       (define-charset-alias
325         (intern (format "ideograph-hanziku-%d" i))
326         (intern (format "=hanziku-%d" i)))
327       (setq hzk-min (1+ hzk-max)
328             hzk-max (+ hzk-min 65535))
329       (setq i (1+ i))))
330
331   (make-charset '=gt
332                 "GT"
333                 `(long-name     "GT 2000"
334                   chars         256
335                   dimension     3
336                   columns       2
337                   graphic       2
338                   direction     l2r
339                   registry      ""
340                   min-code      ,(lsh #x6100 16)
341                   max-code      ,(+ (lsh #x6100 16) 67547)
342                   code-offset   ,(lsh #x6100 16)))
343   (define-charset-alias 'ideograph-gt '=gt)
344   (make-charset '=gt-k
345                 "GT parts"
346                 `(long-name     "Ideographic parts of GT"
347                   chars         256
348                   dimension     2
349                   columns       2
350                   graphic       2
351                   direction     l2r
352                   registry      ""
353                   min-code      ,(lsh #x6110 16)
354                   max-code      ,(+ (lsh #x6110 16) 17090)
355                   code-offset   ,(lsh #x6110 16)))
356   (define-charset-alias 'ideograph-gt-k '=gt-k)
357   (let ((i 1))
358     (while (<= i 11)
359       (make-charset
360        (intern (format "=gt-pj-%d" i))
361        (format "GT PJ %d" i)
362        `(long-name ,(format "GT 2000 (pseudo JIS encoding) part %d" i)
363                    chars 94
364                    dimension 2
365                    columns 2
366                    graphic 0
367                    direction l2r
368                    registry ,(format "\\(GTpj-%d\\|jisx0208\\.GT-%d\\)$" i i)))
369       (define-charset-alias
370         (intern (format "ideograph-gt-pj-%d" i))
371         (intern (format "=gt-pj-%d" i)))
372       (setq i (1+ i))))
373   (make-charset
374    '=gt-pj-k1
375    "GT K1"
376    `(long-name "Ideographic parts of GT (pseudo JIS encoding) part 1"
377                chars 94
378                dimension 2
379                columns 2
380                graphic 0
381                direction l2r
382                registry "\\(GTKpj-1\\|jisx0208\\.GTK-1\\)$"))
383   (define-charset-alias 'ideograph-gt-pj-k1 '=gt-pj-k1)
384   (make-charset
385    '=gt-pj-k2
386    "GT K2"
387    `(long-name "Ideographic parts of GT (pseudo JIS encoding) part 2"
388                chars 94
389                dimension 2
390                columns 2
391                graphic 0
392                direction l2r
393                registry "\\(GTKpj-2\\|jisx0208\\.GTK-2\\)$"))
394   (define-charset-alias 'ideograph-gt-pj-k2 '=gt-pj-k2)
395   (make-charset '=cbeta "CBETA PUA"
396                 '(long-name     "CBETA private characters"
397                   chars         256
398                   dimension     2
399                   registry      "cbeta-0"
400                   graphic       2
401                   min-code      #xE20000
402                   max-code      #xE2FFFF
403                   code-offset   #xE20000
404                   columns       2
405                   direction     l2r))
406   (define-charset-alias 'ideograph-cbeta '=cbeta)
407   (make-charset '=jef-china3
408                 "JEF + CHINA3"
409                 `(long-name     "JEF + CHINA3 private characters"
410                   chars         256
411                   dimension     2
412                   columns       2
413                   graphic       2
414                   direction     l2r
415                   registry      "china3jef-0"
416                   min-code      #xE80000
417                   max-code      #xE8FFFF
418                   code-offset   #xE80000))
419   (define-charset-alias 'china3-jef '=jef-china3)
420   )
421
422 ;;; mule-conf.el ends here