Mercurial > emacs
annotate lisp/language/devan-util.el @ 20357:d8c4a70454f2
Just a header comment fix.
author | Simon Marshall <simon@gnu.org> |
---|---|
date | Wed, 26 Nov 1997 14:38:48 +0000 |
parents | 761a83f7cb4e |
children | df8fab27273f |
rev | line source |
---|---|
17052 | 1 ;;; devan-util.el --- Support for Devanagari Script Composition |
2 | |
3 ;; Copyright (C) 1996 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | |
6 | |
7 ;; Keywords: multilingual, Indian, Devanagari | |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs 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 ;; GNU Emacs 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 | |
17314
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
22 ;; 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
|
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
24 ;; Boston, MA 02111-1307, USA. |
17052 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;; History: | |
29 ;; 1996.10.18 written by KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
30 ;; 1997.1.20 fixed some bugs. |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
31 ;; 1997.3.24 fixed some bugs. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
32 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
33 ;; Future work :: |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
34 ;; Decompose the input characters and process them on the character basis. |
17052 | 35 |
36 ;; Devanagari script composition rules and related programs. | |
37 | |
38 ;;; Code: | |
39 | |
40 ;;; | |
41 ;;; Steps toward composition of Devanagari Characters. | |
42 ;;; | |
43 | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
44 ;;; Intersection Function will be used. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
45 (require 'cl) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
46 |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17850
diff
changeset
|
47 ;;;###autoload |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17850
diff
changeset
|
48 (defun setup-devanagari-environment () |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17850
diff
changeset
|
49 "Setup multilingual environment (MULE) for languages using Devanagari." |
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17850
diff
changeset
|
50 (interactive) |
18547
a152279c9f45
(setup-devanagari-environment): Adjusted
Kenichi Handa <handa@m17n.org>
parents:
18309
diff
changeset
|
51 (setup-8-bit-environment "Devanagari" nil 'devanagari |
a152279c9f45
(setup-devanagari-environment): Adjusted
Kenichi Handa <handa@m17n.org>
parents:
18309
diff
changeset
|
52 "devanagari-itrans")) |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17850
diff
changeset
|
53 |
17052 | 54 ;;; Basic functions. |
55 | |
56 ;;;###autoload | |
57 (defun indian-to-devanagari (ch) | |
58 "Convert IS 13194 characters to Devanagari basic characters." | |
59 (let ((charcodes (split-char ch))) | |
60 (if (eq (car charcodes) 'indian-is13194) | |
61 (make-char 'indian-2-column ?\x21 (nth 1 charcodes)) | |
62 ch))) | |
63 | |
64 ;;;###autoload | |
65 (defun devanagari-to-indian (ch) | |
66 "Convert Devanagari basic characters to IS 13194 characters." | |
67 (let* ((charcodes (split-char ch)) | |
68 (charset (car charcodes)) | |
69 (code-h (car (cdr charcodes)))) | |
70 (if (and (eq (car charcodes) 'indian-2-column) | |
71 (= (nth 1 charcodes) ?\x21)) | |
72 (make-char 'indian-is13194 (nth 2 charcodes)) | |
73 ch))) | |
74 | |
75 ;;;###autoload | |
76 (defun indian-to-devanagari-region (from to) | |
77 "Convert IS 13194 characters in region to Devanagari basic characters." | |
78 (interactive "r") | |
79 (save-restriction | |
80 (narrow-to-region from to) | |
81 (goto-char (point-min)) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
82 ; (while (re-search-forward "\\cd" nil t) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
83 (while (re-search-forward "." nil t) |
17052 | 84 (let* ((devanagari-char (indian-to-devanagari (preceding-char)))) |
85 (delete-char -1) | |
86 (insert devanagari-char))))) | |
87 | |
88 ;;;###autoload | |
89 (defun devanagari-to-indian-region (from to) | |
90 "Convert Devanagari basic characters in region to Indian characters." | |
91 (interactive "r") | |
92 (save-restriction | |
93 (narrow-to-region from to) | |
94 (goto-char (point-min)) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
95 ; (while (re-search-forward "\\cD" nil t) ; Devanagari Character Code. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
96 (while (re-search-forward "." nil t) |
17052 | 97 (let* ((indian-char (devanagari-to-indian (preceding-char)))) |
98 (delete-char -1) | |
99 (insert indian-char))))) | |
100 | |
101 ;;;###autoload | |
102 (defun indian-to-devanagari-string (str) | |
103 "Convert Indian String to Devanagari Basic Character String." | |
104 (let ((pos 0) (dst "") (src str) char) | |
105 (while (not (equal src "")) | |
106 (setq char (string-to-char src)) | |
107 (setq src (substring src (char-bytes char))) | |
108 (setq dst (concat dst (char-to-string (indian-to-devanagari char))))) | |
109 dst)) | |
110 | |
111 ;; Phase 0 - Determine whether the characters can be composed. | |
112 ;; | |
113 ;;; | |
114 ;;; Regular expressions to split characters for composition. | |
115 ;;; | |
116 ;; | |
117 ;; Indian script word contains one or more syllables. | |
118 ;; In BNF, it can be expressed as follows: | |
119 ;; | |
120 ;; Word ::= {Syllable} [Cons-Syllable] | |
121 ;; Syllable ::= Cons-Vowel-Syllable | Vowel-Syllable | |
122 ;; Vowel-Syllable ::= V[D] | |
123 ;; Cons-Vowel-Syllable ::= [Cons-Syllable] Full-Cons [M] [D] | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
124 ;; Cons-Syllable ::= [Pure-Cons] [Pure-Cons] [Pure-Cons] Pure-Cons |
17052 | 125 ;; Pure-Cons ::= Full-Cons H |
126 ;; Full-Cons ::= C [N] | |
127 ;; | |
128 ;; {} repeat, [] optional | |
129 ;; | |
130 ;; C - Consonant ($(5!3!4!5!6!7!8!9!:!;!<!=!>!?!@!A!B!C!D!E(B | |
131 ;; $(5!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X(B) | |
132 ;; N - Nukta ($(5!i(B) | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
133 ;; H - Halant($(5!h(B) or Virama |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
134 ;; V - Vowel ($(5!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2#&#'#*(B) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
135 ;; ("$(5#&#'#*(B" can be obtained by IS13194 vowels with nukta.) |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
136 ;; D - Vowel Modifiers, i.e. Anuswar, Chandrabindu ($(5!!!"(B) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
137 ;; (Visaraga ($(5!#(B) is excluded.) |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
138 ;; M - Matra ($(5!Z![!\!]!^!_!`!a!b!c!d!e!f!g#K#L#M(B) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
139 ;; ("$(5#K#L#M(B" can be obtained by IS13194 matras with nukta.) |
17052 | 140 ;; |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
141 ;; In Emacs, one syllable of Indian language is considered to be one |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
142 ;; composite glyph. If we expand the above expression for |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
143 ;; cons-vowel-syllable, it would be: |
17052 | 144 ;; |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
145 ;; [[C [N] H] [C [N] H] [C [N] H] C [N] H] C [N] [M] [D] |
17052 | 146 ;; |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
147 ;; Therefore, in worst case, the one syllable may contain |
17052 | 148 ;; following characters. |
149 ;; | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
150 ;; C N H C N H C N H C N H C N M D |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
151 ;; |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
152 ;; The example is a sanskrit word "kArtsnya", where five consecutive |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
153 ;; consonants appear. |
17052 | 154 ;; |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
155 ;; On the other hand, consonant-syllable, which appears at the end of |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
156 ;; the word, would have the following expression: |
17052 | 157 ;; |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
158 ;; [C [N] H] [C [N] H] [C [N] H] C [N] H |
17052 | 159 ;; |
160 ;; This is acceptable BEFORE proper consonant-syllable is input. The | |
161 ;; string which doesn't match with the above expression is invalid and | |
162 ;; thus must be fixed. | |
163 ;; | |
164 ;; Note: | |
165 ;; Third case can be considered, which is acceptable syllable and can | |
166 ;; not add any code more. | |
167 ;; | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
168 ;; [[C [N] H] [C [N] H] [C [N] H] C [N] H] C [N] [M] D |
17052 | 169 ;; |
170 ;; However, to make editing possible even in this condition, we will | |
171 ;; not consider about this case. | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
172 ;; |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
173 ;; Note: |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
174 ;; Currently, it seems that the only following consonants would have |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
175 ;; Nukta sign attatched. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
176 ;; ($(5!3!4!5!:!?!@!I(B) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
177 ;; Therefore, [$(5!3(B-$(5!X(B]$(5!i(B? can be re-written as |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
178 ;; \\([$(5!3!4!5!:!?!@!I(B]$(5!i(B\\)\\|[$(5!3(B-$(5!X(B] |
17052 | 179 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
180 (defconst devanagari-full-cons |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
181 "\\(\\([$(5!3!4!5!:!?!@!I(B]$(5!i(B\\)\\|[$(5!3(B-$(5!X$.$E"%(B]\\)" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
182 "Devanagari full consonant") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
183 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
184 (defconst devanagari-pure-cons |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
185 (concat "\\(" devanagari-full-cons "$(5!h(B\\)") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
186 "Devanagari pure consonant") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
187 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
188 (defconst devanagari-matra |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
189 "\\(\\([$(5!_![!\(B]$(5!i(B\\)\\|[$(5!Z(B-$(5!g#K#L#M(B]\\)" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
190 "Devanagari Matra Signs. '$(5#K#L#M(B' can also be created from the combination |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
191 of '$(5!_![!\(B' and nukta sign.") |
17052 | 192 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
193 (defconst devanagari-vowel |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
194 "\\(\\([$(5!*!&!'(B]$(5!i(B\\)\\|[$(5!$(B-$(5!2#&#'#*(B]\\)" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
195 "Devanagari Vowels. '$(5#&#'#*(B' can also be created from the combination |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
196 of '$(5!*!&!'(B' and nukta sign.") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
197 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
198 (defconst devanagari-vowel-syllable |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
199 (concat devanagari-vowel "[$(5!!!"(B]?") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
200 "Devanagari vowel syllable.") |
17052 | 201 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
202 (defconst devanagari-cons-syllable |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
203 (concat devanagari-pure-cons "?" devanagari-pure-cons "?" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
204 devanagari-pure-cons "?" devanagari-pure-cons "$") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
205 "Devanagari consonant syllable") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
206 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
207 (defconst devanagari-cons-vowel-syllable |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
208 (concat "\\(" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
209 devanagari-pure-cons "?" devanagari-pure-cons "?" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
210 devanagari-pure-cons "?" devanagari-pure-cons "\\)?" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
211 devanagari-full-cons devanagari-matra "?[$(5!!!"(B]?") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
212 "Devanagari consonant vowel syllable.") |
17052 | 213 |
214 ;; | |
215 ;; Also, digits and virams should be processed other than syllables. | |
216 ;; | |
217 ;; In IS 13194, Avagrah is obtained by Nukta after Viram, and | |
218 ;; OM is obtained by Nukta after Chandrabindu | |
219 ;; | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
220 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
221 (defconst devanagari-digit-viram-visarga |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
222 "[$(5!q(B-$(5!z!j!#(B]") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
223 (defconst devanagari-other-sign |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
224 "\\([$(5!!!j(B]$(5!i(B\\)\\|\\([$(5#!#J(B]\\)") |
17052 | 225 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
226 (defconst devanagari-composite-glyph-unit |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
227 (concat "\\(" devanagari-cons-syllable |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
228 "\\)\\|\\(" devanagari-vowel-syllable |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
229 "\\)\\|\\(" devanagari-digit-viram-visarga |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
230 "\\)\\|\\(" devanagari-cons-vowel-syllable |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
231 "\\)\\|\\(" devanagari-other-sign "\\)") |
17052 | 232 "Regexp matching to Devanagari string to be composed form one glyph.") |
233 | |
234 ;;(put-charset-property charset-devanagari-1-column | |
235 ;; 'char-to-glyph 'devanagari-compose-string) | |
236 ;;(put-charset-property charset-devanagari-2-column | |
237 ;; 'char-to-glyph 'devanagari-compose-string) | |
238 | |
239 ;; Sample | |
240 ;; | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
241 ;;(string-match devanagari-cons-vowel-syllable-examine "$(5!X![(B") => 0 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
242 ;;(string-match devanagari-cons-vowel-syllable-examine "$(5!F!h!D!\(B") => 0 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
243 ;;(string-match devanagari-cons-vowel-syllable-examine "$(5!X![!F!h!D!\(B") => 0 |
17052 | 244 |
245 ;; | |
246 ;; Steps toward the composition | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
247 ;; Converting Character Codes to Composite Glyph. |
17052 | 248 ;; |
249 ;; Example : $(5!X![(B/$(5!F!h!D!\(B | |
250 ;; | |
251 ;; First, convert Characters to appropriate glyphs. | |
252 ;; | |
253 ;; => $(5!X![(B/$(5"F!D!\(B | |
254 ;; | |
255 ;; Then, determine the base glyph, apply-orders and apply-rules. | |
256 ;; | |
257 ;; => $(5!X(B (ml.mr) $(5![(B / $(5!D(B (ml.mr) $(5"F(B (mr ml) $(5!\(B | |
258 ;; | |
259 ;; Finally, convert 2-column glyphs to 1-column glyph | |
260 ;; if such a glyph exist. | |
261 ;; | |
262 ;; => $(6![(B (ml.mr) $(6!X(B / $(6!D(B (ml.mr) $(6"F(B (mr ml) $(6!\(B | |
263 ;; | |
264 ;; Compose the glyph. | |
265 ;; | |
266 ;; => 2$(6!X@![1(B/2$(6!D@"FP!\1(B | |
267 ;; => 2$(6!X@![12!D@"FP!\1(B | |
268 ;; | |
269 | |
270 ;; | |
271 ;; Phase 1: Converting Character Code to Glyph Code. | |
272 ;; | |
273 ;; | |
274 ;; IMPORTANT: | |
275 ;; There may be many rules which you many want to be suppressed. | |
276 ;; In that case, please comment out that rule. | |
277 ;; | |
278 ;; RULES WILL BE EVALUATED FROM FIRST TO LAST. | |
279 ;; PUT MORE SPECIFIC RULES FIRST. | |
280 ;; | |
281 ;; TO DO: | |
282 ;; Prepare multiple specific list of rules for each languages | |
283 ;; which adopts Devanagari script. | |
284 ;; | |
285 | |
286 | |
287 (defconst devanagari-char-to-glyph-rules | |
288 '( | |
289 | |
290 ;; `r' at the top of syllable and followed by other consonants. | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
291 ;; ("[^$(5!h(B]\\($(5!O!h(B\\)[$(5!3(B-$(5!X(B]" "$(5"p(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
292 ("^\\($(5!O!h(B\\)[$(5!3(B-$(5!X(B]" "$(5"p(B") |
17052 | 293 |
294 ;; Ligature Rules | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
295 ("\\($(5!3!h!B!h!O!h!M(B\\)" "$(5$!(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
296 ("\\($(5!3!h!B!h!T(B\\)" "$(5$"(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
297 ("\\($(5!3!h!B!h!M(B\\)" "$(5$#(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
298 ("\\($(5!3!h!F!h!M(B\\)" "$(5$$(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
299 ("\\($(5!3!h!O!h!M(B\\)" "$(5$%(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
300 ("\\($(5!3!h!O(B\\)" "$(5"#(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
301 ("\\($(5!3!h!T!h!M(B\\)" "$(5$&(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
302 ("\\($(5!3!h(B\\)$(5!3!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"3(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
303 ("\\($(5!3!h!3(B\\)" "$(5$'(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
304 ("\\($(5!3!h(B\\)$(5!B!h!O(B" "$(5"3(B") ; Special Rules for "k-tr" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
305 ("\\($(5!3!h!B(B\\)" "$(5$((B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
306 ("\\($(5!3!h!F(B\\)" "$(5$)(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
307 ("\\($(5!3!h!L(B\\)" "$(5$*(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
308 ("\\($(5!3!h!M(B\\)" "$(5$+(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
309 ("\\($(5!3!h!Q(B\\)" "$(5$,(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
310 ("\\($(5!3!h!T(B\\)" "$(5$-(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
311 ("\\($(5!3!h!V!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"l(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
312 ("\\($(5$.!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"l(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
313 ("\\($(5!3!h!V(B\\)" "$(5$.(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
314 ("\\($(5!3!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"3(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
315 ("\\($(5!3!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"s(B") ; Nukta Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
316 ("\\($(5!3!i(B\\)" "$(5#3(B") ; Nukta |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
317 ("\\($(5!4!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"4(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
318 ("\\($(5!4!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"t(B") ; Nukta Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
319 ("\\($(5!4!i(B\\)" "$(5#4(B") ; Nukta |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
320 ("\\($(5!5!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"`(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
321 ("\\($(5!5!h!O(B\\)" "$(5"$(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
322 ("\\($(5!5!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"5(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
323 ("\\($(5!5!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"u(B") ; Nukta Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
324 ("\\($(5!5!i(B\\)" "$(5#5(B") ; Nukta |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
325 ("\\($(5!6!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"a(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
326 ("\\($(5!6!h!F(B\\)" "$(5$/(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
327 ; Slot |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
328 ("\\($(5!6!h!O(B\\)" "$(5!6"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
329 ("\\($(5!6!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"6(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
330 ("\\($(5!7!h!3!h!B!h!M(B\\)" "$(5$0(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
331 ("\\($(5!7!h!3!h!V!h!T(B\\)" "$(5$1(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
332 ("\\($(5!7!h!3!h!B(B\\)" "$(5$2(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
333 ("\\($(5!7!h!3!h!V(B\\)" "$(5$3(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
334 ("\\($(5!7!h!3!h!O(B\\)" "$(5$9"q(B") ; Special Rule. May be precomposed font needed. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
335 ("\\($(5!7!h!6!h!O(B\\)" "$(5$4(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
336 ("\\($(5!7!h!3!h!M(B\\)" "$(5$5(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
337 ("\\($(5!7!h!4!h!M(B\\)" "$(5$6(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
338 ("\\($(5!7!h!5!h!M(B\\)" "$(5$7(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
339 ("\\($(5!7!h!6!h!M(B\\)" "$(5$8(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
340 ("\\($(5!7!h!3(B\\)" "$(5$9(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
341 ("\\($(5!7!h!4(B\\)" "$(5$:(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
342 ("\\($(5!7!h!5!h!O(B\\)" "$(5$;"q(B") ; Special Rule. May be precomposed font needed. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
343 ("\\($(5!7!h!5(B\\)" "$(5$;(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
344 ("\\($(5!7!h!6(B\\)" "$(5$<(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
345 ("\\($(5!7!h!7(B\\)" "$(5$=(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
346 ("\\($(5!7!h!F(B\\)" "$(5$>(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
347 ("\\($(5!7!h!L(B\\)" "$(5$?(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
348 ("\\($(5!7!h!M(B\\)" "$(5$@(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
349 ("\\($(5!8!h(B\\)[$(5!8!<(B]$(5!h(B" "$(5"8(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
350 ("\\($(5!8!h!8(B\\)" "$(5$A(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
351 ("\\($(5!8!h!<(B\\)" "$(5$B(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
352 ("\\($(5!8!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"8"q(B") ; Half Form Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
353 ("\\($(5!8!h!O(B\\)" "$(5!8"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
354 ("\\($(5!8!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"8(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
355 ("\\($(5!9!h!M(B\\)" "$(5$C(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
356 ("\\($(5!:!h!O(B\\)" "$(5$D(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
357 ("\\($(5!:!h!<!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"m(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
358 ("\\($(5!:!h!<(B\\)" "$(5$E(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
359 ("\\($(5!:!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5":(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
360 ("\\($(5!:!i!h!O(B\\)" "$(5"!(B") ; Nukta Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
361 ("\\($(5!:!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"z(B") ; Nukta Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
362 ("\\($(5!:!i(B\\)" "$(5#:(B") ; Nukta |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
363 ("\\($(5!;!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5";(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
364 ("\\($(5!<!h(B\\)$(5!8!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"<(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
365 ("\\($(5!<!h!8(B\\)" "$(5$F(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
366 ("\\($(5!<!h(B\\)$(5!:!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"<(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
367 ("\\($(5!<!h!:(B\\)" "$(5$G(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
368 ("\\($(5!<!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"<(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
369 ("\\($(5!=!h!3(B\\)" "$(5$H(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
370 ("\\($(5!=!h!=(B\\)" "$(5$I(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
371 ("\\($(5!=!h!>(B\\)" "$(5$J(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
372 ("\\($(5!=!h!M(B\\)" "$(5$K(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
373 ("\\($(5!>!h!M(B\\)" "$(5$L(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
374 ("\\($(5!?!h!5!h!M(B\\)" "$(5$M(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
375 ("\\($(5!?!h!6!h!O(B\\)" "$(5$N(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
376 ("\\($(5!?!h!O!h!M(B\\)" "$(5$O(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
377 ("\\($(5!?!h!5(B\\)" "$(5$P(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
378 ("\\($(5!?!h!6(B\\)" "$(5$Q(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
379 ("\\($(5!?!h!?(B\\)" "$(5$R(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
380 ("\\($(5!?!h!L(B\\)" "$(5$S(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
381 ("\\($(5!?!h!M(B\\)" "$(5$T(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
382 ("\\($(5!?!i(B\\)" "$(5#?(B") ; Nukta |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
383 ("\\($(5!@!h!M(B\\)" "$(5$`(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
384 ("\\($(5!@!i(B\\)" "$(5#@(B") ; Nukta |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
385 ("\\($(5!A!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"A(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
386 ("\\($(5!B!h(B\\)$(5!B!h!O(B" "$(5"B(B") ; Special Rule for "t-tr" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
387 ("\\($(5!B!h!B!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"c(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
388 ("\\($(5!B!h!B(B\\)" "$(5$a(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
389 ("\\($(5!B!h!F(B\\)" "$(5$b(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
390 ("\\($(5!B!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"d(B") ; Half Form Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
391 ("\\($(5!B!h!O(B\\)" "$(5"%(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
392 ("\\($(5!B!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"B(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
393 ("\\($(5!C!h!O(B\\)" "$(5!C"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
394 ("\\($(5!C!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"C(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
395 ("\\($(5!D!h!D!h!M(B\\)" "$(5$c(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
396 ("\\($(5!D!h!E!h!M(B\\)" "$(5$d(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
397 ("\\($(5!D!h!K!h!M(B\\)" "$(5$e(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
398 ("\\($(5!D!h!K!h!O(B\\)" "$(5$r"r(B") ; Special Case for "dbhr" ; *** |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
399 ("\\($(5!D!h!O!h!M(B\\)" "$(5$f(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
400 ("\\($(5!D!h!T!h!M(B\\)" "$(5$g(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
401 ("\\($(5!D!h!5!h!O(B\\)" "$(5$h(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
402 ("\\($(5!D!h!6!h!O(B\\)" "$(5$i(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
403 ("\\($(5!D!h!D!h!T(B\\)" "$(5$j(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
404 ("\\($(5!D!h!E!h!T(B\\)" "$(5$k(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
405 ("\\($(5!D!h(B\\)$(5!E!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5!D!h(B") ; Special Half Form (for ddhra) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
406 ("\\($(5!D!h!5(B\\)" "$(5$l(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
407 ("\\($(5!D!h!6(B\\)" "$(5$m(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
408 ("\\($(5!D!h!D(B\\)" "$(5$n(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
409 ("\\($(5!D!h!E(B\\)" "$(5$o(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
410 ("\\($(5!D!h!F(B\\)" "$(5$p(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
411 ("\\($(5!D!h(B\\)$(5!J!h(B" "$(5!D!h(B") ; Suppressing "db-" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
412 ("\\($(5!D!h!J(B\\)" "$(5$q(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
413 ("\\($(5!D!h!K(B\\)" "$(5$r(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
414 ("\\($(5!D!h!L(B\\)" "$(5$s(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
415 ("\\($(5!D!h!M(B\\)" "$(5$t(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
416 ("\\($(5!D!h!T(B\\)" "$(5$u(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
417 ("\\($(5!E!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"e(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
418 ("\\($(5!E!h!F(B\\)" "$(5$v(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
419 ("\\($(5!E!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"f(B") ; Half Form Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
420 ("\\($(5!E!h!O(B\\)" "$(5!E"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
421 ("\\($(5!E!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"E(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
422 ("\\($(5!F!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"k(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
423 ("\\($(5!F!h!F(B\\)" "$(5$w(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
424 ("\\($(5!F!h!O(B\\)" "$(5!F"q(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
425 ("\\($(5!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"F(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
426 ("\\($(5!G!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"G(B") ; Nukta Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
427 ("\\($(5!H!h(B\\)$(5!B!h!O(B" "$(5"H(B") ; Special Rule for "p-tr" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
428 ("\\($(5!H!h!B!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"g(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
429 ("\\($(5!H!h!B(B\\)" "$(5$x(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
430 ("\\($(5!H!h!F(B\\)" "$(5$y(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
431 ("\\($(5!H!h!Q(B\\)" "$(5$z(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
432 ("\\($(5!H!h!O(B\\)" "$(5"&(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
433 ("\\($(5!H!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"H(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
434 ("\\($(5!I!h!O(B\\)" "$(5"'(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
435 ("\\($(5!I!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"I(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
436 ("\\($(5!I!i!h!O(B\\)" "$(5""(B") ; Nukta Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
437 ("\\($(5!I!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"y(B") ; Nukta Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
438 ("\\($(5!I!i(B\\)" "$(5#I(B") ; Nukta |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
439 ("\\($(5!J!h(B\\)$(5!F!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
440 ("\\($(5!J!h!F(B\\)" "$(5${(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
441 ("\\($(5!J!h(B\\)$(5!J!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
442 ("\\($(5!J!h!J(B\\)" "$(5$|(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
443 ("\\($(5!J!h(B\\)$(5!T!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
444 ("\\($(5!J!h!T(B\\)" "$(5$}(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
445 ("\\($(5!J!h!O(B\\)" "$(5!J"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
446 ("\\($(5!J!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
447 ("\\($(5!K!h!F(B\\)" "$(5$~(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
448 ("\\($(5!K!h!O(B\\)" "$(5!K"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
449 ("\\($(5!K!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"K(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
450 ("\\($(5!L!h!F(B\\)" "$(5#P(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
451 ("\\($(5!L!h!Q(B\\)" "$(5#Q(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
452 ("\\($(5!L!h!O(B\\)" "$(5!L"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
453 ("\\($(5!L!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"L(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
454 ("\\($(5!M!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"M(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
455 ("\\($(5!N!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"N(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
456 ;; special form for "ru". |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
457 ("\\($(5!O!](B\\)" "$(5",(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
458 ("\\($(5!O!^(B\\)" "$(5"-(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
459 ("\\($(5!P!](B\\)" "$(5".(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
460 ("\\($(5!P!^(B\\)" "$(5"/(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
461 ;; |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
462 ("\\($(5!Q!h!Q(B\\)" "$(5#`(B" sanskrit) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
463 ("\\($(5!Q!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"Q(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
464 ("\\($(5!R!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"R(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
465 ("\\($(5!S!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"S(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
466 ("\\($(5!T!h!F(B\\)" "$(5#a(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
467 ("\\($(5!T!h!T(B\\)" "$(5#b(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
468 ("\\($(5!T!h!O(B\\)" "$(5!T"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
469 ("\\($(5!T!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"T(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
470 ("\\($(5!U!h!8!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"h(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
471 ("\\($(5!U!h!8(B\\)" "$(5#c(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
472 ("\\($(5!U!h!F(B\\)" "$(5#d(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
473 ("\\($(5!U!h!J(B\\)" "$(5#e(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
474 ("\\($(5!U!h!Q(B\\)" "$(5#f(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
475 ("\\($(5!U!h(B\\)$(5!T!h!O(B" "$(5"U(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
476 ("\\($(5!U!h!T!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"j(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
477 ; ("\\($(5!U!h!T(B\\)" "$(5#g(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
478 ("\\($(5!U!h!O!h!T(B\\)" "$(5#g(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
479 ("\\($(5!U!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"i(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
480 ("\\($(5!U!h!O(B\\)" "$(5")(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
481 ("\\($(5!U!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"U(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
482 ("\\($(5!V!h!=!h!O!h!M(B\\)" "$(5#h(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
483 ("\\($(5!V!h!=!h!M(B\\)" "$(5#i(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
484 ("\\($(5!V!h!=!h!T(B\\)" "$(5#j(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
485 ("\\($(5!V!h!=(B\\)" "$(5#k(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
486 ("\\($(5!V!h!>(B\\)" "$(5#l(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
487 ("\\($(5!V!h!O(B\\)" "$(5!V"q(B") ; Post "r" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
488 ("\\($(5!V!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"V(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
489 ("\\($(5!W!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"W"F(B") ; Special Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
490 ("\\($(5!W!h!F(B\\)" "$(5#m(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
491 ("\\($(5!W!h!O(B\\)" "$(5#n(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
492 ("\\($(5!W!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"W(B") ; Half Form |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
493 ("\\($(5!X!h!A(B\\)" "$(5#p(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
494 ("\\($(5!X!h!F(B\\)" "$(5#q(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
495 ("\\($(5!X!h!L(B\\)" "$(5#r(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
496 ("\\($(5!X!h!M(B\\)" "$(5#s(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
497 ("\\($(5!X!h!O(B\\)" "$(5#t(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
498 ("\\($(5!X!h!Q(B\\)" "$(5#u(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
499 ("\\($(5!X!h!T(B\\)" "$(5#v(B") |
17052 | 500 ;; Special Ligature Rules |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
501 ("\\($(5!X!_(B\\)" "$(5#R(B") |
17052 | 502 |
503 ;; For consonants other than listed above, glyph-composition will | |
504 ;; be applied. If the consonant which is preceding "$(5!O(B" does not | |
505 ;; have the vertical line (such as "$(5!?(B"), "$(5"r(B" is put beneath the | |
506 ;; consonant. | |
507 ;; | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
508 ("[$(5!7!9!=!>!?!@!D!O!P!R!S!X(B]\\($(5!h!O(B\\)" "$(5"r(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
509 ("[$(5!6!8!C!E!F!H!J!K!L!M!T!V(B]\\($(5!h!O(B\\)" "$(5"q(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
510 ("$(5!?!i(B\\($(5!h!O(B\\)" "$(5"r(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
511 ("$(5!@!i(B\\($(5!h!O(B\\)" "$(5"r(B") |
17052 | 512 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
513 ;; Nukta with Non-Consonants |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
514 ("\\($(5!!!i(B\\)" "$(5#!(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
515 ("\\($(5!&!i(B\\)" "$(5#&(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
516 ("\\($(5!'!i(B\\)" "$(5#'(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
517 ("\\($(5!*!i(B\\)" "$(5#*(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
518 ("\\($(5![!i(B\\)" "$(5#L(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
519 ("\\($(5!\!i(B\\)" "$(5#M(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
520 ("\\($(5!_!i(B\\)" "$(5#K(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
521 ("\\($(5!j!i(B\\)" "$(5#J(B") |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
522 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
523 ;; Special rule for "r + some vowels" |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
524 ("\\($(5!O!_(B\\)" "$(5!*"p(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
525 ("\\($(5!O#L(B\\)" "$(5#&"p(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
526 ("\\($(5!O#K(B\\)" "$(5#*"p(B") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
527 ("\\($(5!O#M(B\\)" "$(5#'"p(B") |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
528 ;; If everything fails, "y" will connect to the front consonant. |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
529 ("\\($(5!h!M(B\\)" "$(5"](B") |
17052 | 530 ) |
531 "Alist of regexps of Devanagari character sequences vs composed characters.") | |
532 | |
533 (let ((rules devanagari-char-to-glyph-rules)) | |
534 (while rules | |
535 (let ((rule (car rules)) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
536 (chars) (char) (glyphs) (glyph)) |
17052 | 537 (setq rules (cdr rules)) |
538 (string-match "\\\\(\\(.+\\)\\\\)" (car rule)) | |
539 (setq chars (substring (car rule) (match-beginning 1) (match-end 1))) | |
540 (setq char (string-to-char chars)) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
541 (setq glyphs (cdr rule)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
542 (setq glyph (string-to-char (car glyphs))) |
17052 | 543 (put-char-code-property |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
544 char 'char-to-glyph |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
545 ;; We don't "cons" it since priority is top to down. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
546 (append (get-char-code-property char 'char-to-glyph) (list rule))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
547 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
548 (if (and (< ?(5z(B glyph) ; Glyphs only. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
549 (null (get-char-code-property glyph 'glyph-to-char))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
550 ; One glyph may corresponds to multiple characters, |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
551 ; e.g., surrounding vowel in Tamil, etc. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
552 ; but for Devanagari, we put this restriction |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
553 ; to make sure the fact that one glyph corresponds to one char. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
554 (put-char-code-property |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
555 glyph 'glyph-to-char |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
556 (cons (list (car glyphs) chars) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
557 (get-char-code-property glyph 'glyph-to-char) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
558 )))))) |
17052 | 559 |
560 ;; | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
561 ;; Function used in both characters-to-glyphs conversion and |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
562 ;; glyphs-to-characters conversion. |
17052 | 563 ;; |
564 | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
565 (defun max-match-len (regexp-str) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
566 "This returns the possible length of matched string of given regexp. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
567 Only [...] pattern of regexp is recognized. The last character of |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
568 inside of [....] is used for its length." |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
569 (let ((dest-str regexp-str)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
570 (while (string-match "\\[\\([^\]]\\)+\\]" dest-str) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
571 (setq dest-str |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
572 (concat (substring dest-str 0 (match-beginning 0)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
573 (substring dest-str (match-beginning 1) (match-end 1)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
574 (substring dest-str (match-end 0))))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
575 (length dest-str))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
576 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
577 (defun string-conversion-by-rule (src-str symbol &rest specs) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
578 " This function converts the SRC-STR to the new string according to |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
579 the rules described in the each character's SYMBOL property. The |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
580 rules are described in the forms of '((regexp str <specs>) ...), and |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
581 the character sequence in the string which matches to 'regexp' are |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
582 replaced with str. If SPECS are not specified, only rules with no |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
583 <specs> would be applied. If SPECS are specified, then rules with no |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
584 <specs> specified and rules with <spec> matches with SPECS would be |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
585 applied. Rules are tested in the order of the list, thus more |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
586 specific rules should be placed in front of less important rules. No |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
587 composite character is supported, thus such must be converted by |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
588 decompose-char before applying to this function. If rule is given in |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
589 the forms of regexp '...\\(...\\)...', then inside the parenthesis is |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
590 the subject of the match. Otherwise, the entire expression is the |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
591 subject of the match." |
17052 | 592 (let ((pos 0) |
593 (dst-str "")) | |
594 (while (< pos (length src-str)) | |
595 (let ((found nil) | |
596 (rules (get-char-code-property | |
597 (string-to-char | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
598 (substring src-str pos)) symbol))) |
17052 | 599 (while rules |
600 (let* ((rule (car rules)) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
601 (regexp (car rule)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
602 (replace-str (car (cdr rule))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
603 (rule-specs (cdr (cdr rule))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
604 search-pos) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
605 (if (not (or (null rule-specs) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
606 (intersection specs rule-specs))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
607 (setq rules (cdr rules)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
608 (if (null (string-match "\\\\(.+\\\\)" regexp)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
609 (progn |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
610 (setq regexp (concat "\\(" regexp "\\)")) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
611 (setq search-pos pos)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
612 (setq search-pos (- pos (max-match-len |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
613 (substring regexp |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
614 (string-match "^[^\\\\]*" regexp) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
615 (match-end 0)))))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
616 (if (< search-pos 0) (setq search-pos 0)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
617 (if (string-match regexp src-str search-pos) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
618 (if (= (match-beginning 1) pos) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
619 (progn |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
620 (setq dst-str (concat dst-str replace-str)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
621 (setq rules nil) ; Get out of the loop. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
622 (setq found t) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
623 ;; proceed `pos' for replaced characters. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
624 (setq pos (match-end 1))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
625 (setq rules (cdr rules))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
626 (setq rules (cdr rules)))))) |
17052 | 627 ;; proceed to next position |
628 (if (not found) | |
629 (let ((nextchar (string-to-char (substring src-str pos)))) | |
630 (setq pos (+ pos | |
631 (char-bytes (string-to-char (substring src-str pos))))) | |
632 (setq dst-str (concat dst-str (char-to-string nextchar))))))) | |
633 dst-str)) | |
634 | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
635 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
636 ;; |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
637 ;; Convert Character Code to Glyph Code |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
638 ;; |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
639 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
640 ;;;###autoload |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
641 (defun char-to-glyph-devanagari (src-str &rest langs) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
642 "Convert Devanagari characters in the string to Devanagari glyphs. |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
643 Ligatures and special rules are processed." |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
644 (apply |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
645 'string-conversion-by-rule |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
646 (append (list src-str 'char-to-glyph) langs))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
647 |
17052 | 648 ;; Example: |
649 ;;(char-to-glyph-devanagari "$(5!X![!F!h!D!\(B") => "$(5!X!["F!D!\(B" | |
650 ;;(char-to-glyph-devanagari "$(5!O!Z!V!h!=!h!O![!M(B") => ??? | |
651 | |
652 ;; | |
653 ;; Phase 2: Compose Glyphs to form One Glyph. | |
654 ;; | |
655 | |
656 ;; Each list consist of glyph, application-priority and application-direction. | |
657 ;; | |
658 ;; Glyphs will be ordered from low priority number to high priority number. | |
659 ;; If application-priority is omitted, it is assumed to be 0. | |
660 ;; If application-direction is omitted, it is asumbed to be '(mr . ml). | |
661 | |
662 (defconst devanagari-composition-rules | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
663 '((?$(5!!(B 0 (tr . br)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
664 (?$(5!"(B 0 (mr . mr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
665 (?$(5!#(B 0) |
17052 | 666 (?$(5!$(B 0) |
667 (?$(5!%(B 0) | |
668 (?$(5!&(B 0) | |
669 (?$(5!'(B 0) | |
670 (?$(5!((B 0) | |
671 (?$(5!)(B 0) | |
672 (?$(5!*(B 0) | |
673 (?$(5!+(B 0) | |
674 (?$(5!,(B 0) | |
675 (?$(5!-(B 0) | |
676 (?$(5!.(B 0) | |
677 (?$(5!/(B 0) | |
678 (?$(5!0(B 0) | |
679 (?$(5!1(B 0) | |
680 (?$(5!2(B 0) | |
681 (?$(5!3(B 0) | |
682 (?$(5!4(B 0) | |
683 (?$(5!5(B 0) | |
684 (?$(5!6(B 0) | |
685 (?$(5!7(B 0) | |
686 (?$(5!8(B 0) | |
687 (?$(5!9(B 0) | |
688 (?$(5!:(B 0) | |
689 (?$(5!;(B 0) | |
690 (?$(5!<(B 0) | |
691 (?$(5!=(B 0) | |
692 (?$(5!>(B 0) | |
693 (?$(5!?(B 0) | |
694 (?$(5!@(B 0) | |
695 (?$(5!A(B 0) | |
696 (?$(5!B(B 0) | |
697 (?$(5!C(B 0) | |
698 (?$(5!D(B 0) | |
699 (?$(5!E(B 0) | |
700 (?$(5!F(B 0) | |
701 (?$(5!G(B 0) | |
702 (?$(5!H(B 0) | |
703 (?$(5!I(B 0) | |
704 (?$(5!J(B 0) | |
705 (?$(5!K(B 0) | |
706 (?$(5!L(B 0) | |
707 (?$(5!M(B 0) | |
708 (?$(5!N(B 0) | |
709 (?$(5!O(B 0) | |
710 (?$(5!P(B 0) | |
711 (?$(5!Q(B 0) | |
712 (?$(5!R(B 0) | |
713 (?$(5!S(B 0) | |
714 (?$(5!T(B 0) | |
715 (?$(5!U(B 0) | |
716 (?$(5!V(B 0) | |
717 (?$(5!W(B 0) | |
718 (?$(5!X(B 0) | |
719 (?$(5!Y(B 0) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
720 (?$(5!Z(B 0) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
721 (?$(5![(B 0 (ml . mr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
722 (?$(5!\(B 0) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
723 (?$(5!](B 0 (br . tr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
724 (?$(5!^(B 0 (br . tr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
725 (?$(5!_(B 0 (br . tr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
726 (?$(5!`(B 0 (mr . mr)) ; (tc . bc) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
727 (?$(5!a(B 0 (mr . mr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
728 (?$(5!b(B 0 (mr . mr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
729 (?$(5!c(B 0 (mr . mr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
730 (?$(5!d(B 0) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
731 (?$(5!e(B 0) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
732 (?$(5!f(B 0) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
733 (?$(5!g(B 0) |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
734 (?$(5!h(B 0 (br . tr)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
735 (?$(5!i(B 0 (br . tr)) |
17052 | 736 (?$(5!j(B 0) |
737 (nil 0) | |
738 (nil 0) | |
739 (nil 0) | |
740 (nil 0) | |
741 (nil 0) | |
742 (nil 0) | |
743 (?$(5!q(B 0) | |
744 (?$(5!r(B 0) | |
745 (?$(5!s(B 0) | |
746 (?$(5!t(B 0) | |
747 (?$(5!u(B 0) | |
748 (?$(5!v(B 0) | |
749 (?$(5!w(B 0) | |
750 (?$(5!x(B 0) | |
751 (?$(5!y(B 0) | |
752 (?$(5!z(B 0) | |
753 (nil 0) | |
754 (nil 0) | |
755 (nil 0) | |
756 (nil 0) | |
757 (?$(5"!(B 0) | |
758 (?$(5""(B 0) | |
759 (?$(5"#(B 0) | |
760 (?$(5"$(B 0) | |
761 (?$(5"%(B 0) | |
762 (?$(5"&(B 0) | |
763 (?$(5"'(B 0) | |
764 (?$(5"((B 0) | |
765 (?$(5")(B 0) | |
766 (?$(5"*(B 0) | |
767 (?$(5"+(B 0) | |
768 (?$(5",(B 0) | |
769 (?$(5"-(B 0) | |
770 (?$(5".(B 0) | |
771 (?$(5"/(B 0) | |
772 (?$(5"0(B 0) | |
773 (?$(5"1(B 0) | |
774 (?$(5"2(B 0) | |
775 (?$(5"3(B 0) | |
776 (?$(5"4(B 0) | |
777 (?$(5"5(B 0) | |
778 (?$(5"6(B 0) | |
779 (?$(5"7(B 0) | |
780 (?$(5"8(B 0) | |
781 (?$(5"9(B 0) | |
782 (?$(5":(B 0) | |
783 (?$(5";(B 0) | |
784 (?$(5"<(B 0) | |
785 (?$(5"=(B 0) | |
786 (?$(5">(B 0) | |
787 (?$(5"?(B 0) | |
788 (?$(5"@(B 0) | |
789 (?$(5"A(B 0) | |
790 (?$(5"B(B 0) | |
791 (?$(5"C(B 0) | |
792 (?$(5"D(B 0) | |
793 (?$(5"E(B 0) | |
794 (?$(5"F(B 0) | |
795 (?$(5"G(B 0) | |
796 (?$(5"H(B 0) | |
797 (?$(5"I(B 0) | |
798 (?$(5"J(B 0) | |
799 (?$(5"K(B 0) | |
800 (?$(5"L(B 0) | |
801 (?$(5"M(B 0) | |
802 (?$(5"N(B 0) | |
803 (?$(5"O(B 0) | |
804 (?$(5"P(B 0) | |
805 (?$(5"Q(B 0) | |
806 (?$(5"R(B 0) | |
807 (?$(5"S(B 0) | |
808 (?$(5"T(B 0) | |
809 (?$(5"U(B 0) | |
810 (?$(5"V(B 0) | |
811 (?$(5"W(B 0) | |
812 (?$(5"X(B 0) | |
813 (?$(5"Y(B 0) | |
814 (?$(5"Z(B 0) | |
815 (?$(5"[(B 0) | |
816 (?$(5"\(B 0) | |
817 (?$(5"](B 0) | |
818 (?$(5"^(B 0) | |
819 (?$(5"_(B 0) | |
820 (?$(5"`(B 0) | |
821 (?$(5"a(B 0) | |
822 (?$(5"b(B 0) | |
823 (?$(5"c(B 0) | |
824 (?$(5"d(B 0) | |
825 (?$(5"e(B 0) | |
826 (?$(5"f(B 0) | |
827 (?$(5"g(B 0) | |
828 (?$(5"h(B 0) | |
829 (?$(5"i(B 0) | |
830 (?$(5"j(B 0) | |
831 (?$(5"k(B 0) | |
832 (?$(5"l(B 0) | |
833 (?$(5"m(B 0) | |
834 (?$(5"n(B 0) | |
835 (?$(5"o(B 0) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
836 (?$(5"p(B 10 (mr . mr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
837 (?$(5"q(B 0 (br . br)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
838 (?$(5"r(B 0 (br . tr)) |
17052 | 839 (?$(5"s(B 0) |
840 (?$(5"t(B 0) | |
841 (?$(5"u(B 0) | |
842 (?$(5"v(B 0) | |
843 (?$(5"w(B 0) | |
844 (?$(5"x(B 0) | |
845 (?$(5"y(B 0) | |
846 (?$(5"z(B 0) | |
847 (?$(5"{(B 0) | |
848 (?$(5"|(B 0) | |
849 (?$(5"}(B 0) | |
850 (?$(5"~(B 0) | |
851 (?$(5#!(B 0) | |
852 (?$(5#"(B 0) | |
853 (?$(5##(B 0) | |
854 (?$(5#$(B 0) | |
855 (?$(5#%(B 0) | |
856 (?$(5#&(B 0) | |
857 (?$(5#'(B 0) | |
858 (?$(5#((B 0) | |
859 (?$(5#)(B 0) | |
860 (?$(5#*(B 0) | |
861 (?$(5#+(B 0) | |
862 (?$(5#,(B 0) | |
863 (?$(5#-(B 0) | |
864 (?$(5#.(B 0) | |
865 (?$(5#/(B 0) | |
866 (?$(5#0(B 0) | |
867 (?$(5#1(B 0) | |
868 (?$(5#2(B 0) | |
869 (?$(5#3(B 0) | |
870 (?$(5#4(B 0) | |
871 (?$(5#5(B 0) | |
872 (?$(5#6(B 0) | |
873 (?$(5#7(B 0) | |
874 (?$(5#8(B 0) | |
875 (?$(5#9(B 0) | |
876 (?$(5#:(B 0) | |
877 (?$(5#;(B 0) | |
878 (?$(5#<(B 0) | |
879 (?$(5#=(B 0) | |
880 (?$(5#>(B 0) | |
881 (?$(5#?(B 0) | |
882 (?$(5#@(B 0) | |
883 (?$(5#A(B 0) | |
884 (?$(5#B(B 0) | |
885 (?$(5#C(B 0) | |
886 (?$(5#D(B 0) | |
887 (?$(5#E(B 0) | |
888 (?$(5#F(B 0) | |
889 (?$(5#G(B 0) | |
890 (?$(5#H(B 0) | |
891 (?$(5#I(B 0) | |
892 (?$(5#J(B 0) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
893 (?$(5#K(B 0 (br . tr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
894 (?$(5#L(B 0 (br . tr)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
895 (?$(5#M(B 0 (br . tr)) |
17052 | 896 (?$(5#N(B 0) |
897 (?$(5#O(B 0) | |
898 (?$(5#P(B 0) | |
899 (?$(5#Q(B 0) | |
900 (?$(5#R(B 0) | |
901 (?$(5#S(B 0) | |
902 (?$(5#T(B 0) | |
903 (?$(5#U(B 0) | |
904 (?$(5#V(B 0) | |
905 (?$(5#W(B 0) | |
906 (?$(5#X(B 0) | |
907 (?$(5#Y(B 0) | |
908 (?$(5#Z(B 0) | |
909 (?$(5#[(B 0) | |
910 (?$(5#\(B 0) | |
911 (?$(5#](B 0) | |
912 (?$(5#^(B 0) | |
913 (?$(5#_(B 0) | |
914 (?$(5#`(B 0) | |
915 (?$(5#a(B 0) | |
916 (?$(5#b(B 0) | |
917 (?$(5#c(B 0) | |
918 (?$(5#d(B 0) | |
919 (?$(5#e(B 0) | |
920 (?$(5#f(B 0) | |
921 (?$(5#g(B 0) | |
922 (?$(5#h(B 0) | |
923 (?$(5#i(B 0) | |
924 (?$(5#j(B 0) | |
925 (?$(5#k(B 0) | |
926 (?$(5#l(B 0) | |
927 (?$(5#m(B 0) | |
928 (?$(5#n(B 0) | |
929 (?$(5#o(B 0) | |
930 (?$(5#p(B 0) | |
931 (?$(5#q(B 0) | |
932 (?$(5#r(B 0) | |
933 (?$(5#s(B 0) | |
934 (?$(5#t(B 0) | |
935 (?$(5#u(B 0) | |
936 (?$(5#v(B 0) | |
937 (?$(5#w(B 0) | |
938 (?$(5#x(B 0) | |
939 (?$(5#y(B 0) | |
940 (?$(5#z(B 0) | |
941 (?$(5#{(B 0) | |
942 (?$(5#|(B 0) | |
943 (?$(5#}(B 0) | |
944 (?$(5#~(B 0) | |
945 (?$(5$!(B 0) | |
946 (?$(5$"(B 0) | |
947 (?$(5$#(B 0) | |
948 (?$(5$$(B 0) | |
949 (?$(5$%(B 0) | |
950 (?$(5$&(B 0) | |
951 (?$(5$'(B 0) | |
952 (?$(5$((B 0) | |
953 (?$(5$)(B 0) | |
954 (?$(5$*(B 0) | |
955 (?$(5$+(B 0) | |
956 (?$(5$,(B 0) | |
957 (?$(5$-(B 0) | |
958 (?$(5$.(B 0) | |
959 (?$(5$/(B 0) | |
960 (?$(5$0(B 0) | |
961 (?$(5$1(B 0) | |
962 (?$(5$2(B 0) | |
963 (?$(5$3(B 0) | |
964 (?$(5$4(B 0) | |
965 (?$(5$5(B 0) | |
966 (?$(5$6(B 0) | |
967 (?$(5$7(B 0) | |
968 (?$(5$8(B 0) | |
969 (?$(5$9(B 0) | |
970 (?$(5$:(B 0) | |
971 (?$(5$;(B 0) | |
972 (?$(5$<(B 0) | |
973 (?$(5$=(B 0) | |
974 (?$(5$>(B 0) | |
975 (?$(5$?(B 0) | |
976 (?$(5$@(B 0) | |
977 (?$(5$A(B 0) | |
978 (?$(5$B(B 0) | |
979 (?$(5$C(B 0) | |
980 (?$(5$D(B 0) | |
981 (?$(5$E(B 0) | |
982 (?$(5$F(B 0) | |
983 (?$(5$G(B 0) | |
984 (?$(5$H(B 0) | |
985 (?$(5$I(B 0) | |
986 (?$(5$J(B 0) | |
987 (?$(5$K(B 0) | |
988 (?$(5$L(B 0) | |
989 (?$(5$M(B 0) | |
990 (?$(5$N(B 0) | |
991 (?$(5$O(B 0) | |
992 (?$(5$P(B 0) | |
993 (?$(5$Q(B 0) | |
994 (?$(5$R(B 0) | |
995 (?$(5$S(B 0) | |
996 (?$(5$T(B 0) | |
997 (?$(5$U(B 0) | |
998 (?$(5$V(B 0) | |
999 (?$(5$W(B 0) | |
1000 (?$(5$X(B 0) | |
1001 (?$(5$Y(B 0) | |
1002 (?$(5$Z(B 0) | |
1003 (?$(5$[(B 0) | |
1004 (?$(5$\(B 0) | |
1005 (?$(5$](B 0) | |
1006 (?$(5$^(B 0) | |
1007 (?$(5$_(B 0) | |
1008 (?$(5$`(B 0) | |
1009 (?$(5$a(B 0) | |
1010 (?$(5$b(B 0) | |
1011 (?$(5$c(B 0) | |
1012 (?$(5$d(B 0) | |
1013 (?$(5$e(B 0) | |
1014 (?$(5$f(B 0) | |
1015 (?$(5$g(B 0) | |
1016 (?$(5$h(B 0) | |
1017 (?$(5$i(B 0) | |
1018 (?$(5$j(B 0) | |
1019 (?$(5$k(B 0) | |
1020 (?$(5$l(B 0) | |
1021 (?$(5$m(B 0) | |
1022 (?$(5$n(B 0) | |
1023 (?$(5$o(B 0) | |
1024 (?$(5$p(B 0) | |
1025 (?$(5$q(B 0) | |
1026 (?$(5$r(B 0) | |
1027 (?$(5$s(B 0) | |
1028 (?$(5$t(B 0) | |
1029 (?$(5$u(B 0) | |
1030 (?$(5$v(B 0) | |
1031 (?$(5$w(B 0) | |
1032 (?$(5$x(B 0) | |
1033 (?$(5$y(B 0) | |
1034 (?$(5$z(B 0) | |
1035 (?$(5${(B 0) | |
1036 (?$(5$|(B 0) | |
1037 (?$(5$}(B 0) | |
1038 (?$(5$~(B 0) | |
1039 )) | |
1040 | |
1041 ;; Determine composition priority and rule of the array of Glyphs. | |
1042 ;; Sort the glyphs with their priority. | |
1043 | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1044 (defun devanagari-reorder-glyphs-for-composition (glyph-alist) |
17052 | 1045 (let* ((pos 0) |
1046 (ordered-glyphs '())) | |
1047 (while (< pos (length glyph-alist)) | |
1048 (let* ((glyph (aref glyph-alist pos))) | |
1049 (setq pos (1+ pos)) | |
1050 (setq ordered-glyphs | |
1051 (append ordered-glyphs (list (assq glyph devanagari-composition-rules)))))) | |
1052 (sort ordered-glyphs '(lambda (x y) (< (car (cdr x)) (car (cdr y))))))) | |
1053 | |
1054 ;;(devanagari-compose-to-one-glyph "$(5"5!X![(B") => "2$(6!XP"5@![1(B" | |
1055 | |
1056 (defun devanagari-compose-to-one-glyph (devanagari-string) | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1057 (let* ((o-glyph-list (devanagari-reorder-glyphs-for-composition |
17052 | 1058 (string-to-vector devanagari-string))) |
1059 ;; List of glyphs to be composed. | |
1060 (cmp-glyph-list (list (car (car o-glyph-list)))) | |
1061 (o-glyph-list (cdr o-glyph-list))) | |
1062 (while o-glyph-list | |
1063 (let* ((o-glyph (car o-glyph-list)) | |
1064 (glyph (if (< 2 (length o-glyph)) | |
1065 ;; default composition | |
1066 (list (car (cdr (cdr o-glyph))) (car o-glyph)) | |
1067 ;; composition with a specified rule | |
1068 (list '(mr . ml) (car o-glyph))))) | |
1069 (setq o-glyph-list (cdr o-glyph-list)) | |
1070 (setq cmp-glyph-list (append cmp-glyph-list glyph)))) | |
1071 ;; Before applying compose-chars, convert glyphs to | |
1072 ;; 1-column width if possible. | |
1073 (setq cmp-glyph-list (devanagari-wide-to-narrow cmp-glyph-list)) | |
1074 (if (= (length cmp-glyph-list) 1) (char-to-string (car cmp-glyph-list)) | |
1075 (apply 'compose-chars cmp-glyph-list)))) | |
1076 | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1077 ;; Utility function for Phase 2.5 |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1078 ;; Check whether given glyph is a Devanagari vertical modifier or not. |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1079 ;; If it is a vertical modifier, whether it should be 1-column shape or not |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1080 ;; depends on previous non-vertical modifier. |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1081 ; return nil if it is not vertical modifier. |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1082 (defun devanagari-vertical-modifier-p (glyph) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1083 (string-match (char-to-string glyph) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1084 "[$(5!]!^!_!`!a!b!c!h!i"p"q"r#K#L#M(B]")) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1085 |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1086 (defun devanagari-non-vertical-modifier-p (glyph) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1087 (string-match (char-to-string glyph) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1088 "[$(5!Z![!\!d!e!f!g(B]")) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1089 |
17052 | 1090 |
1091 ;; | |
1092 ;; Phase 2.5 Convert Appropriate Character to 1-column shape. | |
1093 ;; | |
1094 ;; This is temporary and should be removed out when Emacs supports | |
1095 ;; variable width characters. | |
1096 ;; | |
1097 ;; This will convert the composing glyphs (2 column glyphs) | |
1098 ;; to narrow (1 column) glyphs if they exist. | |
1099 ;; | |
1100 ;; devanagari-wide-to-narrow-old converts glyphs simply. | |
1101 ;; devanagari-wide-to-narrow takes care of upper/lower apply-glyphs | |
1102 ;; with 2 column base-glyph. | |
1103 ;; | |
1104 ;; Execution Examples | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1105 ;;(devanagari-wide-to-narrow '(?$(5!3(B (ml . ml) ?$(5!a(B)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1106 ;;(devanagari-wide-to-narrow '(?$(5!F(B (ml . ml) ?$(5!a(B)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1107 |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1108 ;(defun devanagari-wide-to-narrow (src-list) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1109 ; (if (null src-list) '() |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1110 ; (cons |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1111 ; (if (and (numberp (car src-list)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1112 ; (cdr (assq (car src-list) devanagari-1-column-char))) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1113 ; (cdr (assq (car src-list) devanagari-1-column-char)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1114 ; (car src-list)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1115 ; (devanagari-wide-to-narrow (cdr src-list))))) |
17052 | 1116 |
1117 (defun devanagari-wide-to-narrow (src-list) | |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1118 (devanagari-wide-to-narrow-iter src-list t)) |
17052 | 1119 |
17087
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1120 (defun devanagari-wide-to-narrow-iter (src-list wide-p) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1121 (let ((glyph (car src-list))) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1122 (cond ((null src-list) '()) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1123 ; not glyph code |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1124 ((not (numberp glyph)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1125 (cons glyph (devanagari-wide-to-narrow-iter (cdr src-list) wide-p))) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1126 ; vertical modifier glyph |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1127 ((devanagari-vertical-modifier-p glyph) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1128 (if (and (null wide-p) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1129 (cdr (assq glyph devanagari-1-column-char))) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1130 (cons (cdr (assq glyph devanagari-1-column-char)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1131 (devanagari-wide-to-narrow-iter (cdr src-list) nil)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1132 (cons glyph |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1133 (devanagari-wide-to-narrow-iter (cdr src-list) t)))) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1134 ; nonvertical modifier glyph |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1135 ((devanagari-non-vertical-modifier-p glyph) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1136 (if (cdr (assq glyph devanagari-1-column-char)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1137 (cons (cdr (assq glyph devanagari-1-column-char)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1138 (devanagari-wide-to-narrow-iter (cdr src-list) wide-p)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1139 (cons glyph |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1140 (devanagari-wide-to-narrow-iter (cdr src-list) wide-p)))) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1141 ; normal glyph |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1142 (t |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1143 (if (cdr (assq glyph devanagari-1-column-char)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1144 (cons (cdr (assq glyph devanagari-1-column-char)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1145 (devanagari-wide-to-narrow-iter (cdr src-list) nil)) |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1146 (cons glyph |
fb13faeea9aa
Fix handling of several characters.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1147 (devanagari-wide-to-narrow-iter (cdr src-list) t))))))) |
17052 | 1148 |
1149 | |
1150 ;; | |
1151 ;; Summary | |
1152 ;; | |
1153 | |
1154 ;; | |
1155 ;; Decomposition of composite font. | |
1156 ;; | |
1157 | |
1158 (defun devanagari-normalize-narrow-glyph (charlist) | |
1159 (let ((wide-char (car (rassoc (car charlist) devanagari-1-column-char)))) | |
1160 (if (null charlist) nil | |
1161 (cons (if (null wide-char) (car charlist) wide-char) | |
1162 (devanagari-normalize-narrow-glyph (cdr charlist)))))) | |
1163 | |
1164 (defvar devanagari-decomposition-rules | |
1165 '( | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1166 (?$(5"p(B -10) |
17052 | 1167 ) |
1168 ) | |
1169 | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1170 (defun devanagari-reorder-glyphs-for-decomposition (glyphlist) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1171 "This function re-orders glyph list for decomposition." |
17052 | 1172 (sort glyphlist |
1173 '(lambda (x y) | |
1174 (let ((xx (assoc x devanagari-decomposition-rules)) | |
1175 (yy (assoc y devanagari-decomposition-rules))) | |
1176 (if (null xx) (setq xx 0)) | |
1177 (if (null yy) (setq yy 0)) | |
1178 (< xx yy))))) | |
1179 | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1180 (defun devanagari-decompose-char (glyph) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1181 "This function decomposes one Devanagari composite glyph to |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1182 basic Devanagari characters as a string." |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1183 (let ((glyphlist |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1184 (if (eq (car (split-char glyph)) 'composition) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1185 (string-to-list (decompose-composite-char glyph)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1186 (list glyph)))) |
17052 | 1187 (setq glyphlist (devanagari-normalize-narrow-glyph glyphlist)) |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1188 (setq glyphlist (devanagari-reorder-glyphs-for-decomposition glyphlist)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1189 (string-conversion-by-rule |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1190 (mapconcat 'char-to-string glyphlist "") 'glyph-to-char))) |
17052 | 1191 |
1192 ;;;###autoload | |
1193 (defun devanagari-decompose-string (str) | |
1194 "This function Decomposes Devanagari glyph string to | |
1195 basic Devanagari character string." | |
1196 (let ((src str) (dst "")) | |
1197 (while (not (equal src "")) | |
1198 (let* ((char (string-to-char src)) | |
1199 (clen (char-bytes char))) | |
1200 (setq src (substring src clen)) | |
1201 (setq dst (concat dst | |
1202 (devanagari-decompose-char char))))) | |
1203 dst)) | |
1204 | |
1205 ;;;###autoload | |
1206 (defun devanagari-decompose-region (from to) | |
1207 (interactive "r") | |
1208 (save-restriction | |
1209 (narrow-to-region from to) | |
1210 (goto-char (point-min)) | |
1211 (while (re-search-forward "." nil t) | |
1212 (let* ((match-b (match-beginning 0)) (match-e (match-end 0)) | |
1213 (decmps (devanagari-decompose-string (buffer-substring match-b match-e)))) | |
1214 (delete-char -1) | |
1215 (insert decmps))))) | |
1216 | |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1217 ;;; |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1218 ;;; Composition |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1219 ;;; |
17052 | 1220 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1221 ;;;###autoload |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1222 (defun devanagari-compose-string (str &rest langs) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1223 (let ((len (length str)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1224 (src (devanagari-decompose-string str)) (dst "") rest match-b match-e) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1225 (while (string-match devanagari-composite-glyph-unit src) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1226 (setq match-b (match-beginning 0) match-e (match-end 0)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1227 (setq dst |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1228 (concat dst |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1229 (substring src 0 match-b) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1230 (devanagari-compose-to-one-glyph |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1231 (apply |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1232 'char-to-glyph-devanagari |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1233 (cons (substring src match-b match-e) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1234 langs))))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1235 (setq src (substring src match-e))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1236 (setq dst (concat dst src)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1237 dst)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1238 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1239 ;;;###autoload |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1240 (defun devanagari-compose-region (from to &rest langs) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1241 (interactive "r") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1242 (save-restriction |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1243 (narrow-to-region from to) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1244 (goto-char (point-min)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1245 (while (re-search-forward devanagari-composite-glyph-unit nil t) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1246 (let* ((match-b (match-beginning 0)) (match-e (match-end 0)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1247 (cmps (devanagari-compose-to-one-glyph |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1248 (apply |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1249 'char-to-glyph-devanagari |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1250 (cons (buffer-substring match-b match-e) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1251 langs))))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1252 (delete-region match-b match-e) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1253 (insert cmps))))) |
17052 | 1254 |
1255 ;; For pre-write and post-read conversion | |
1256 | |
1257 ;;;###autoload | |
1258 (defun devanagari-compose-from-is13194-region (from to) | |
1259 "Compose IS 13194 characters in the region to Devanagari characters." | |
1260 (interactive "r") | |
20111
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1261 (save-excursion |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1262 (save-restriction |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1263 (narrow-to-region from to) |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1264 (indian-to-devanagari-region (point-min) (point-max)) |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1265 (devanagari-compose-region (point-min) (point-max)) |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1266 (- (point-max) (point-min))))) |
17052 | 1267 |
1268 ;;;###autoload | |
17773
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1269 (defun in-is13194-devanagari-post-read-conversion (len) |
20111
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1270 (let ((pos (point)) |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1271 (buffer-modified-p (buffer-modified-p))) |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1272 (prog1 |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1273 (devanagari-compose-from-is13194-region pos (+ pos len)) |
761a83f7cb4e
(devanagari-compose-from-is13194-region):
Kenichi Handa <handa@m17n.org>
parents:
18547
diff
changeset
|
1274 (set-buffer-modified-p buffer-modified-p)))) |
17773
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1275 |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1276 ;;;###autoload |
17052 | 1277 (defun devanagari-decompose-to-is13194-region (from to) |
1278 "Decompose Devanagari characters in the region to IS 13194 characters." | |
1279 (interactive "r") | |
1280 (save-restriction | |
1281 (narrow-to-region from to) | |
1282 (devanagari-decompose-region (point-min) (point-max)) | |
1283 (devanagari-to-indian-region (point-min) (point-max)))) | |
1284 | |
17773
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1285 ;;;###autoload |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1286 (defun in-is13194-devanagari-pre-write-conversion (from to) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1287 (let ((old-buf (current-buffer)) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1288 (work-buf (get-buffer-create " *devanagari-work*"))) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1289 (set-buffer work-buf) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1290 (erase-buffer) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1291 (if (stringp from) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1292 (insert from) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1293 (insert-buffer-substring old-buf from to)) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1294 (devanagari-decompose-to-is13194-region (point-min) (point-max)) |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1295 ;; Should return nil as annotations. |
f1ece95d00c2
(in-is13194-devanagari-post-read-conversion): New function.
Kenichi Handa <handa@m17n.org>
parents:
17314
diff
changeset
|
1296 nil)) |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1297 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1298 ;; For input/output of ITRANS |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1299 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1300 ;;;###autoload |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1301 (defun devanagari-encode-itrans-region (from to) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1302 (interactive "r") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1303 (save-restriction |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1304 (narrow-to-region from to) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1305 (devanagari-decompose-to-is13194-region (point-min) (point-max)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1306 (indian-encode-itrans-region (point-min) (point-max)))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1307 |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1308 ;;;###autoload |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1309 (defun devanagari-decode-itrans-region (from to) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1310 (interactive "r") |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1311 (save-restriction |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1312 (narrow-to-region from to) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1313 (indian-decode-itrans-region (point-min) (point-max)) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1314 (devanagari-compose-from-is13194-region (point-min) (point-max)))) |
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1315 |
17850
0b163f31c39c
Comment change for testing.
Richard M. Stallman <rms@gnu.org>
parents:
17773
diff
changeset
|
1316 ;; Test comment. |
0b163f31c39c
Comment change for testing.
Richard M. Stallman <rms@gnu.org>
parents:
17773
diff
changeset
|
1317 |
17052 | 1318 ;; |
18309
bd8b521f5218
Provide XXX-util instead of
Kenichi Handa <handa@m17n.org>
parents:
18203
diff
changeset
|
1319 (provide 'devan-util) |
17052 | 1320 |
17300
01d528c5dd18
Handle more Devanagari characters correctly.
Kenichi Handa <handa@m17n.org>
parents:
17087
diff
changeset
|
1321 ;;; devan-util.el end here |