Mercurial > emacs
annotate lisp/language/devan-util.el @ 89464:3bd06346cb4b
(font-lock-match-c-style-declaration-item-and-skip-to-next):
Check (match-end 2) before goto there.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 05 Jun 2003 12:58:44 +0000 |
parents | ea8374ccb41f |
children | 2f877ed80fa6 |
rev | line source |
---|---|
89141 | 1 ;;; devan-util.el --- Support for composing Devanagari characters -*-coding: iso-2022-7bit;-*- |
17052 | 2 |
41469 | 3 ;; Copyright (C) 2001 Free Software Foundation, Inc. |
17052 | 4 |
41469 | 5 ;; Maintainer: KAWABATA, Taichi <batta@beige.ocn.ne.jp> |
6 ;; Keywords: multilingual, Devanagari | |
17052 | 7 |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
17314
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
23 ;; Boston, MA 02111-1307, USA. |
17052 | 24 |
41469 | 25 ;; Created: Feb. 17. 2001 |
26 | |
17052 | 27 ;;; Commentary: |
28 | |
41469 | 29 ;; This file provides character(Unicode) to glyph(CDAC) conversion and |
30 ;; composition of Devanagari script characters. | |
17052 | 31 |
32 ;;; Code: | |
33 | |
41469 | 34 ;; Devanagari Composable Pattern |
35 ;; C .. Consonants | |
36 ;; V .. Vowel | |
37 ;; H .. Halant | |
38 ;; M .. Matra | |
39 ;; V .. Vowel | |
40 ;; A .. Anuswar | |
41 ;; D .. Chandrabindu | |
42 ;; (N .. Zerowidth Non Joiner) | |
43 ;; (J .. Zerowidth Joiner. ) | |
44 ;; 1. vowel | |
45 ;; V(A/D)? | |
46 ;; 2. syllable : maximum of 5 consecutive consonants. (e.g. kartsnya) | |
41602 | 47 ;; ((CH)?(CH)?(CH)?CH)?C(H|M?(A|D)?)? |
17052 | 48 |
41469 | 49 (defconst devanagari-consonant |
50 "[$,15U(B-$,15y68(B-$,16?(B]") | |
17052 | 51 |
41469 | 52 (defconst devanagari-composable-pattern |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
53 (concat |
41469 | 54 "\\([$,15E(B-$,15T6@6A(B][$,15A5B(B]?\\)\\|$,15C(B" |
55 "\\|\\(" | |
56 "\\(?:\\(?:[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?\\(?:[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?\\(?:[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?" | |
57 "[$,15U(B-$,15y68(B-$,16?(B]\\(?:$,16-(B\\|[$,15~(B-$,16-6B6C(B]?[$,15B5A(B]?\\)?" | |
58 "\\)") | |
59 "Regexp matching a composable sequence of Devanagari characters.") | |
17052 | 60 |
89295
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
61 (dolist (range '((#x0903 . #x0903) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
62 (#x0905 . #x0939) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
63 (#x0958 . #x0961))) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
64 (set-char-table-range indian-composable-pattern range |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
65 devanagari-composable-pattern)) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
66 |
89264
bb4ce770b305
Delete the superfluous autoload cookie
Kenichi Handa <handa@m17n.org>
parents:
89141
diff
changeset
|
67 ;;;###autoload |
41469 | 68 (defun devanagari-compose-region (from to) |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
69 (interactive "r") |
26894 | 70 (save-excursion |
71 (save-restriction | |
72 (narrow-to-region from to) | |
73 (goto-char (point-min)) | |
41469 | 74 (while (re-search-forward devanagari-composable-pattern nil t) |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
75 (devanagari-compose-syllable-region (match-beginning 0) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
76 (match-end 0)))))) |
41469 | 77 (defun devanagari-compose-string (string) |
78 (with-temp-buffer | |
79 (insert (decompose-string string)) | |
80 (devanagari-compose-region (point-min) (point-max)) | |
81 (buffer-string))) | |
82 | |
42054
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
83 (defun devanagari-post-read-conversion (len) |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
84 (save-excursion |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
85 (save-restriction |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
86 (let ((buffer-modified-p (buffer-modified-p))) |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
87 (narrow-to-region (point) (+ (point) len)) |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
88 (devanagari-compose-region (point-min) (point-max)) |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
89 (set-buffer-modified-p buffer-modified-p) |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
90 (- (point-max) (point-min)))))) |
144a811f0590
(devanagari-post-read-conversion): New
Dave Love <fx@gnu.org>
parents:
41602
diff
changeset
|
91 |
42061
0332665b9445
(devanagari-range): Renamed from `range'. All calls changed.
Richard M. Stallman <rms@gnu.org>
parents:
42054
diff
changeset
|
92 (defun devanagari-range (from to) |
41469 | 93 "Make the list of the integers of range FROM to TO." |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
94 (let (result) |
41469 | 95 (while (<= from to) (setq result (cons to result) to (1- to))) result)) |
96 | |
42061
0332665b9445
(devanagari-range): Renamed from `range'. All calls changed.
Richard M. Stallman <rms@gnu.org>
parents:
42054
diff
changeset
|
97 (defun devanagari-regexp-of-hashtbl-keys (hashtbl) |
0332665b9445
(devanagari-range): Renamed from `range'. All calls changed.
Richard M. Stallman <rms@gnu.org>
parents:
42054
diff
changeset
|
98 "Return a regular expression that matches all keys in hashtable HASHTBL." |
41469 | 99 (let ((max-specpdl-size 1000)) |
100 (regexp-opt | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
101 (sort |
41469 | 102 (let (dummy) |
103 (maphash (function (lambda (key val) (setq dummy (cons key dummy)))) hashtbl) | |
104 dummy) | |
105 (function (lambda (x y) (> (length x) (length y)))))))) | |
106 | |
107 | |
89295
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
108 ;;;###autoload |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
109 (defun devanagari-composition-function (pos &optional string) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
110 "Compose Devanagari characters after the position POS. |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
111 If STRING is not nil, it is a string, and POS is an index to the string. |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
112 In this case, compose characters after POS of the string." |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
113 (if string |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
114 ;; Not yet implemented. |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
115 nil |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
116 (goto-char pos) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
117 (if (looking-at devanagari-composable-pattern) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
118 (prog1 (match-end 0) |
ea8374ccb41f
Register devanagari-composable-pattern
Kenichi Handa <handa@m17n.org>
parents:
89264
diff
changeset
|
119 (devanagari-compose-syllable-region pos (match-end 0)))))) |
41469 | 120 |
121 ;; Notes on conversion steps. | |
17052 | 122 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
123 ;; 1. chars to glyphs |
41469 | 124 ;; |
125 ;; Rules will not be applied to the halant appeared at the end of the | |
126 ;; text. Also, the preceding/following "r" will be treated as special case. | |
127 | |
128 ;; 2. glyphs reordering. | |
129 ;; | |
130 ;; The glyphs are split by halant, and each glyph groups are | |
131 ;; re-ordered in the following order. | |
132 ;; | |
133 ;; Note that `consonant-glyph' mentioned here does not contain the | |
134 ;; vertical bar (right modifier) attached at the right of the | |
135 ;; consonant. | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
136 ;; |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
137 ;; If the glyph-group contains right modifier, |
41469 | 138 ;; (1) consonant-glyphs/vowels, with nukta sign |
139 ;; (2) spacing | |
140 ;; (3) right modifier (may be matra) | |
141 ;; (4) top matra | |
142 ;; (5) preceding "r" | |
143 ;; (6) anuswar | |
144 ;; (7) following "r" | |
145 ;; (8) bottom matra or halant. | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
146 ;; |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
147 ;; Otherwise, |
41469 | 148 ;; (1) consonant-glyph/vowels, with nukta sign |
149 ;; (3) left matra | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
150 ;; (4) top matra |
41469 | 151 ;; (5) preceding "r" |
152 ;; (6) anuswar | |
153 ;; (7) following "r" | |
154 ;; (8) bottom matra or halant. | |
155 ;; (2) spacing | |
156 | |
157 ;; 3. glyph to glyph | |
158 ;; | |
159 ;; For better display, some glyph display would be tuned. | |
160 | |
161 ;; 4. Composition. | |
162 ;; | |
163 ;; left modifiers will be attached at the left. | |
164 ;; others will be attached right. | |
165 | |
166 ;; Problem:: | |
167 ;; Can we generalize this methods to other Indian scripts? | |
17052 | 168 |
41523 | 169 (defvar dev-char-glyph |
170 '(("$,15E(B" . "$,4 K(B") | |
41599 | 171 ("$,15F(B" . "$,4 K")(B") |
172 ("$,15~(B" . "$,4")(B") | |
41523 | 173 ("$,15G(B" . "$,4 \(B") |
41599 | 174 ("$,15(B" . "$,4"*(B") |
175 ("$,155A(B" . "$,4"*(B\$,4"&(B") | |
41523 | 176 ("$,15H(B" . "$,4 \"'(B") |
41599 | 177 ("$,15H5A(B" . "$,4 \"'"&(B") |
178 ("$,16 (B" . "$,4"2(B") | |
179 ("$,16 5A(B" . "$,4"2"&(B") | |
41523 | 180 ("$,15I(B" . "$,4 ](B") |
41599 | 181 ("$,16!(B" . "$,4"6(B") |
182 ("$,15J(B" . "$,4 ^"P(B") | |
183 ("$,16"(B" . "$,4":(B") | |
184 ("$,15K(B" . "$,4 `"Q(B") | |
185 ("$,16#(B" . "$,4">(B") | |
41523 | 186 ;;("$,15L(B" . nil) ; not implemented. |
41599 | 187 ("$,16$(B" . "$,4"?(B") |
188 ("$,15M(B" . "$,4 b"L(B") | |
189 ("$,15M5A(B" . "$,4 b"$(B") | |
190 ("$,15M5B(B" . "$,4 b"$(B") | |
191 ("$,16%(B" . "\$,4"L(B") | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
192 ("$,15N(B" . "$,4 b"@(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
193 ("$,15N5A(B" . "$,4 b"@"&(B") |
41599 | 194 ("$,16&(B" . "\$,4"@(B") |
195 ("$,16&5A(B" . "\$,4"@(B\$,4"&(B") | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
196 ("$,15O(B" . "$,4 b(B") |
41599 | 197 ("$,16'(B" . "\$,4"D(B") |
198 ("$,16'5A(B" . "\$,4"D(B\$,4"&(B") | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
199 ("$,15P(B" . "$,4 b"D(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
200 ("$,15P5A(B" . "$,4 b"D"&(B") |
41599 | 201 ("$,16((B" . "\$,4"H(B") |
202 ("$,16(5A(B" . "\$,4"H(B\$,4"&(B") | |
203 ("$,15Q(B" . "$,4 K")"L(B") ;; special rule for reodering. | |
204 ("$,15Q5A(B" . "$,4 K")"$(B") | |
205 ("$,15Q5B(B" . "$,4 K")"$(B") | |
206 ("$,16)(B" . "\$,4")"L(B") | |
207 ("$,16)5A(B" . "\$,4")"$(B") | |
208 ("$,16)5B(B" . "\$,4")"$(B") | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
209 ("$,15R(B" . "$,4 K")"@(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
210 ("$,15R5A(B" . "$,4 K")"@"&(B") |
41599 | 211 ("$,16*(B" . "\$,4")"@(B") |
212 ("$,16*5A(B" . "\$,4")"@"&(B") | |
213 ("$,15S(B" . "$,4 K")"D(B") | |
214 ("$,15S5A(B" . "$,4 K")"D"&(B") | |
215 ("$,16+(B" . "\$,4")"D(B") | |
216 ("$,16+5A(B" . "\$,4")"D"&(B") | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
217 ("$,15T(B" . "$,4 K")"H(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
218 ("$,15T5A(B" . "$,4 K")"H"&(B") |
41599 | 219 ("$,16,(B" . "\$,4")"H(B") |
220 ("$,16,5A(B" . "\$,4")"H"&(B") | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
221 ("$,16@(B" . "$,4 a"Q(B") |
41523 | 222 ;;("$,16B(B" . nil) |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
223 ;;("$,16A(B" . nil) |
41523 | 224 ;;("$,16C(B" . nil) |
41469 | 225 |
41523 | 226 ;; GRUTTALS |
41599 | 227 ("$,15U(B" . "$,4 e"R(B") |
41523 | 228 ("$,15U6-(B" . "$,4 c(B") |
41599 | 229 ("$,15U6-5p(B" . "$,4 g"R(B") |
230 ("$,15U6-5d(B" . "$,4 h"R(B") | |
231 ("$,15U6-5w(B" . "$,4 i")(B") | |
41523 | 232 ("$,15U6-5w6-(B" . "$,4 i(B") |
41469 | 233 |
41599 | 234 ("$,15V(B" . "$,4 j")(B") |
41523 | 235 ("$,15V6-(B" . "$,4 j(B") |
41599 | 236 ("$,15V6-5p(B" . "$,4 l")(B") |
41523 | 237 ("$,15V6-5p6-(B" . "$,4 l(B") |
41469 | 238 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
239 ("$,15W(B" . "$,4 m")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
240 ("$,15W6-(B" . "$,4 m(B") |
41599 | 241 ("$,15W6-5p(B" . "$,4 o")(B") |
41523 | 242 ("$,15W6-5p6-(B" . "$,4 o(B") |
41469 | 243 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
244 ("$,15X(B" . "$,4 p")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
245 ("$,15X6-(B" . "$,4 p(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
246 ("$,15X6-5p(B" . "$,4 q")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
247 ("$,15X6-5p6-(B" . "$,4 q(B") |
41469 | 248 |
41599 | 249 ("$,15Y(B" . "$,4 r"S(B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
250 ;; PALATALS |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
251 ("$,15Z(B" . "$,4 s")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
252 ("$,15Z6-(B" . "$,4 s(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
253 ("$,15Z6-5p(B" . "$,4 t")(B") |
41523 | 254 ("$,15Z6-5p6-(B" . "$,4 t(B") |
41469 | 255 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
256 ("$,15[(B" . "$,4 u"T(B") |
41469 | 257 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
258 ("$,15\(B" . "$,4 v")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
259 ("$,15\6-(B" . "$,4 v(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
260 ("$,15\6-5p(B" . "$,4 x")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
261 ("$,15\6-5p6-(B" . "$,4 x(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
262 ("$,15\6-5^(B" . "$,4 y")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
263 ("$,15\6-5^6-(B" . "$,4 y(B") |
17052 | 264 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
265 ("$,15](B" . "$,4 z")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
266 ("$,15]6-(B" . "$,4 z(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
267 ("$,15]6-5p(B" . "$,4 {")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
268 ("$,15]6-5p6-(B" . "$,4 {(B") |
41469 | 269 |
41599 | 270 ("$,15^(B" . "$,4 |")(B") |
41523 | 271 ("$,15^6-(B" . "$,4 |(B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
272 ;; CEREBRALS |
41599 | 273 ("$,15_(B" . "$,4 }"U(B") |
274 ("$,15_6-5_(B" . "$,4 ~"U(B") | |
275 ("$,15_6-5`(B" . "$,4 "U(B") | |
41469 | 276 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
277 ("$,15`(B" . "$,4! "V(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
278 ("$,15`6-5`(B" . "$,4!!"V(B") |
41469 | 279 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
280 ("$,15a(B" . "$,4!""W(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
281 ("$,15a6-5a(B" . "$,4!$"W(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
282 ("$,15a6-5b(B" . "$,4!%"W(B") |
41469 | 283 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
284 ("$,15b(B" . "$,4!&"X(B") |
41469 | 285 |
41599 | 286 ("$,15c(B" . "$,4!(")(B") |
41523 | 287 ("$,15c6-(B" . "$,4!((B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
288 ;; DENTALS |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
289 ("$,15d(B" . "$,4!)")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
290 ("$,15d6-(B" . "$,4!)(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
291 ("$,15d6-5p(B" . "$,4!*")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
292 ("$,15d6-5p6-(B" . "$,4!*(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
293 ("$,15d6-5d(B" . "$,4!+")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
294 ("$,15d6-5d6-(B" . "$,4!+(B") |
41469 | 295 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
296 ("$,15e(B" . "$,4!,")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
297 ("$,15e6-(B" . "$,4!,(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
298 ("$,15e6-5p(B" . "$,4!-")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
299 ("$,15e6-5p6-(B" . "$,4!-(B") |
41469 | 300 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
301 ("$,15f(B" . "$,4!."Y(B") |
41599 | 302 ("$,15f6#(B" . "$,4!/"Y(B") |
303 ("$,15f6-5p(B" . "$,4!0"Y(B") | |
304 ("$,15f6-5f(B" . "$,4!1"Y(B") | |
305 ("$,15f6-5g(B" . "$,4!2"Y(B") | |
41523 | 306 ("$,15f6-5n(B" . "$,4!3(B") |
307 ("$,15f6-5o(B" . "$,4!4(B") | |
41599 | 308 ("$,15f6-5u(B" . "$,4!5"Y(B") |
17773
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
309 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
310 ("$,15g(B" . "$,4!6")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
311 ("$,15g6-(B" . "$,4!6(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
312 ("$,15g6-5p(B" . "$,4!7")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
313 ("$,15g6-5p6-(B" . "$,4!7(B") |
41469 | 314 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
315 ("$,15h(B" . "$,4!8")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
316 ("$,15h6-(B" . "$,4!8(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
317 ("$,15h6-5p(B" . "$,4!9")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
318 ("$,15h6-5p6-(B" . "$,4!9")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
319 ("$,15h6-5h(B" . "$,4!:")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
320 ("$,15h6-5h6-(B" . "$,4!:(B") |
41469 | 321 |
41599 | 322 ("$,15i(B" . "$,4!8"#")(B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
323 ;; LABIALS |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
324 ("$,15j(B" . "$,4!;")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
325 ("$,15j6-(B" . "$,4!;(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
326 ("$,15j6-5p(B" . "$,4!<")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
327 ("$,15j6-5p6-(B" . "$,4!<(B") |
41469 | 328 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
329 ("$,15k(B" . "$,4!a"[(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
330 ("$,15k6-(B" . "$,4!=(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
331 ("$,15k6-5p(B" . "$,4!c"[(B") |
41469 | 332 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
333 ("$,15l(B" . "$,4!d")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
334 ("$,15l6-(B" . "$,4!d(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
335 ("$,15l6-5p(B" . "$,4!e")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
336 ("$,15l6-5p6-(B" . "$,4!e(B") |
41469 | 337 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
338 ("$,15m(B" . "$,4!f")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
339 ("$,15m6-(B" . "$,4!f(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
340 ("$,15m6-5p(B" . "$,4!g")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
341 ("$,15m6-5p6-(B" . "$,4!g(B") |
41469 | 342 |
41599 | 343 ("$,15n(B" . "$,4!h")(B") |
41523 | 344 ("$,15n6-(B" . "$,4!h(B") |
41599 | 345 ("$,15n6-5p(B" . "$,4!i")(B") |
41523 | 346 ("$,15n6-5p6-(B" . "$,4!i(B") |
347 ;; SEMIVOWELS | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
348 ("$,15o(B" . "$,4!j")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
349 ("$,15o6-(B" . "$,4!j(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
350 ("$,15o6-5p(B" . "$,4!k")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
351 ("$,15o6-5p6-(B" . "$,4!k(B") |
41523 | 352 ("$,16-5o(B" . "$,4!l(B") ;; when every ohter lig. fails. |
41469 | 353 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
354 ("$,15p(B" . "$,4!n"W(B") |
41523 | 355 ;; ("$,15p6-(B" . "\$,4"'(B") ;; special case. only the topmost pos. |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
356 ("$,15q(B" . "$,4!n"#"W(B") |
41523 | 357 ("$,15q6-(B" . "$,4!m(B") ;; IS 13194 speical rule. |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
358 ("$,15p6!(B" . "$,4!o"[(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
359 ("$,15p6"(B" . "$,4!p"\(B") |
17052 | 360 |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
361 ("$,15r(B" . "$,4!q")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
362 ("$,15r6-(B" . "$,4!q(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
363 ("$,15s(B" . "$,4!s(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
364 ("$,15s6-(B" . "$,4!r(B") |
41599 | 365 ("$,15t(B" . "$,4!s"#(B") |
366 ("$,15t6-(B" . "$,4!r"#(B") | |
41469 | 367 |
41599 | 368 ("$,15u(B" . "$,4!t")(B") |
41523 | 369 ("$,15u6-(B" . "$,4!t(B") |
41599 | 370 ("$,15u6-5p(B" . "$,4!u")(B") |
41523 | 371 ("$,15u6-5p6-(B" . "$,4!u(B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
372 ;; SIBILANTS |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
373 ("$,15v(B" . "$,4!v")(B") |
41523 | 374 ("$,15v6-(B" . "$,4!v(B") |
41599 | 375 ("$,15v6-5u(B" . "$,4!w")(B") |
41523 | 376 ("$,15v6-5u6-(B" . "$,4!w(B") |
41599 | 377 ("$,15v6-5p(B" . "$,4!x")(B") |
41523 | 378 ("$,15v6-5p6-(B" . "$,4!x(B") |
41469 | 379 |
41599 | 380 ("$,15w(B" . "$,4!y")(B") |
41523 | 381 ("$,15w6-(B" . "$,4!y(B") |
41599 | 382 ("$,15x(B" . "$,4!z")(B") |
41523 | 383 ("$,15x6-(B" . "$,4!z(B") |
41599 | 384 ("$,15x6-5p(B" . "$,4!{")(B") |
41523 | 385 ("$,15x6-5p6-(B" . "$,4!{(B") |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
386 |
41523 | 387 ("$,15y(B" . "$,4!}(B") |
388 ("$,15y6-(B" . "$,4!|(B") | |
389 ("$,15y6#(B" . "$,4!~(B") | |
390 ("$,15y6-5p(B" . "$,4!(B") | |
41599 | 391 ("$,15y6-5n(B" . "$,4" (B") |
392 ("$,15y6-5o(B" . "$,4"!(B") | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
393 ;; NUKTAS |
41599 | 394 ("$,168(B" . "$,4 f"R"S(B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
395 ("$,1686-(B" . "$,4 d(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
396 ("$,169(B" . "$,4 k")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
397 ("$,1696-(B" . "$,4 k(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
398 ("$,16:(B" . "$,4 n")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
399 ("$,16:6-(B" . "$,4 n(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
400 ("$,16;(B" . "$,4 w")(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
401 ("$,16;6-(B" . "$,4 w(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
402 ("$,16<(B" . "$,4!#"W(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
403 ("$,16=(B" . "$,4!'"X(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
404 ("$,16>(B" . "$,4!b"[(B") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
405 ("$,16>6-(B" . "$,4!>(B") |
41599 | 406 ("$,16?(B" . "$,4!j"#")(B") |
41523 | 407 ;; misc modifiers. |
41599 | 408 ("$,15A(B" . "\$,4"$(B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
409 ("$,15B(B" . "\$,4"&(B") |
41523 | 410 ("$,15C(B" . "$,4 F(B") |
41599 | 411 ("$,15|(B" . "$,4"#(B") |
41523 | 412 ("$,15}(B" . "$,4 E(B") |
41599 | 413 ("$,16-(B" . "$,4""(B") |
414 ("$,16-5p(B" . "$,4"%(B") ;; following "r" | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
415 ;; ("$,160(B" . "$,4 D(B") |
41523 | 416 ;; ("$,16D(B" . "$,4 J(B") |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
417 ;; ("$,16F(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
418 ;; ("$,16G(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
419 ;; ("$,16H(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
420 ;; ("$,16I(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
421 ;; ("$,16J(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
422 ;; ("$,16K(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
423 ;; ("$,16L(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
424 ;; ("$,16M(B" . "") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
425 ;; ("$,16N(B" . "") |
41523 | 426 ;; ("$,16O(B" . "") |
427 ) | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
428 "Devanagari characters to glyphs conversion table. |
41523 | 429 Default value contains only the basic rules. You may add your own |
430 preferred rule from the sanskrit fonts." ) | |
41469 | 431 |
432 (defvar dev-char-glyph-hash | |
433 (let* ((hash (makehash 'equal))) | |
434 (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) | |
435 dev-char-glyph) | |
436 hash)) | |
437 | |
438 (defvar dev-char-glyph-regexp | |
42061
0332665b9445
(devanagari-range): Renamed from `range'. All calls changed.
Richard M. Stallman <rms@gnu.org>
parents:
42054
diff
changeset
|
439 (devanagari-regexp-of-hashtbl-keys dev-char-glyph-hash)) |
41469 | 440 |
441 ;; glyph-to-glyph conversion table. | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
442 ;; it is supposed that glyphs are ordered in |
41469 | 443 ;; [consonant/nukta] - [matra/halant] - [preceding-r] - [anuswar]. |
444 | |
41523 | 445 (defvar dev-glyph-glyph |
41599 | 446 '(("\$,4"'(B\$,4"&(B" . "\$,4"((B") |
447 ("\$,4"'(B\$,4"$(B" . "\$,4"((B") | |
448 ("$,4"*(B\$,4"&(B" . "$,4"+(B") | |
449 ("$,4"*(B\$,4"'(B" . "$,4",(B") | |
450 ("$,4"*(B\$,4"'(B\$,4"&(B" . "$,4"-(B") | |
451 ("$,4"2(B\$,4"&(B" . "$,4"3(B") | |
452 ("$,4"2(B\$,4"'(B" . "$,4"4(B") | |
453 ("$,4"2(B\$,4"'(B\$,4"&(B" . "$,4"5(B") | |
454 ("$,4"#(B\$,4"6(B" . "$,4"7(B") | |
455 ("$,4"%(B\$,4"6(B" . "$,4"8(B") | |
456 ;;("$,4"6(B" . "$,4"9(B") | |
457 ("$,4"#(B\$,4":(B" . "$,4";(B") | |
458 ("$,4"%(B\$,4":(B" . "$,4"<(B") | |
459 ;;("$,4":(B" . "$,4"=(B") | |
460 ("\$,4"@(B\$,4"&(B" . "\$,4"A(B") | |
461 ("\$,4"@(B\$,4"'(B" . "\$,4"B(B") | |
462 ("\$,4"@(B\$,4"'(B\$,4"&(B" . "\$,4"C(B") | |
463 ("\$,4"D(B\$,4"&(B" . "\$,4"E(B") | |
464 ("\$,4"D(B\$,4"'(B" . "\$,4"F(B") | |
465 ("\$,4"D(B\$,4"'(B\$,4"&(B" . "\$,4"G(B") | |
466 ("\$,4"H(B\$,4"&(B" . "\$,4"I(B") | |
467 ("\$,4"H(B\$,4"'(B" . "\$,4"J(B") | |
468 ("\$,4"H(B\$,4"'(B\$,4"&(B" . "\$,4"K(B") | |
469 ("\$,4"L(B\$,4"&(B" . "\$,4"M(B") | |
470 ("\$,4"L(B\$,4"'(B" . "\$,4"N(B") | |
471 ("\$,4"L(B\$,4"'(B\$,4"&(B" . "\$,4"O(B") | |
41523 | 472 )) |
41469 | 473 (defvar dev-glyph-glyph-hash |
474 (let* ((hash (makehash 'equal))) | |
475 (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) | |
476 dev-glyph-glyph) | |
477 hash)) | |
478 (defvar dev-glyph-glyph-regexp | |
42061
0332665b9445
(devanagari-range): Renamed from `range'. All calls changed.
Richard M. Stallman <rms@gnu.org>
parents:
42054
diff
changeset
|
479 (devanagari-regexp-of-hashtbl-keys dev-glyph-glyph-hash)) |
41469 | 480 |
481 | |
482 ;; yet another glyph-to-glyph conversions. | |
41523 | 483 (defvar dev-glyph-glyph-2 |
41599 | 484 '(("$,4"*(B" . "$,4".(B") |
485 ("$,4"+(B" . "$,4"/(B") | |
486 ("$,4",(B" . "$,4"0(B") | |
487 ("$,4"-(B" . "$,4"1(B"))) | |
41469 | 488 (defvar dev-glyph-glyph-2-hash |
489 (let* ((hash (makehash 'equal))) | |
490 (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) | |
491 dev-glyph-glyph-2) | |
492 hash)) | |
493 (defvar dev-glyph-glyph-2-regexp | |
42061
0332665b9445
(devanagari-range): Renamed from `range'. All calls changed.
Richard M. Stallman <rms@gnu.org>
parents:
42054
diff
changeset
|
494 (devanagari-regexp-of-hashtbl-keys dev-glyph-glyph-2-hash)) |
41469 | 495 |
496 | |
497 (defun dev-charseq (from &optional to) | |
498 (if (null to) (setq to from)) | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
499 (devanagari-range (make-char 'devanagari-glyph from) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
500 (make-char 'devanagari-glyph to))) |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
501 |
41469 | 502 (defvar dev-glyph-cvn |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
503 (append |
41469 | 504 (dev-charseq #x2b) |
505 (dev-charseq #x3c #xc1) | |
506 (dev-charseq #xc3)) | |
507 "Devanagari Consonants/Vowels/Nukta Glyphs") | |
508 | |
509 (defvar dev-glyph-space | |
510 (dev-charseq #xf0 #xfe) | |
511 "Devanagari Spacing Glyphs") | |
512 | |
513 (defvar dev-glyph-right-modifier | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
514 (append |
41469 | 515 (dev-charseq #xc9) |
516 (dev-charseq #xd2 #xd5)) | |
517 "Devanagari Modifiers attached at the right side.") | |
518 | |
519 (defvar dev-glyph-right-modifier-regexp | |
520 (concat "[" dev-glyph-right-modifier "]")) | |
521 | |
522 (defvar dev-glyph-left-matra | |
523 (dev-charseq #xca #xd1) | |
524 "Devanagari Matras attached at the left side.") | |
525 | |
526 (defvar dev-glyph-top-matra | |
527 (dev-charseq #xe0 #xef) | |
528 "Devanagari Matras attached at the top side.") | |
529 | |
530 (defvar dev-glyph-bottom-modifier | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
531 (append |
41469 | 532 (dev-charseq #xd6 #xdf) |
533 (dev-charseq #xc2)) | |
534 "Devanagari Modifiers attached at the bottom.") | |
535 | |
536 (defvar dev-glyph-order | |
537 `((,dev-glyph-cvn . 1) | |
538 (,dev-glyph-space . 2) | |
539 (,dev-glyph-right-modifier . 3) | |
540 (,dev-glyph-left-matra . 3) ;; processed by reference point. | |
541 (,dev-glyph-top-matra . 4) | |
542 (,(dev-charseq #xc7 #xc8) . 5) | |
543 (,(dev-charseq #xc6) . 6) | |
544 (,(dev-charseq #xc5) . 7) | |
545 (,dev-glyph-bottom-modifier . 8))) | |
546 | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
547 (mapc |
41469 | 548 (function (lambda (x) |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
549 (mapc |
41469 | 550 (function (lambda (y) |
551 (put-char-code-property y 'composition-order (cdr x)))) | |
552 (car x)))) | |
553 dev-glyph-order) | |
554 | |
555 (mapc | |
556 (function (lambda (x) | |
557 (put-char-code-property x 'reference-point '(3 . 5)))) | |
558 dev-glyph-left-matra) | |
559 | |
560 (defun devanagari-compose-syllable-string (string) | |
561 (with-temp-buffer | |
562 (insert (decompose-string string)) | |
563 (devanagari-compose-syllable-region (point-min) (point-max)) | |
564 (buffer-string))) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
565 |
41523 | 566 (defun devanagari-compose-syllable-region (from to) |
567 "Compose devanagari syllable in region FROM to TO." | |
568 (let ((glyph-str nil) (cons-num 0) glyph-str-list | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
569 (last-halant nil) (preceding-r nil) (last-modifier nil) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
570 (last-char (char-before to)) match-str |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
571 glyph-block split-pos) |
41523 | 572 (save-excursion |
573 (save-restriction | |
89096
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
574 ;;; *** char-to-glyph conversion *** |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
575 ;; Special rule 1. -- Last halant must be preserved. |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
576 (if (eq last-char ?$,16-(B) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
577 (progn |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
578 (setq last-halant t) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
579 (narrow-to-region from (1- to))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
580 (narrow-to-region from to) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
581 ;; note if the last char is modifier. |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
582 (if (or (eq last-char ?$,15A(B) (eq last-char ?$,15B(B)) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
583 (setq last-modifier t))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
584 (goto-char (point-min)) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
585 ;; Special rule 2. -- preceding "r halant" must be modifier. |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
586 (when (looking-at "$,15p6-(B.") |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
587 (setq preceding-r t) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
588 (goto-char (+ 2 (point)))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
589 ;; translate the rest characters into glyphs |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
590 (while (re-search-forward dev-char-glyph-regexp nil t) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
591 (setq match-str (match-string 0)) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
592 (setq glyph-str |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
593 (concat glyph-str |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
594 (gethash match-str dev-char-glyph-hash))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
595 ;; count the number of consonant-glyhs. |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
596 (if (string-match devanagari-consonant match-str) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
597 (setq cons-num (1+ cons-num)))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
598 ;; preceding-r must be attached before the anuswar if exists. |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
599 (if preceding-r |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
600 (if last-modifier |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
601 (setq glyph-str (concat (substring glyph-str 0 -1) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
602 "$,4"'(B" (substring glyph-str -1))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
603 (setq glyph-str (concat glyph-str "$,4"'(B")))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
604 (if last-halant (setq glyph-str (concat glyph-str "$,4""(B"))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
605 ;;; *** glyph-to-glyph conversion *** |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
606 (when (string-match dev-glyph-glyph-regexp glyph-str) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
607 (setq glyph-str |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
608 (replace-match (gethash (match-string 0 glyph-str) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
609 dev-glyph-glyph-hash) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
610 nil t glyph-str)) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
611 (if (and (> cons-num 1) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
612 (string-match dev-glyph-glyph-2-regexp glyph-str)) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
613 (setq glyph-str |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
614 (replace-match (gethash (match-string 0 glyph-str) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
615 dev-glyph-glyph-2-hash) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
616 nil t glyph-str)))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
617 ;;; *** glyph reordering *** |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
618 (while (setq split-pos (string-match "$,4""(B\\|.$" glyph-str)) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
619 (setq glyph-block (substring glyph-str 0 (1+ split-pos))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
620 (setq glyph-str (substring glyph-str (1+ split-pos))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
621 (setq |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
622 glyph-block |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
623 (if (string-match dev-glyph-right-modifier-regexp glyph-block) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
624 (sort (string-to-list glyph-block) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
625 (function (lambda (x y) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
626 (< (get-char-code-property x 'composition-order) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
627 (get-char-code-property y 'composition-order))))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
628 (sort (string-to-list glyph-block) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
629 (function (lambda (x y) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
630 (let ((xo (get-char-code-property x 'composition-order)) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
631 (yo (get-char-code-property y 'composition-order))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
632 (if (= xo 2) nil (if (= yo 2) t (< xo yo))))))))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
633 (setq glyph-str-list (nconc glyph-str-list glyph-block))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
634 ;; concatenate and attach reference-points. |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
635 (setq glyph-str |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
636 (cdr |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
637 (apply |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
638 'nconc |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
639 (mapcar |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
640 (function (lambda (x) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
641 (list |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
642 (or (get-char-code-property x 'reference-point) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
643 '(5 . 3) ;; default reference point. |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
644 ) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
645 x))) |
856a479d9c34
(dev-charseq): Avoid indian-glyph-char.
Dave Love <fx@gnu.org>
parents:
88616
diff
changeset
|
646 glyph-str-list)))))) |
41523 | 647 (compose-region from to glyph-str))) |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
648 |
18309
bd8b521f5218
Provide XXX-util instead of
Kenichi Handa <handa@m17n.org>
parents:
18203
diff
changeset
|
649 (provide 'devan-util) |
42311 | 650 |
651 ;;; devan-util.el ends here |