diff options
| author | Richard M. Stallman | 2001-11-25 02:40:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-11-25 02:40:11 +0000 |
| commit | 1bec6fdbd774d8a17b04ed41d7d2ed659e029443 (patch) | |
| tree | d4652d18b9a9c553f4fd7222bc4c804f78caeecc | |
| parent | 16808556788c40f60b0c330396237dd62ba4de83 (diff) | |
| download | emacs-1bec6fdbd774d8a17b04ed41d7d2ed659e029443.tar.gz emacs-1bec6fdbd774d8a17b04ed41d7d2ed659e029443.zip | |
Completely re-written.
| -rw-r--r-- | lisp/language/devan-util.el | 1855 | ||||
| -rw-r--r-- | lisp/language/devanagari.el | 480 | ||||
| -rw-r--r-- | lisp/language/indian.el | 376 |
3 files changed, 703 insertions, 2008 deletions
diff --git a/lisp/language/devan-util.el b/lisp/language/devan-util.el index f77ac2d4214..a38cdc2ffc7 100644 --- a/lisp/language/devan-util.el +++ b/lisp/language/devan-util.el | |||
| @@ -1,10 +1,9 @@ | |||
| 1 | ;;; devan-util.el --- support for Devanagari Script Composition | 1 | ;;; devan-util.el --- Support for composing Devanagari characters |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996, 2001 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2001 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | 5 | ;; Maintainer: KAWABATA, Taichi <batta@beige.ocn.ne.jp> |
| 6 | 6 | ;; Keywords: multilingual, Devanagari | |
| 7 | ;; Keywords: multilingual, Indian, Devanagari | ||
| 8 | 7 | ||
| 9 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 10 | 9 | ||
| @@ -23,1266 +22,616 @@ | |||
| 23 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 22 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 24 | ;; Boston, MA 02111-1307, USA. | 23 | ;; Boston, MA 02111-1307, USA. |
| 25 | 24 | ||
| 26 | ;;; Commentary: | 25 | ;; Created: Feb. 17. 2001 |
| 27 | |||
| 28 | ;; History: | ||
| 29 | ;; 1996.10.18 written by KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | ||
| 30 | ;; 1997.3.24 fixed some bugs. | ||
| 31 | 26 | ||
| 32 | ;; Future work :: | 27 | ;;; Commentary: |
| 33 | ;; Decompose the input characters and process them on the character basis. | ||
| 34 | 28 | ||
| 35 | ;; Devanagari script composition rules and related programs. | 29 | ;; This file provides character(Unicode) to glyph(CDAC) conversion and |
| 30 | ;; composition of Devanagari script characters. | ||
| 36 | 31 | ||
| 37 | ;;; Code: | 32 | ;;; Code: |
| 38 | 33 | ||
| 39 | ;;; | ||
| 40 | ;;; Steps toward composition of Devanagari Characters. | ||
| 41 | ;;; | ||
| 42 | |||
| 43 | ;;; Basic functions. | ||
| 44 | |||
| 45 | ;;;###autoload | 34 | ;;;###autoload |
| 46 | (defun indian-to-devanagari (char) | ||
| 47 | "Convert IS 13194 character CHAR to Devanagari basic characters. | ||
| 48 | If CHAR is not IS 13194, return CHAR as is." | ||
| 49 | (let ((charcodes (split-char char))) | ||
| 50 | (if (eq (car charcodes) 'indian-is13194) | ||
| 51 | (make-char 'indian-2-column ?\x21 (nth 1 charcodes)) | ||
| 52 | char))) | ||
| 53 | 35 | ||
| 54 | ;;;###autoload | 36 | ;; Devanagari Composable Pattern |
| 55 | (defun devanagari-to-indian (char) | 37 | ;; C .. Consonants |
| 56 | "Convert Devanagari basic character CHAR to IS 13194 characters. | 38 | ;; V .. Vowel |
| 57 | If CHAR is not Devanagari basic character, return CHAR as is." | 39 | ;; H .. Halant |
| 58 | (let ((charcodes (split-char char))) | 40 | ;; M .. Matra |
| 59 | (if (and (eq (car charcodes) 'indian-2-column) | 41 | ;; V .. Vowel |
| 60 | (= (nth 1 charcodes) ?\x21)) | 42 | ;; A .. Anuswar |
| 61 | (make-char 'indian-is13194 (nth 2 charcodes)) | 43 | ;; D .. Chandrabindu |
| 62 | char))) | 44 | ;; (N .. Zerowidth Non Joiner) |
| 63 | 45 | ;; (J .. Zerowidth Joiner. ) | |
| 64 | ;;;###autoload | 46 | ;; 1. vowel |
| 65 | (defun indian-to-devanagari-region (from to) | 47 | ;; V(A/D)? |
| 66 | "Convert IS 13194 characters in region to Devanagari basic characters. | 48 | ;; 2. syllable : maximum of 5 consecutive consonants. (e.g. kartsnya) |
| 67 | When called from a program, expects two arguments, | 49 | ;; ((CH)?(CH)?(CH)?CH)?C(MA?|D|H)? |
| 68 | positions (integers or markers) specifying the region." | 50 | |
| 51 | (defconst devanagari-consonant | ||
| 52 | "[$,15U(B-$,15y68(B-$,16?(B]") | ||
| 53 | |||
| 54 | (defconst devanagari-composable-pattern | ||
| 55 | (concat | ||
| 56 | "\\([$,15E(B-$,15T6@6A(B][$,15A5B(B]?\\)\\|$,15C(B" | ||
| 57 | "\\|\\(" | ||
| 58 | "\\(?:\\(?:[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?\\(?:[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?\\(?:[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?[$,15U(B-$,15y68(B-$,16?(B]$,16-(B\\)?" | ||
| 59 | "[$,15U(B-$,15y68(B-$,16?(B]\\(?:$,16-(B\\|[$,15~(B-$,16-6B6C(B]?[$,15B5A(B]?\\)?" | ||
| 60 | "\\)") | ||
| 61 | "Regexp matching a composable sequence of Devanagari characters.") | ||
| 62 | |||
| 63 | (defun devanagari-compose-region (from to) | ||
| 69 | (interactive "r") | 64 | (interactive "r") |
| 70 | (save-excursion | 65 | (save-excursion |
| 71 | (goto-char from) | 66 | (save-restriction |
| 72 | (while (< (point) to) | 67 | (narrow-to-region from to) |
| 73 | (let ((char (following-char))) | 68 | (goto-char (point-min)) |
| 74 | (if (eq (char-charset char) 'indian-is13194) | 69 | (while (re-search-forward devanagari-composable-pattern nil t) |
| 75 | (progn | 70 | (devanagari-compose-syllable-region (match-beginning 0) |
| 76 | (delete-char 1) | 71 | (match-end 0)))))) |
| 77 | (insert (indian-to-devanagari char))) | 72 | (defun devanagari-compose-string (string) |
| 78 | (forward-char 1)))))) | 73 | (with-temp-buffer |
| 79 | 74 | (insert (decompose-string string)) | |
| 80 | ;;;###autoload | 75 | (devanagari-compose-region (point-min) (point-max)) |
| 81 | (defun devanagari-to-indian-region (from to) | 76 | (buffer-string))) |
| 82 | "Convert Devanagari basic characters in region to Indian characters. | 77 | |
| 83 | When called from a program, expects two arguments, | 78 | (defun range (from to) |
| 84 | positions (integers or markers) specifying the region." | 79 | "Make the list of the integers of range FROM to TO." |
| 85 | (interactive "r") | 80 | (let (result) |
| 86 | (save-excursion | 81 | (while (<= from to) (setq result (cons to result) to (1- to))) result)) |
| 87 | (goto-char from) | 82 | |
| 88 | (while (< (point) to) | 83 | (defun regexp-of-hashtbl-keys (hashtbl) |
| 89 | (let ((char (following-char))) | 84 | "Returns the regular expression of hashtable keys." |
| 90 | (if (eq (char-charset char) 'indian-2-column) | 85 | (let ((max-specpdl-size 1000)) |
| 91 | (progn | 86 | (regexp-opt |
| 92 | (delete-char 1) | 87 | (sort |
| 93 | (insert (devanagari-to-indian char))) | 88 | (let (dummy) |
| 94 | (forward-char 1)))))) | 89 | (maphash (function (lambda (key val) (setq dummy (cons key dummy)))) hashtbl) |
| 95 | 90 | dummy) | |
| 96 | ;;;###autoload | 91 | (function (lambda (x y) (> (length x) (length y)))))))) |
| 97 | (defun indian-to-devanagari-string (string) | 92 | |
| 98 | "Convert Indian characters in STRING to Devanagari Basic characters." | 93 | (defun devanagari-composition-function (from to pattern &optional string) |
| 99 | (let* ((len (length string)) | 94 | "Compose Devanagari characters in REGION, or STRING if specified. |
| 100 | (i 0) | 95 | Assume that the REGION or STRING must fully match the composable |
| 101 | (vec (make-vector len 0))) | 96 | PATTERN regexp." |
| 102 | (while (< i len) | 97 | (if string (devanagari-compose-syllable-string string) |
| 103 | (aset vec i (indian-to-devanagari (aref string i))) | 98 | (devanagari-compose-syllable-region from to)) |
| 104 | (setq i (1+ i))) | 99 | (- to from)) |
| 105 | (concat vec))) | 100 | |
| 106 | 101 | ;; Register a function to compose Devanagari characters. | |
| 107 | ;; Phase 0 - Determine whether the characters can be composed. | 102 | (mapc |
| 108 | ;; | 103 | (function (lambda (ucs) |
| 109 | ;;; | 104 | (aset composition-function-table (decode-char 'ucs ucs) |
| 110 | ;;; Regular expressions to split characters for composition. | 105 | (list (cons devanagari-composable-pattern |
| 111 | ;;; | 106 | 'devanagari-composition-function))))) |
| 112 | ;; | 107 | (nconc '(#x0903) (range #x0905 #x0939) (range #x0958 #x0961))) |
| 113 | ;; Indian script word contains one or more syllables. | 108 | |
| 114 | ;; In BNF, it can be expressed as follows: | 109 | ;; Notes on conversion steps. |
| 115 | ;; | 110 | |
| 116 | ;; Word ::= {Syllable} [Cons-Syllable] | 111 | ;; 1. chars to glyphs |
| 117 | ;; Syllable ::= Cons-Vowel-Syllable | Vowel-Syllable | 112 | ;; |
| 118 | ;; Vowel-Syllable ::= V[D] | 113 | ;; Rules will not be applied to the halant appeared at the end of the |
| 119 | ;; Cons-Vowel-Syllable ::= [Cons-Syllable] Full-Cons [M] [D] | 114 | ;; text. Also, the preceding/following "r" will be treated as special case. |
| 120 | ;; Cons-Syllable ::= [Pure-Cons] [Pure-Cons] [Pure-Cons] Pure-Cons | 115 | |
| 121 | ;; Pure-Cons ::= Full-Cons H | 116 | ;; 2. glyphs reordering. |
| 122 | ;; Full-Cons ::= C [N] | 117 | ;; |
| 123 | ;; | 118 | ;; The glyphs are split by halant, and each glyph groups are |
| 124 | ;; {} repeat, [] optional | 119 | ;; re-ordered in the following order. |
| 125 | ;; | 120 | ;; |
| 126 | ;; C - Consonant ($(5!3!4!5!6!7!8!9!:!;!<!=!>!?!@!A!B!C!D!E(B | 121 | ;; Note that `consonant-glyph' mentioned here does not contain the |
| 127 | ;; $(5!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X(B) | 122 | ;; vertical bar (right modifier) attached at the right of the |
| 128 | ;; N - Nukta ($(5!i(B) | 123 | ;; consonant. |
| 129 | ;; H - Halant($(5!h(B) or Virama | ||
| 130 | ;; V - Vowel ($(5!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2#&#'#*(B) | ||
| 131 | ;; ("$(5#&#'#*(B" can be obtained by IS13194 vowels with nukta.) | ||
| 132 | ;; D - Vowel Modifiers, i.e. Anuswar, Chandrabindu ($(5!!!"(B) | ||
| 133 | ;; (Visaraga ($(5!#(B) is excluded.) | ||
| 134 | ;; M - Matra ($(5!Z![!\!]!^!_!`!a!b!c!d!e!f!g#K#L#M(B) | ||
| 135 | ;; ("$(5#K#L#M(B" can be obtained by IS13194 matras with nukta.) | ||
| 136 | ;; | ||
| 137 | ;; In Emacs, one syllable of Indian language is considered to be one | ||
| 138 | ;; composite glyph. If we expand the above expression for | ||
| 139 | ;; cons-vowel-syllable, it would be: | ||
| 140 | ;; | ||
| 141 | ;; [[C [N] H] [C [N] H] [C [N] H] C [N] H] C [N] [M] [D] | ||
| 142 | ;; | ||
| 143 | ;; Therefore, in worst case, the one syllable may contain | ||
| 144 | ;; following characters. | ||
| 145 | ;; | ||
| 146 | ;; C N H C N H C N H C N H C N M D | ||
| 147 | ;; | ||
| 148 | ;; The example is a sanskrit word "kArtsnya", where five consecutive | ||
| 149 | ;; consonants appear. | ||
| 150 | ;; | ||
| 151 | ;; On the other hand, consonant-syllable, which appears at the end of | ||
| 152 | ;; the word, would have the following expression: | ||
| 153 | ;; | ||
| 154 | ;; [C [N] H] [C [N] H] [C [N] H] C [N] H | ||
| 155 | ;; | ||
| 156 | ;; This is acceptable BEFORE proper consonant-syllable is input. The | ||
| 157 | ;; string which doesn't match with the above expression is invalid and | ||
| 158 | ;; thus must be fixed. | ||
| 159 | ;; | ||
| 160 | ;; Note: | ||
| 161 | ;; Third case can be considered, which is an acceptable syllable and can | ||
| 162 | ;; not add any code more. | ||
| 163 | ;; | ||
| 164 | ;; [[C [N] H] [C [N] H] [C [N] H] C [N] H] C [N] [M] D | ||
| 165 | ;; | ||
| 166 | ;; However, to make editing possible even in this condition, we will | ||
| 167 | ;; not consider about this case. | ||
| 168 | ;; | ||
| 169 | ;; Note: | ||
| 170 | ;; Currently, it seems that the only following consonants would have | ||
| 171 | ;; Nukta sign attatched. | ||
| 172 | ;; ($(5!3!4!5!:!?!@!I(B) | ||
| 173 | ;; Therefore, [$(5!3(B-$(5!X(B]$(5!i(B? can be re-written as | ||
| 174 | ;; \\([$(5!3!4!5!:!?!@!I(B]$(5!i(B\\)\\|[$(5!3(B-$(5!X(B] | ||
| 175 | |||
| 176 | (defconst devanagari-full-cons | ||
| 177 | "\\(\\([$(5!3!4!5!:!?!@!I(B]$(5!i(B\\)\\|[$(5!3(B-$(5!X$.$E"%(B]\\)" | ||
| 178 | "Devanagari full consonant") | ||
| 179 | |||
| 180 | (defconst devanagari-pure-cons | ||
| 181 | (concat "\\(" devanagari-full-cons "$(5!h(B\\)") | ||
| 182 | "Devanagari pure consonant") | ||
| 183 | |||
| 184 | (defconst devanagari-matra | ||
| 185 | "\\(\\([$(5!_![!\(B]$(5!i(B\\)\\|[$(5!Z(B-$(5!g#K#L#M(B]\\)" | ||
| 186 | "Devanagari Matra Signs. '$(5#K#L#M(B' can also be created from the combination | ||
| 187 | of '$(5!_![!\(B' and nukta sign.") | ||
| 188 | |||
| 189 | (defconst devanagari-vowel | ||
| 190 | "\\(\\([$(5!*!&!'(B]$(5!i(B\\)\\|[$(5!$(B-$(5!2#&#'#*(B]\\)" | ||
| 191 | "Devanagari Vowels. '$(5#&#'#*(B' can also be created from the combination | ||
| 192 | of '$(5!*!&!'(B' and nukta sign.") | ||
| 193 | |||
| 194 | (defconst devanagari-vowel-syllable | ||
| 195 | (concat devanagari-vowel "[$(5!!!"(B]?") | ||
| 196 | "Devanagari vowel syllable.") | ||
| 197 | |||
| 198 | (defconst devanagari-cons-syllable | ||
| 199 | (concat devanagari-pure-cons "?" devanagari-pure-cons "?" | ||
| 200 | devanagari-pure-cons "?" devanagari-pure-cons "$") | ||
| 201 | "Devanagari consonant syllable") | ||
| 202 | |||
| 203 | (defconst devanagari-cons-vowel-syllable | ||
| 204 | (concat "\\(" | ||
| 205 | devanagari-pure-cons "?" devanagari-pure-cons "?" | ||
| 206 | devanagari-pure-cons "?" devanagari-pure-cons "\\)?" | ||
| 207 | devanagari-full-cons devanagari-matra "?[$(5!!!"(B]?") | ||
| 208 | "Devanagari consonant vowel syllable.") | ||
| 209 | |||
| 210 | ;; | ||
| 211 | ;; Also, digits and virams should be processed other than syllables. | ||
| 212 | ;; | ||
| 213 | ;; In IS 13194, Avagrah is obtained by Nukta after Viram, and | ||
| 214 | ;; OM is obtained by Nukta after Chandrabindu | ||
| 215 | ;; | ||
| 216 | |||
| 217 | (defconst devanagari-digit-viram-visarga | ||
| 218 | "[$(5!q(B-$(5!z!j!#(B]") | ||
| 219 | |||
| 220 | (defconst devanagari-other-sign | ||
| 221 | "\\([$(5!!!j(B]$(5!i(B\\)\\|\\([$(5#!#J(B]\\)") | ||
| 222 | |||
| 223 | (defconst devanagari-composite-glyph-unit | ||
| 224 | (concat "\\(" devanagari-cons-syllable | ||
| 225 | "\\)\\|\\(" devanagari-vowel-syllable | ||
| 226 | "\\)\\|\\(" devanagari-cons-vowel-syllable | ||
| 227 | "\\)\\|\\(" devanagari-other-sign | ||
| 228 | "\\)\\|\\(" devanagari-digit-viram-visarga "\\)") | ||
| 229 | "Regexp matching to Devanagari string to be composed form one glyph.") | ||
| 230 | |||
| 231 | ;;(put-charset-property charset-devanagari-1-column | ||
| 232 | ;; 'char-to-glyph 'devanagari-compose-string) | ||
| 233 | ;;(put-charset-property charset-devanagari-2-column | ||
| 234 | ;; 'char-to-glyph 'devanagari-compose-string) | ||
| 235 | |||
| 236 | ;; Sample | ||
| 237 | ;; | ||
| 238 | ;;(string-match devanagari-cons-vowel-syllable-examine "$(5!X![(B") => 0 | ||
| 239 | ;;(string-match devanagari-cons-vowel-syllable-examine "$(5!F!h!D!\(B") => 0 | ||
| 240 | ;;(string-match devanagari-cons-vowel-syllable-examine "$(5!X![!F!h!D!\(B") => 0 | ||
| 241 | |||
| 242 | ;; | ||
| 243 | ;; Steps toward the composition | ||
| 244 | ;; Converting Character Codes to Composite Glyph. | ||
| 245 | ;; | ||
| 246 | ;; Example : $(5!X![(B/$(5!F!h!D!\(B | ||
| 247 | ;; | 124 | ;; |
| 248 | ;; First, convert Characters to appropriate glyphs. | 125 | ;; If the glyph-group contains right modifier, |
| 249 | ;; | 126 | ;; (1) consonant-glyphs/vowels, with nukta sign |
| 250 | ;; => $(5!X![(B/$(5"F!D!\(B | 127 | ;; (2) spacing |
| 251 | ;; | 128 | ;; (3) right modifier (may be matra) |
| 252 | ;; Then, determine the base glyph, apply-orders and apply-rules. | 129 | ;; (4) top matra |
| 253 | ;; | 130 | ;; (5) preceding "r" |
| 254 | ;; => $(5!X(B (ml.mr) $(5![(B / $(5!D(B (ml.mr) $(5"F(B (mr ml) $(5!\(B | 131 | ;; (6) anuswar |
| 255 | ;; | 132 | ;; (7) following "r" |
| 256 | ;; Finally, convert 2-column glyphs to 1-column glyph | 133 | ;; (8) bottom matra or halant. |
| 257 | ;; if such a glyph exist. | ||
| 258 | ;; | ||
| 259 | ;; => $(6!X(B (ml.mr) $(6![(B / $(6!D(B (ml.mr) $(6"F(B (mr ml) $(6!\(B | ||
| 260 | ;; | ||
| 261 | ;; Compose the glyph. | ||
| 262 | ;; | ||
| 263 | ;; => 4$(6!Xt%![0!X![1(B/4$(6!Dt%"Fv#!\0!D"F!\1(B | ||
| 264 | ;; => 4$(6!Xt%![0!X![14!Dt%"Fv#!\0!D"F!\1(B | ||
| 265 | ;; | ||
| 266 | |||
| 267 | ;; | ||
| 268 | ;; Phase 1: Converting Character Code to Glyph Code. | ||
| 269 | ;; | 134 | ;; |
| 270 | ;; | 135 | ;; Otherwise, |
| 271 | ;; IMPORTANT: | 136 | ;; (1) consonant-glyph/vowels, with nukta sign |
| 272 | ;; There may be many rules that you many want to suppress. | 137 | ;; (3) left matra |
| 273 | ;; In that case, please comment out that rule. | 138 | ;; (4) top matra |
| 274 | ;; | 139 | ;; (5) preceding "r" |
| 275 | ;; RULES WILL BE EVALUATED FROM FIRST TO LAST. | 140 | ;; (6) anuswar |
| 276 | ;; PUT MORE SPECIFIC RULES FIRST. | 141 | ;; (7) following "r" |
| 277 | ;; | 142 | ;; (8) bottom matra or halant. |
| 278 | ;; TO DO: | 143 | ;; (2) spacing |
| 279 | ;; Prepare multiple specific list of rules for each languages | 144 | |
| 280 | ;; that adopt Devanagari script. | 145 | ;; 3. glyph to glyph |
| 281 | ;; | 146 | ;; |
| 282 | 147 | ;; For better display, some glyph display would be tuned. | |
| 283 | (defconst devanagari-char-to-glyph-rules | 148 | |
| 284 | '( | 149 | ;; 4. Composition. |
| 285 | 150 | ;; | |
| 286 | ;; `r' at the top of syllable and followed by other consonants. | 151 | ;; left modifiers will be attached at the left. |
| 287 | ;; ("[^$(5!h(B]\\($(5!O!h(B\\)[$(5!3(B-$(5!X(B]" "$(5"p(B") | 152 | ;; others will be attached right. |
| 288 | ("^\\($(5!O!h(B\\)[$(5!3(B-$(5!X(B]" "$(5"p(B") | 153 | |
| 289 | 154 | ;; Problem:: | |
| 290 | ;; Ligature Rules | 155 | ;; Can we generalize this methods to other Indian scripts? |
| 291 | ("\\($(5!3!h!B!h!O!h!M(B\\)" "$(5$!(B" sanskrit) | 156 | |
| 292 | ("\\($(5!3!h!B!h!T(B\\)" "$(5$"(B" sanskrit) | 157 | (defvar dev-char-glyph |
| 293 | ("\\($(5!3!h!B!h!M(B\\)" "$(5$#(B" sanskrit) | 158 | '(("$,15E(B" . "$,4 K(B") |
| 294 | ("\\($(5!3!h!F!h!M(B\\)" "$(5$$(B") | 159 | ("$,15F(B" . "$,4 K")(B") |
| 295 | ("\\($(5!3!h!O!h!M(B\\)" "$(5$%(B") | 160 | ("$,15~(B" . "$,4")(B") |
| 296 | ("\\($(5!3!h!O(B\\)" "$(5"#(B") ; Post "r" | 161 | ("$,15G(B" . "$,4 \(B") |
| 297 | ("\\($(5!3!h!T!h!M(B\\)" "$(5$&(B" sanskrit) | 162 | ("$,15(B" . "$,4"*(B") |
| 298 | ("\\($(5!3!h(B\\)$(5!3!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"3(B") ; Special Half Form | 163 | ("$,155A(B" . "$,4"*(B\$,4"&(B") |
| 299 | ("\\($(5!3!h!3(B\\)" "$(5$'(B") | 164 | ("$,15H(B" . "$,4 \"'(B") |
| 300 | ("\\($(5!3!h(B\\)$(5!B!h!O(B" "$(5"3(B") ; Special Rules for "k-tr" | 165 | ("$,15H5A(B" . "$,4 \"'"&(B") |
| 301 | ("\\($(5!3!h!B(B\\)" "$(5$((B") | 166 | ("$,16 (B" . "$,4"2(B") |
| 302 | ("\\($(5!3!h!F(B\\)" "$(5$)(B") | 167 | ("$,16 5A(B" . "$,4"2"&(B") |
| 303 | ("\\($(5!3!h!L(B\\)" "$(5$*(B") | 168 | ("$,15I(B" . "$,4 ](B") |
| 304 | ("\\($(5!3!h!M(B\\)" "$(5$+(B") | 169 | ("$,16!(B" . "$,4"6(B") |
| 305 | ("\\($(5!3!h!Q(B\\)" "$(5$,(B") | 170 | ("$,15J(B" . "$,4 ^"P(B") |
| 306 | ("\\($(5!3!h!T(B\\)" "$(5$-(B") | 171 | ("$,16"(B" . "$,4":(B") |
| 307 | ("\\($(5!3!h!V!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"l(B") ; Half Form | 172 | ("$,15K(B" . "$,4 `"Q(B") |
| 308 | ("\\($(5$.!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"l(B") ; Half Form | 173 | ("$,16#(B" . "$,4">(B") |
| 309 | ("\\($(5!3!h!V(B\\)" "$(5$.(B") | 174 | ;;("$,15L(B" . nil) ; not implemented. |
| 310 | ("\\($(5!3!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"3(B") ; Half Form | 175 | ("$,16$(B" . "$,4"?(B") |
| 311 | ("\\($(5!3!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"s(B") ; Nukta Half Form | 176 | ("$,15M(B" . "$,4 b"L(B") |
| 312 | ("\\($(5!3!i(B\\)" "$(5#3(B") ; Nukta | 177 | ("$,15M5A(B" . "$,4 b"$(B") |
| 313 | ("\\($(5!4!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"4(B") ; Half Form | 178 | ("$,15M5B(B" . "$,4 b"$(B") |
| 314 | ("\\($(5!4!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"t(B") ; Nukta Half Form | 179 | ("$,16%(B" . "\$,4"L(B") |
| 315 | ("\\($(5!4!i(B\\)" "$(5#4(B") ; Nukta | 180 | ("$,15N(B" . "$,4 b"@(B") |
| 316 | ("\\($(5!5!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"`(B") ; Half Form | 181 | ("$,15N5A(B" . "$,4 b"@"&(B") |
| 317 | ("\\($(5!5!h!O(B\\)" "$(5"$(B") ; Post "r" | 182 | ("$,16&(B" . "\$,4"@(B") |
| 318 | ("\\($(5!5!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"5(B") ; Half Form | 183 | ("$,16&5A(B" . "\$,4"@(B\$,4"&(B") |
| 319 | ("\\($(5!5!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"u(B") ; Nukta Half Form | 184 | ("$,15O(B" . "$,4 b(B") |
| 320 | ("\\($(5!5!i(B\\)" "$(5#5(B") ; Nukta | 185 | ("$,16'(B" . "\$,4"D(B") |
| 321 | ("\\($(5!6!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"a(B") ; Half Form | 186 | ("$,16'5A(B" . "\$,4"D(B\$,4"&(B") |
| 322 | ("\\($(5!6!h!F(B\\)" "$(5$/(B") | 187 | ("$,15P(B" . "$,4 b"D(B") |
| 323 | ; Slot | 188 | ("$,15P5A(B" . "$,4 b"D"&(B") |
| 324 | ("\\($(5!6!h!O(B\\)" "$(5!6"q(B") ; Post "r" | 189 | ("$,16((B" . "\$,4"H(B") |
| 325 | ("\\($(5!6!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"6(B") ; Half Form | 190 | ("$,16(5A(B" . "\$,4"H(B\$,4"&(B") |
| 326 | ("\\($(5!7!h!3!h!B!h!M(B\\)" "$(5$0(B" sanskrit) | 191 | ("$,15Q(B" . "$,4 K")"L(B") ;; special rule for reodering. |
| 327 | ("\\($(5!7!h!3!h!V!h!T(B\\)" "$(5$1(B" sanskrit) | 192 | ("$,15Q5A(B" . "$,4 K")"$(B") |
| 328 | ("\\($(5!7!h!3!h!B(B\\)" "$(5$2(B" sanskrit) | 193 | ("$,15Q5B(B" . "$,4 K")"$(B") |
| 329 | ("\\($(5!7!h!3!h!V(B\\)" "$(5$3(B" sanskrit) | 194 | ("$,16)(B" . "\$,4")"L(B") |
| 330 | ("\\($(5!7!h!3!h!O(B\\)" "$(5$9"q(B") ; Special Rule. May be precomposed font needed. | 195 | ("$,16)5A(B" . "\$,4")"$(B") |
| 331 | ("\\($(5!7!h!6!h!O(B\\)" "$(5$4(B" sanskrit) | 196 | ("$,16)5B(B" . "\$,4")"$(B") |
| 332 | ("\\($(5!7!h!3!h!M(B\\)" "$(5$5(B" sanskrit) | 197 | ("$,15R(B" . "$,4 K")"@(B") |
| 333 | ("\\($(5!7!h!4!h!M(B\\)" "$(5$6(B" sanskrit) | 198 | ("$,15R5A(B" . "$,4 K")"@"&(B") |
| 334 | ("\\($(5!7!h!5!h!M(B\\)" "$(5$7(B" sanskrit) | 199 | ("$,16*(B" . "\$,4")"@(B") |
| 335 | ("\\($(5!7!h!6!h!M(B\\)" "$(5$8(B" sanskrit) | 200 | ("$,16*5A(B" . "\$,4")"@"&(B") |
| 336 | ("\\($(5!7!h!3(B\\)" "$(5$9(B") | 201 | ("$,15S(B" . "$,4 K")"D(B") |
| 337 | ("\\($(5!7!h!4(B\\)" "$(5$:(B") | 202 | ("$,15S5A(B" . "$,4 K")"D"&(B") |
| 338 | ("\\($(5!7!h!5!h!O(B\\)" "$(5$;"q(B") ; Special Rule. May be precomposed font needed. | 203 | ("$,16+(B" . "\$,4")"D(B") |
| 339 | ("\\($(5!7!h!5(B\\)" "$(5$;(B") | 204 | ("$,16+5A(B" . "\$,4")"D"&(B") |
| 340 | ("\\($(5!7!h!6(B\\)" "$(5$<(B") | 205 | ("$,15T(B" . "$,4 K")"H(B") |
| 341 | ("\\($(5!7!h!7(B\\)" "$(5$=(B") | 206 | ("$,15T5A(B" . "$,4 K")"H"&(B") |
| 342 | ("\\($(5!7!h!F(B\\)" "$(5$>(B") | 207 | ("$,16,(B" . "\$,4")"H(B") |
| 343 | ("\\($(5!7!h!L(B\\)" "$(5$?(B") | 208 | ("$,16,5A(B" . "\$,4")"H"&(B") |
| 344 | ("\\($(5!7!h!M(B\\)" "$(5$@(B") | 209 | ("$,16@(B" . "$,4 a"Q(B") |
| 345 | ("\\($(5!8!h(B\\)[$(5!8!<(B]$(5!h(B" "$(5"8(B") ; Half Form | 210 | ;;("$,16B(B" . nil) |
| 346 | ("\\($(5!8!h!8(B\\)" "$(5$A(B") | 211 | ;;("$,16A(B" . nil) |
| 347 | ("\\($(5!8!h!<(B\\)" "$(5$B(B") | 212 | ;;("$,16C(B" . nil) |
| 348 | ("\\($(5!8!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"8"q(B") ; Half Form Post "r" | 213 | |
| 349 | ("\\($(5!8!h!O(B\\)" "$(5!8"q(B") ; Post "r" | 214 | ;; GRUTTALS |
| 350 | ("\\($(5!8!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"8(B") ; Half Form | 215 | ("$,15U(B" . "$,4 e"R(B") |
| 351 | ("\\($(5!9!h!M(B\\)" "$(5$C(B") | 216 | ("$,15U6-(B" . "$,4 c(B") |
| 352 | ("\\($(5!:!h!O(B\\)" "$(5$D(B") | 217 | ("$,15U6-5p(B" . "$,4 g"R(B") |
| 353 | ("\\($(5!:!h!<!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"m(B") ; Half Form | 218 | ("$,15U6-5d(B" . "$,4 h"R(B") |
| 354 | ("\\($(5!:!h!<(B\\)" "$(5$E(B") | 219 | ("$,15U6-5w(B" . "$,4 i")(B") |
| 355 | ("\\($(5!:!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5":(B") ; Half Form | 220 | ("$,15U6-5w6-(B" . "$,4 i(B") |
| 356 | ("\\($(5!:!i!h!O(B\\)" "$(5"!(B") ; Nukta Post "r" | 221 | |
| 357 | ("\\($(5!:!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"z(B") ; Nukta Half Form | 222 | ("$,15V(B" . "$,4 j")(B") |
| 358 | ("\\($(5!:!i(B\\)" "$(5#:(B") ; Nukta | 223 | ("$,15V6-(B" . "$,4 j(B") |
| 359 | ("\\($(5!;!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5";(B") ; Half Form | 224 | ("$,15V6-5p(B" . "$,4 l")(B") |
| 360 | ("\\($(5!<!h(B\\)$(5!8!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"<(B") ; Special Half Form | 225 | ("$,15V6-5p6-(B" . "$,4 l(B") |
| 361 | ("\\($(5!<!h!8(B\\)" "$(5$F(B") | 226 | |
| 362 | ("\\($(5!<!h(B\\)$(5!:!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"<(B") ; Special Half Form | 227 | ("$,15W(B" . "$,4 m")(B") |
| 363 | ("\\($(5!<!h!:(B\\)" "$(5$G(B") | 228 | ("$,15W6-(B" . "$,4 m(B") |
| 364 | ("\\($(5!<!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"<(B") ; Half Form | 229 | ("$,15W6-5p(B" . "$,4 o")(B") |
| 365 | ("\\($(5!=!h!3(B\\)" "$(5$H(B") | 230 | ("$,15W6-5p6-(B" . "$,4 o(B") |
| 366 | ("\\($(5!=!h!=(B\\)" "$(5$I(B") | 231 | |
| 367 | ("\\($(5!=!h!>(B\\)" "$(5$J(B") | 232 | ("$,15X(B" . "$,4 p")(B") |
| 368 | ("\\($(5!=!h!M(B\\)" "$(5$K(B") | 233 | ("$,15X6-(B" . "$,4 p(B") |
| 369 | ("\\($(5!>!h!M(B\\)" "$(5$L(B") | 234 | ("$,15X6-5p(B" . "$,4 q")(B") |
| 370 | ("\\($(5!?!h!5!h!M(B\\)" "$(5$M(B" sanskrit) | 235 | ("$,15X6-5p6-(B" . "$,4 q(B") |
| 371 | ("\\($(5!?!h!6!h!O(B\\)" "$(5$N(B" sanskrit) | 236 | |
| 372 | ("\\($(5!?!h!O!h!M(B\\)" "$(5$O(B") | 237 | ("$,15Y(B" . "$,4 r"S(B") |
| 373 | ("\\($(5!?!h!5(B\\)" "$(5$P(B") | 238 | ;; PALATALS |
| 374 | ("\\($(5!?!h!6(B\\)" "$(5$Q(B") | 239 | ("$,15Z(B" . "$,4 s")(B") |
| 375 | ("\\($(5!?!h!?(B\\)" "$(5$R(B") | 240 | ("$,15Z6-(B" . "$,4 s(B") |
| 376 | ("\\($(5!?!h!L(B\\)" "$(5$S(B") | 241 | ("$,15Z6-5p(B" . "$,4 t")(B") |
| 377 | ("\\($(5!?!h!M(B\\)" "$(5$T(B") | 242 | ("$,15Z6-5p6-(B" . "$,4 t(B") |
| 378 | ("\\($(5!?!i(B\\)" "$(5#?(B") ; Nukta | 243 | |
| 379 | ("\\($(5!@!h!M(B\\)" "$(5$`(B") | 244 | ("$,15[(B" . "$,4 u"T(B") |
| 380 | ("\\($(5!@!i(B\\)" "$(5#@(B") ; Nukta | 245 | |
| 381 | ("\\($(5!A!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"A(B") ; Half Form | 246 | ("$,15\(B" . "$,4 v")(B") |
| 382 | ("\\($(5!B!h(B\\)$(5!B!h!O(B" "$(5"B(B") ; Special Rule for "t-tr" | 247 | ("$,15\6-(B" . "$,4 v(B") |
| 383 | ("\\($(5!B!h!B!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"c(B") ; Half Form | 248 | ("$,15\6-5p(B" . "$,4 x")(B") |
| 384 | ("\\($(5!B!h!B(B\\)" "$(5$a(B") | 249 | ("$,15\6-5p6-(B" . "$,4 x(B") |
| 385 | ("\\($(5!B!h!F(B\\)" "$(5$b(B") | 250 | ("$,15\6-5^(B" . "$,4 y")(B") |
| 386 | ("\\($(5!B!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"d(B") ; Half Form Post "r" | 251 | ("$,15\6-5^6-(B" . "$,4 y(B") |
| 387 | ("\\($(5!B!h!O(B\\)" "$(5"%(B") ; Post "r" | 252 | |
| 388 | ("\\($(5!B!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"B(B") ; Half Form | 253 | ("$,15](B" . "$,4 z")(B") |
| 389 | ("\\($(5!C!h!O(B\\)" "$(5!C"q(B") ; Post "r" | 254 | ("$,15]6-(B" . "$,4 z(B") |
| 390 | ("\\($(5!C!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"C(B") ; Half Form | 255 | ("$,15]6-5p(B" . "$,4 {")(B") |
| 391 | ("\\($(5!D!h!D!h!M(B\\)" "$(5$c(B") | 256 | ("$,15]6-5p6-(B" . "$,4 {(B") |
| 392 | ("\\($(5!D!h!E!h!M(B\\)" "$(5$d(B") | 257 | |
| 393 | ("\\($(5!D!h!K!h!M(B\\)" "$(5$e(B") | 258 | ("$,15^(B" . "$,4 |")(B") |
| 394 | ("\\($(5!D!h!K!h!O(B\\)" "$(5$r"r(B") ; Special Case for "dbhr" ; *** | 259 | ("$,15^6-(B" . "$,4 |(B") |
| 395 | ("\\($(5!D!h!O!h!M(B\\)" "$(5$f(B") | 260 | ;; CEREBRALS |
| 396 | ("\\($(5!D!h!T!h!M(B\\)" "$(5$g(B") | 261 | ("$,15_(B" . "$,4 }"U(B") |
| 397 | ("\\($(5!D!h!5!h!O(B\\)" "$(5$h(B") | 262 | ("$,15_6-5_(B" . "$,4 ~"U(B") |
| 398 | ("\\($(5!D!h!6!h!O(B\\)" "$(5$i(B") | 263 | ("$,15_6-5`(B" . "$,4 "U(B") |
| 399 | ("\\($(5!D!h!D!h!T(B\\)" "$(5$j(B") | 264 | |
| 400 | ("\\($(5!D!h!E!h!T(B\\)" "$(5$k(B") | 265 | ("$,15`(B" . "$,4! "V(B") |
| 401 | ("\\($(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) | 266 | ("$,15`6-5`(B" . "$,4!!"V(B") |
| 402 | ("\\($(5!D!h!5(B\\)" "$(5$l(B") | 267 | |
| 403 | ("\\($(5!D!h!6(B\\)" "$(5$m(B") | 268 | ("$,15a(B" . "$,4!""W(B") |
| 404 | ("\\($(5!D!h!D(B\\)" "$(5$n(B") | 269 | ("$,15a6-5a(B" . "$,4!$"W(B") |
| 405 | ("\\($(5!D!h!E(B\\)" "$(5$o(B") | 270 | ("$,15a6-5b(B" . "$,4!%"W(B") |
| 406 | ("\\($(5!D!h!F(B\\)" "$(5$p(B") | 271 | |
| 407 | ("\\($(5!D!h(B\\)$(5!J!h(B" "$(5!D!h(B") ; Suppressing "db-" | 272 | ("$,15b(B" . "$,4!&"X(B") |
| 408 | ("\\($(5!D!h!J(B\\)" "$(5$q(B") | 273 | |
| 409 | ("\\($(5!D!h!K(B\\)" "$(5$r(B") | 274 | ("$,15c(B" . "$,4!(")(B") |
| 410 | ("\\($(5!D!h!L(B\\)" "$(5$s(B") | 275 | ("$,15c6-(B" . "$,4!((B") |
| 411 | ("\\($(5!D!h!M(B\\)" "$(5$t(B") | 276 | ;; DENTALS |
| 412 | ("\\($(5!D!h!T(B\\)" "$(5$u(B") | 277 | ("$,15d(B" . "$,4!)")(B") |
| 413 | ("\\($(5!E!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"e(B") ; Half Form | 278 | ("$,15d6-(B" . "$,4!)(B") |
| 414 | ("\\($(5!E!h!F(B\\)" "$(5$v(B") | 279 | ("$,15d6-5p(B" . "$,4!*")(B") |
| 415 | ("\\($(5!E!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"f(B") ; Half Form Post "r" | 280 | ("$,15d6-5p6-(B" . "$,4!*(B") |
| 416 | ("\\($(5!E!h!O(B\\)" "$(5!E"q(B") ; Post "r" | 281 | ("$,15d6-5d(B" . "$,4!+")(B") |
| 417 | ("\\($(5!E!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"E(B") ; Half Form | 282 | ("$,15d6-5d6-(B" . "$,4!+(B") |
| 418 | ("\\($(5!F!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"k(B") ; Half Form | 283 | |
| 419 | ("\\($(5!F!h!F(B\\)" "$(5$w(B") | 284 | ("$,15e(B" . "$,4!,")(B") |
| 420 | ("\\($(5!F!h!O(B\\)" "$(5!F"q(B") | 285 | ("$,15e6-(B" . "$,4!,(B") |
| 421 | ("\\($(5!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"F(B") ; Half Form | 286 | ("$,15e6-5p(B" . "$,4!-")(B") |
| 422 | ("\\($(5!G!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"G(B") ; Nukta Half Form | 287 | ("$,15e6-5p6-(B" . "$,4!-(B") |
| 423 | ("\\($(5!H!h(B\\)$(5!B!h!O(B" "$(5"H(B") ; Special Rule for "p-tr" | 288 | |
| 424 | ("\\($(5!H!h!B!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"g(B") ; Half Form | 289 | ("$,15f(B" . "$,4!."Y(B") |
| 425 | ("\\($(5!H!h!B(B\\)" "$(5$x(B") | 290 | ("$,15f6#(B" . "$,4!/"Y(B") |
| 426 | ("\\($(5!H!h!F(B\\)" "$(5$y(B") | 291 | ("$,15f6-5p(B" . "$,4!0"Y(B") |
| 427 | ("\\($(5!H!h!Q(B\\)" "$(5$z(B") | 292 | ("$,15f6-5f(B" . "$,4!1"Y(B") |
| 428 | ("\\($(5!H!h!O(B\\)" "$(5"&(B") ; Post "r" | 293 | ("$,15f6-5g(B" . "$,4!2"Y(B") |
| 429 | ("\\($(5!H!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"H(B") ; Half Form | 294 | ("$,15f6-5n(B" . "$,4!3(B") |
| 430 | ("\\($(5!I!h!O(B\\)" "$(5"'(B") ; Post "r" | 295 | ("$,15f6-5o(B" . "$,4!4(B") |
| 431 | ("\\($(5!I!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"I(B") ; Half Form | 296 | ("$,15f6-5u(B" . "$,4!5"Y(B") |
| 432 | ("\\($(5!I!i!h!O(B\\)" "$(5""(B") ; Nukta Post "r" | 297 | |
| 433 | ("\\($(5!I!i!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"y(B") ; Nukta Half Form | 298 | ("$,15g(B" . "$,4!6")(B") |
| 434 | ("\\($(5!I!i(B\\)" "$(5#I(B") ; Nukta | 299 | ("$,15g6-(B" . "$,4!6(B") |
| 435 | ("\\($(5!J!h(B\\)$(5!F!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Special Half Form | 300 | ("$,15g6-5p(B" . "$,4!7")(B") |
| 436 | ("\\($(5!J!h!F(B\\)" "$(5${(B") | 301 | ("$,15g6-5p6-(B" . "$,4!7(B") |
| 437 | ("\\($(5!J!h(B\\)$(5!J!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Special Half Form | 302 | |
| 438 | ("\\($(5!J!h!J(B\\)" "$(5$|(B") | 303 | ("$,15h(B" . "$,4!8")(B") |
| 439 | ("\\($(5!J!h(B\\)$(5!T!h(B[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Special Half Form | 304 | ("$,15h6-(B" . "$,4!8(B") |
| 440 | ("\\($(5!J!h!T(B\\)" "$(5$}(B") | 305 | ("$,15h6-5p(B" . "$,4!9")(B") |
| 441 | ("\\($(5!J!h!O(B\\)" "$(5!J"q(B") ; Post "r" | 306 | ("$,15h6-5p6-(B" . "$,4!9")(B") |
| 442 | ("\\($(5!J!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"J(B") ; Half Form | 307 | ("$,15h6-5h(B" . "$,4!:")(B") |
| 443 | ("\\($(5!K!h!F(B\\)" "$(5$~(B") | 308 | ("$,15h6-5h6-(B" . "$,4!:(B") |
| 444 | ("\\($(5!K!h!O(B\\)" "$(5!K"q(B") ; Post "r" | 309 | |
| 445 | ("\\($(5!K!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"K(B") ; Half Form | 310 | ("$,15i(B" . "$,4!8"#")(B") |
| 446 | ("\\($(5!L!h!F(B\\)" "$(5#P(B") | 311 | ;; LABIALS |
| 447 | ("\\($(5!L!h!Q(B\\)" "$(5#Q(B") | 312 | ("$,15j(B" . "$,4!;")(B") |
| 448 | ("\\($(5!L!h!O(B\\)" "$(5!L"q(B") ; Post "r" | 313 | ("$,15j6-(B" . "$,4!;(B") |
| 449 | ("\\($(5!L!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"L(B") ; Half Form | 314 | ("$,15j6-5p(B" . "$,4!<")(B") |
| 450 | ("\\($(5!M!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"M(B") ; Half Form | 315 | ("$,15j6-5p6-(B" . "$,4!<(B") |
| 451 | ("\\($(5!N!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"N(B") ; Half Form | 316 | |
| 452 | ;; special form for "ru". | 317 | ("$,15k(B" . "$,4!a"[(B") |
| 453 | ("\\($(5!O!](B\\)" "$(5",(B") | 318 | ("$,15k6-(B" . "$,4!=(B") |
| 454 | ("\\($(5!O!^(B\\)" "$(5"-(B") | 319 | ("$,15k6-5p(B" . "$,4!c"[(B") |
| 455 | ("\\($(5!P!](B\\)" "$(5".(B") | 320 | |
| 456 | ("\\($(5!P!^(B\\)" "$(5"/(B") | 321 | ("$,15l(B" . "$,4!d")(B") |
| 457 | ;; | 322 | ("$,15l6-(B" . "$,4!d(B") |
| 458 | ("\\($(5!Q!h!Q(B\\)" "$(5#`(B" sanskrit) | 323 | ("$,15l6-5p(B" . "$,4!e")(B") |
| 459 | ("\\($(5!Q!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"Q(B") ; Half Form | 324 | ("$,15l6-5p6-(B" . "$,4!e(B") |
| 460 | ("\\($(5!R!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"R(B") ; Half Form | 325 | |
| 461 | ("\\($(5!S!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"S(B") ; Half Form | 326 | ("$,15m(B" . "$,4!f")(B") |
| 462 | ("\\($(5!T!h!F(B\\)" "$(5#a(B") | 327 | ("$,15m6-(B" . "$,4!f(B") |
| 463 | ("\\($(5!T!h!T(B\\)" "$(5#b(B") | 328 | ("$,15m6-5p(B" . "$,4!g")(B") |
| 464 | ("\\($(5!T!h!O(B\\)" "$(5!T"q(B") ; Post "r" | 329 | ("$,15m6-5p6-(B" . "$,4!g(B") |
| 465 | ("\\($(5!T!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"T(B") ; Half Form | 330 | |
| 466 | ("\\($(5!U!h!8!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"h(B") ; Half Form | 331 | ("$,15n(B" . "$,4!h")(B") |
| 467 | ("\\($(5!U!h!8(B\\)" "$(5#c(B") | 332 | ("$,15n6-(B" . "$,4!h(B") |
| 468 | ("\\($(5!U!h!F(B\\)" "$(5#d(B") | 333 | ("$,15n6-5p(B" . "$,4!i")(B") |
| 469 | ("\\($(5!U!h!J(B\\)" "$(5#e(B") | 334 | ("$,15n6-5p6-(B" . "$,4!i(B") |
| 470 | ("\\($(5!U!h!Q(B\\)" "$(5#f(B") | 335 | ;; SEMIVOWELS |
| 471 | ("\\($(5!U!h(B\\)$(5!T!h!O(B" "$(5"U(B") ; Special Half Form | 336 | ("$,15o(B" . "$,4!j")(B") |
| 472 | ("\\($(5!U!h!T!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"j(B") ; Half Form | 337 | ("$,15o6-(B" . "$,4!j(B") |
| 473 | ; ("\\($(5!U!h!T(B\\)" "$(5#g(B") | 338 | ("$,15o6-5p(B" . "$,4!k")(B") |
| 474 | ("\\($(5!U!h!O!h!T(B\\)" "$(5#g(B") | 339 | ("$,15o6-5p6-(B" . "$,4!k(B") |
| 475 | ("\\($(5!U!h!O!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"i(B") ; Half Form | 340 | ("$,16-5o(B" . "$,4!l(B") ;; when every ohter lig. fails. |
| 476 | ("\\($(5!U!h!O(B\\)" "$(5")(B") ; Post "r" | 341 | |
| 477 | ("\\($(5!U!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"U(B") ; Half Form | 342 | ("$,15p(B" . "$,4!n"W(B") |
| 478 | ("\\($(5!V!h!=!h!O!h!M(B\\)" "$(5#h(B") | 343 | ;; ("$,15p6-(B" . "\$,4"'(B") ;; special case. only the topmost pos. |
| 479 | ("\\($(5!V!h!=!h!M(B\\)" "$(5#i(B") | 344 | ("$,15q(B" . "$,4!n"#"W(B") |
| 480 | ("\\($(5!V!h!=!h!T(B\\)" "$(5#j(B") | 345 | ("$,15q6-(B" . "$,4!m(B") ;; IS 13194 speical rule. |
| 481 | ("\\($(5!V!h!=(B\\)" "$(5#k(B") | 346 | ("$,15p6!(B" . "$,4!o"[(B") |
| 482 | ("\\($(5!V!h!>(B\\)" "$(5#l(B") | 347 | ("$,15p6"(B" . "$,4!p"\(B") |
| 483 | ("\\($(5!V!h!O(B\\)" "$(5!V"q(B") ; Post "r" | 348 | |
| 484 | ("\\($(5!V!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"V(B") ; Half Form | 349 | ("$,15r(B" . "$,4!q")(B") |
| 485 | ("\\($(5!W!h!F!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"W"F(B") ; Special Half Form | 350 | ("$,15r6-(B" . "$,4!q(B") |
| 486 | ("\\($(5!W!h!F(B\\)" "$(5#m(B") | 351 | ("$,15s(B" . "$,4!s(B") |
| 487 | ("\\($(5!W!h!O(B\\)" "$(5#n(B") | 352 | ("$,15s6-(B" . "$,4!r(B") |
| 488 | ("\\($(5!W!h(B\\)[$(5!3(B-$(5!N!P(B-$(5!X(B]" "$(5"W(B") ; Half Form | 353 | ("$,15t(B" . "$,4!s"#(B") |
| 489 | ("\\($(5!X!h!A(B\\)" "$(5#p(B") | 354 | ("$,15t6-(B" . "$,4!r"#(B") |
| 490 | ("\\($(5!X!h!F(B\\)" "$(5#q(B") | 355 | |
| 491 | ("\\($(5!X!h!L(B\\)" "$(5#r(B") | 356 | ("$,15u(B" . "$,4!t")(B") |
| 492 | ("\\($(5!X!h!M(B\\)" "$(5#s(B") | 357 | ("$,15u6-(B" . "$,4!t(B") |
| 493 | ("\\($(5!X!h!O(B\\)" "$(5#t(B") | 358 | ("$,15u6-5p(B" . "$,4!u")(B") |
| 494 | ("\\($(5!X!h!Q(B\\)" "$(5#u(B") | 359 | ("$,15u6-5p6-(B" . "$,4!u(B") |
| 495 | ("\\($(5!X!h!T(B\\)" "$(5#v(B") | 360 | ;; SIBILANTS |
| 496 | ;; Special Ligature Rules | 361 | ("$,15v(B" . "$,4!v")(B") |
| 497 | ("\\($(5!X!_(B\\)" "$(5#R(B") | 362 | ("$,15v6-(B" . "$,4!v(B") |
| 498 | 363 | ("$,15v6-5u(B" . "$,4!w")(B") | |
| 499 | ;; For consonants other than listed above, glyph-composition will | 364 | ("$,15v6-5u6-(B" . "$,4!w(B") |
| 500 | ;; be applied. If the consonant which is preceding "$(5!O(B" does not | 365 | ("$,15v6-5p(B" . "$,4!x")(B") |
| 501 | ;; have the vertical line (such as "$(5!?(B"), "$(5"r(B" is put beneath the | 366 | ("$,15v6-5p6-(B" . "$,4!x(B") |
| 502 | ;; consonant. | 367 | |
| 503 | ;; | 368 | ("$,15w(B" . "$,4!y")(B") |
| 504 | ("[$(5!7!9!=!>!?!@!D!O!P!R!S!X(B]\\($(5!h!O(B\\)" "$(5"r(B") | 369 | ("$,15w6-(B" . "$,4!y(B") |
| 505 | ("[$(5!6!8!C!E!F!H!J!K!L!M!T!V(B]\\($(5!h!O(B\\)" "$(5"q(B") | 370 | ("$,15x(B" . "$,4!z")(B") |
| 506 | ("$(5!?!i(B\\($(5!h!O(B\\)" "$(5"r(B") | 371 | ("$,15x6-(B" . "$,4!z(B") |
| 507 | ("$(5!@!i(B\\($(5!h!O(B\\)" "$(5"r(B") | 372 | ("$,15x6-5p(B" . "$,4!{")(B") |
| 508 | 373 | ("$,15x6-5p6-(B" . "$,4!{(B") | |
| 509 | ;; Nukta with Non-Consonants | 374 | |
| 510 | ("\\($(5!!!i(B\\)" "$(5#!(B") | 375 | ("$,15y(B" . "$,4!}(B") |
| 511 | ("\\($(5!&!i(B\\)" "$(5#&(B") | 376 | ("$,15y6-(B" . "$,4!|(B") |
| 512 | ("\\($(5!'!i(B\\)" "$(5#'(B") | 377 | ("$,15y6#(B" . "$,4!~(B") |
| 513 | ("\\($(5!*!i(B\\)" "$(5#*(B") | 378 | ("$,15y6-5p(B" . "$,4!(B") |
| 514 | ("\\($(5 | 390 | ("$,16<(B" . "$,4!#"W(B") |
| 391 | ("$,16=(B" . "$,4!'"X(B") | ||
| 392 | ("$,16>(B" . "$,4!b"[(B") | ||
| 393 | ("$,16>6-(B" . "$,4!>(B") | ||
| 394 | ("$,16?(B" . "$,4!j"#")(B") | ||
| 395 | ;; misc modifiers. | ||
| 396 | ("$,15A(B" . "\$,4"$(B") | ||
| 397 | ("$,15B(B" . "\$,4"&(B") | ||
| 398 | ("$,15C(B" . "$,4 F(B") | ||
| 399 | ("$,15|(B" . "$,4"#(B") | ||
| 400 | ("$,15}(B" . "$,4 E(B") | ||
| 401 | ("$,16-(B" . "$,4""(B") | ||
| 402 | ("$,16-5p(B" . "$,4"%(B") ;; following "r" | ||
| 403 | ;; ("$,160(B" . "$,4 D(B") | ||
| 404 | ;; ("$,16D(B" . "$,4 J(B") | ||
| 405 | ;; ("$,16F(B" . "") | ||
| 406 | ;; ("$,16G(B" . "") | ||
| 407 | ;; ("$,16H(B" . "") | ||
| 408 | ;; ("$,16I(B" . "") | ||
| 409 | ;; ("$,16J(B" . "") | ||
| 410 | ;; ("$,16K(B" . "") | ||
| 411 | ;; ("$,16L(B" . "") | ||
| 412 | ;; ("$,16M(B" . "") | ||
| 413 | ;; ("$,16N(B" . "") | ||
| 414 | ;; ("$,16O(B" . "") | ||
| 526 | ) | 415 | ) |
| 527 | "Alist of regexps of Devanagari character sequences vs composed characters.") | 416 | "Devanagari characters to glyphs conversion table. |
| 528 | 417 | Default value contains only the basic rules. You may add your own | |
| 529 | (let ((rules devanagari-char-to-glyph-rules)) | 418 | preferred rule from the sanskrit fonts." ) |
| 530 | (while rules | 419 | |
| 531 | (let ((rule (car rules)) | 420 | (defvar dev-char-glyph-hash |
| 532 | (chars) (char) (glyphs) (glyph)) | 421 | (let* ((hash (makehash 'equal))) |
| 533 | (setq rules (cdr rules)) | 422 | (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) |
| 534 | (string-match "\\\\(\\(.+\\)\\\\)" (car rule)) | 423 | dev-char-glyph) |
| 535 | (setq chars (substring (car rule) (match-beginning 1) (match-end 1))) | 424 | hash)) |
| 536 | (setq char (string-to-char chars)) | 425 | |
| 537 | (setq glyphs (cdr rule)) | 426 | (defvar dev-char-glyph-regexp |
| 538 | (setq glyph (string-to-char (car glyphs))) | 427 | (regexp-of-hashtbl-keys dev-char-glyph-hash)) |
| 539 | (put-char-code-property | 428 | |
| 540 | char 'char-to-glyph | 429 | ;; glyph-to-glyph conversion table. |
| 541 | ;; We don't "cons" it since priority is top to down. | 430 | ;; it is supposed that glyphs are ordered in |
| 542 | (append (get-char-code-property char 'char-to-glyph) (list rule))) | 431 | ;; [consonant/nukta] - [matra/halant] - [preceding-r] - [anuswar]. |
| 543 | 432 | ||
| 544 | (if (and (< ?(5z(B glyph) ; Glyphs only. | 433 | (defvar dev-glyph-glyph |
| 545 | (null (get-char-code-property glyph 'glyph-to-char))) | 434 | '(("\$,4"'(B\$,4"&(B" . "\$,4"((B") |
| 546 | ; One glyph may corresponds to multiple characters, | 435 | ("\$,4"'(B\$,4"$(B" . "\$,4"((B") |
| 547 | ; e.g., surrounding vowel in Tamil, etc. | 436 | ("$,4"*(B\$,4"&(B" . "$,4"+(B") |
| 548 | ; but for Devanagari, we put this restriction | 437 | ("$,4"*(B\$,4"'(B" . "$,4",(B") |
| 549 | ; to make sure the fact that one glyph corresponds to one char. | 438 | ("$,4"*(B\$,4"'(B\$,4"&(B" . "$,4"-(B") |
| 550 | (put-char-code-property | 439 | ("$,4"2(B\$,4"&(B" . "$,4"3(B") |
| 551 | glyph 'glyph-to-char | 440 | ("$,4"2(B\$,4"'(B" . "$,4"4(B") |
| 552 | (cons (list (car glyphs) chars) | 441 | ("$,4"2(B\$,4"'(B\$,4"&(B" . "$,4"5(B") |
| 553 | (get-char-code-property glyph 'glyph-to-char) | 442 | ("$,4"#(B\$,4"6(B" . "$,4"7(B") |
| 554 | )))))) | 443 | ("$,4"%(B\$,4"6(B" . "$,4"8(B") |
| 555 | 444 | ;;("$,4"6(B" . "$,4"9(B") | |
| 556 | ;; | 445 | ("$,4"#(B\$,4":(B" . "$,4";(B") |
| 557 | ;; Function used in both characters-to-glyphs conversion and | 446 | ("$,4"%(B\$,4":(B" . "$,4"<(B") |
| 558 | ;; glyphs-to-characters conversion. | 447 | ;;("$,4":(B" . "$,4"=(B") |
| 559 | ;; | 448 | ("\$,4"@(B\$,4"&(B" . "\$,4"A(B") |
| 560 | 449 | ("\$,4"@(B\$,4"'(B" . "\$,4"B(B") | |
| 561 | (defun max-match-len (regexp) | 450 | ("\$,4"@(B\$,4"'(B\$,4"&(B" . "\$,4"C(B") |
| 562 | "Return the maximum length of text that can match the pattern REGEXP. | 451 | ("\$,4"D(B\$,4"&(B" . "\$,4"E(B") |
| 563 | Only [...] pattern of regexp is recognized." | 452 | ("\$,4"D(B\$,4"'(B" . "\$,4"F(B") |
| 564 | (let ((len 0) | 453 | ("\$,4"D(B\$,4"'(B\$,4"&(B" . "\$,4"G(B") |
| 565 | (index 0)) | 454 | ("\$,4"H(B\$,4"&(B" . "\$,4"I(B") |
| 566 | (while (string-match "\\[\\([^\]]\\)+\\]" regexp index) | 455 | ("\$,4"H(B\$,4"'(B" . "\$,4"J(B") |
| 567 | (setq len (+ len (- (match-beginning 0) index) 1) | 456 | ("\$,4"H(B\$,4"'(B\$,4"&(B" . "\$,4"K(B") |
| 568 | index (match-end 0))) | 457 | ("\$,4"L(B\$,4"&(B" . "\$,4"M(B") |
| 569 | len)) | 458 | ("\$,4"L(B\$,4"'(B" . "\$,4"N(B") |
| 570 | 459 | ("\$,4"L(B\$,4"'(B\$,4"&(B" . "\$,4"O(B") | |
| 571 | ;; Return t iff at least one member appears in both LIST1 and LIST2. | ||
| 572 | (defun intersecting-p (list1 list2) | ||
| 573 | (let ((found nil)) | ||
| 574 | (while (and list1 (not found)) | ||
| 575 | (if (memq (car list1) list2) | ||
| 576 | (setq found t) | ||
| 577 | (setq list1 (cdr list1)))) | ||
| 578 | found)) | ||
| 579 | |||
| 580 | (defun string-conversion-by-rule (source symbol &rest specs) | ||
| 581 | "Convert string SOURCE by rules stored in SYMBOL property of each character. | ||
| 582 | The remaining arguments forms a list SPECS that restricts applicable rules. | ||
| 583 | |||
| 584 | The rules has the form ((REGEXP STR RULE-SPEC ...) ...). | ||
| 585 | Each character sequence in STRING that matches REGEXP is | ||
| 586 | replaced by STR. | ||
| 587 | |||
| 588 | If SPECS is nil, only rules with no RULE-SPECs is applied. Otherwise | ||
| 589 | rules with no RULE-SPECS and rules that have at least one member of | ||
| 590 | SPECS in RULE-SPECs is applied. | ||
| 591 | |||
| 592 | Rules are tested in the order of the list, thus more specific rules | ||
| 593 | should be placed in front of less specific rules. | ||
| 594 | |||
| 595 | If rule is given in the forms of regexp '...\\(...\\)...', a character | ||
| 596 | sequence that matches the pattern inside of the parenthesis is the | ||
| 597 | subject of the match. Otherwise, the entire expression is the subject | ||
| 598 | of the match." | ||
| 599 | (let ((pos 0) | ||
| 600 | (dst-str "")) | ||
| 601 | (while (< pos (length source)) | ||
| 602 | (let ((found nil) | ||
| 603 | (rules (get-char-code-property | ||
| 604 | (string-to-char | ||
| 605 | (substring source pos)) symbol))) | ||
| 606 | (while rules | ||
| 607 | (let* ((rule (car rules)) | ||
| 608 | (regexp (car rule)) | ||
| 609 | (replace-str (car (cdr rule))) | ||
| 610 | (rule-specs (cdr (cdr rule))) | ||
| 611 | search-pos) | ||
| 612 | (if (not (or (null rule-specs) | ||
| 613 | (intersecting-p specs rule-specs))) | ||
| 614 | (setq rules (cdr rules)) | ||
| 615 | (if (null (string-match "\\\\(.+\\\\)" regexp)) | ||
| 616 | (progn | ||
| 617 | (setq regexp (concat "\\(" regexp "\\)")) | ||
| 618 | (setq search-pos pos)) | ||
| 619 | (setq search-pos (- pos (max-match-len | ||
| 620 | (substring regexp | ||
| 621 | (string-match "^[^\\\\]*" regexp) | ||
| 622 | (match-end 0)))))) | ||
| 623 | (if (< search-pos 0) (setq search-pos 0)) | ||
| 624 | (if (string-match regexp source search-pos) | ||
| 625 | (if (= (match-beginning 1) pos) | ||
| 626 | (progn | ||
| 627 | (setq dst-str (concat dst-str replace-str)) | ||
| 628 | (setq rules nil) ; Get out of the loop. | ||
| 629 | (setq found t) | ||
| 630 | ;; proceed `pos' for replaced characters. | ||
| 631 | (setq pos (match-end 1))) | ||
| 632 | (setq rules (cdr rules))) | ||
| 633 | (setq rules (cdr rules)))))) | ||
| 634 | ;; proceed to next position | ||
| 635 | (if (not found) | ||
| 636 | (setq dst-str (concat dst-str (substring source pos (1+ pos))) | ||
| 637 | pos (1+ pos))))) | ||
| 638 | dst-str)) | ||
| 639 | |||
| 640 | |||
| 641 | ;; | ||
| 642 | ;; Convert Character Code to Glyph Code | ||
| 643 | ;; | ||
| 644 | |||
| 645 | ;;;###autoload | ||
| 646 | (defun char-to-glyph-devanagari (string &rest langs) | ||
| 647 | "Convert Devanagari characters in STRING to Devanagari glyphs. | ||
| 648 | Ligatures and special rules are processed." | ||
| 649 | (apply | ||
| 650 | 'string-conversion-by-rule | ||
| 651 | (append (list string 'char-to-glyph) langs))) | ||
| 652 | |||
| 653 | ;; Example: | ||
| 654 | ;;(char-to-glyph-devanagari "$(5!X) | ||
| 729 | (?$(5!^(B 0 (br . tr)) | ||
| 730 | (?$(5!_(B 0 (br . tr)) | ||
| 731 | (?$(5!`(B 0 (mr . mr)) ; (tc . bc) | ||
| 732 | (?$(5!a(B 0 (mr . mr)) | ||
| 733 | (?$(5!b(B 0 (mr . mr)) | ||
| 734 | (?$(5!c(B 0 (mr . mr)) | ||
| 735 | (?$(5!d(B 0) | ||
| 736 | (?$(5!e(B 0) | ||
| 737 | (?$(5!f(B 0) | ||
| 738 | (?$(5!g(B 0) | ||
| 739 | (?$(5!h(B 0 (br . tr)) | ||
| 740 | (?$(5!i(B 0 (br . tr)) | ||
| 741 | (?$(5!j(B 0) | ||
| 742 | (nil 0) | ||
| 743 | (nil 0) | ||
| 744 | (nil 0) | ||
| 745 | (nil 0) | ||
| 746 | (nil 0) | ||
| 747 | (nil 0) | ||
| 748 | (?$(5!q(B 0) | ||
| 749 | (?$(5!r(B 0) | ||
| 750 | (?$(5!s(B 0) | ||
| 751 | (?$(5!t(B 0) | ||
| 752 | (?$(5!u(B 0) | ||
| 753 | (?$(5!v(B 0) | ||
| 754 | (?$(5!w(B 0) | ||
| 755 | (?$(5!x(B 0) | ||
| 756 | (?$(5!y(B 0) | ||
| 757 | (?$(5!z(B 0) | ||
| 758 | (nil 0) | ||
| 759 | (nil 0) | ||
| 760 | (nil 0) | ||
| 761 | (nil 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"+(B 0) | ||
| 773 | (?$(5",(B 0) | ||
| 774 | (?$(5"-(B 0) | ||
| 775 | (?$(5".(B 0) | ||
| 776 | (?$(5"/(B 0) | ||
| 777 | (?$(5"0(B 0) | ||
| 778 | (?$(5"1(B 0) | ||
| 779 | (?$(5"2(B 0) | ||
| 780 | (?$(5"3(B 0) | ||
| 781 | (?$(5"4(B 0) | ||
| 782 | (?$(5"5(B 0) | ||
| 783 | (?$(5"6(B 0) | ||
| 784 | (?$(5"7(B 0) | ||
| 785 | (?$(5"8(B 0) | ||
| 786 | (?$(5"9(B 0) | ||
| 787 | (?$(5":(B 0) | ||
| 788 | (?$(5";(B 0) | ||
| 789 | (?$(5"<(B 0) | ||
| 790 | (?$(5"=(B 0) | ||
| 791 | (?$(5">(B 0) | ||
| 792 | (?$(5"?(B 0) | ||
| 793 | (?$(5"@(B 0) | ||
| 794 | (?$(5"A(B 0) | ||
| 795 | (?$(5"B(B 0) | ||
| 796 | (?$(5"C(B 0) | ||
| 797 | (?$(5"D(B 0) | ||
| 798 | (?$(5"E(B 0) | ||
| 799 | (?$(5"F(B 0) | ||
| 800 | (?$(5"G(B 0) | ||
| 801 | (?$(5"H(B 0) | ||
| 802 | (?$(5"I(B 0) | ||
| 803 | (?$(5"J(B 0) | ||
| 804 | (?$(5"K(B 0) | ||
| 805 | (?$(5"L(B 0) | ||
| 806 | (?$(5"M(B 0) | ||
| 807 | (?$(5"N(B 0) | ||
| 808 | (?$(5"O(B 0) | ||
| 809 | (?$(5"P(B 0) | ||
| 810 | (?$(5"Q(B 0) | ||
| 811 | (?$(5"R(B 0) | ||
| 812 | (?$(5"S(B 0) | ||
| 813 | (?$(5"T(B 0) | ||
| 814 | (?$(5"U(B 0) | ||
| 815 | (?$(5"V(B 0) | ||
| 816 | (?$(5"W(B 0) | ||
| 817 | (?$(5"X(B 0) | ||
| 818 | (?$(5"Y(B 0) | ||
| 819 | (?$(5"Z(B 0) | ||
| 820 | (?$(5"[(B 0) | ||
| 821 | (?$(5"\(B 0) | ||
| 822 | (?$(5"](B 0) | ||
| 823 | (?$(5"^(B 0) | ||
| 824 | (?$(5"_(B 0) | ||
| 825 | (?$(5"`(B 0) | ||
| 826 | (?$(5"a(B 0) | ||
| 827 | (?$(5"b(B 0) | ||
| 828 | (?$(5"c(B 0) | ||
| 829 | (?$(5"d(B 0) | ||
| 830 | (?$(5"e(B 0) | ||
| 831 | (?$(5"f(B 0) | ||
| 832 | (?$(5"g(B 0) | ||
| 833 | (?$(5"h(B 0) | ||
| 834 | (?$(5"i(B 0) | ||
| 835 | (?$(5"j(B 0) | ||
| 836 | (?$(5"k(B 0) | ||
| 837 | (?$(5"l(B 0) | ||
| 838 | (?$(5"m(B 0) | ||
| 839 | (?$(5"n(B 0) | ||
| 840 | (?$(5"o(B 0) | ||
| 841 | (?$(5"p(B 10 (mr . mr)) | ||
| 842 | (?$(5"q(B 0 (br . br)) | ||
| 843 | (?$(5"r(B 0 (br . tr)) | ||
| 844 | (?$(5"s(B 0) | ||
| 845 | (?$(5"t(B 0) | ||
| 846 | (?$(5"u(B 0) | ||
| 847 | (?$(5"v(B 0) | ||
| 848 | (?$(5"w(B 0) | ||
| 849 | (?$(5"x(B 0) | ||
| 850 | (?$(5"y(B 0) | ||
| 851 | (?$(5"z(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#+(B 0) | ||
| 867 | (?$(5#,(B 0) | ||
| 868 | (?$(5#-(B 0) | ||
| 869 | (?$(5#.(B 0) | ||
| 870 | (?$(5#/(B 0) | ||
| 871 | (?$(5#0(B 0) | ||
| 872 | (?$(5#1(B 0) | ||
| 873 | (?$(5#2(B 0) | ||
| 874 | (?$(5#3(B 0) | ||
| 875 | (?$(5#4(B 0) | ||
| 876 | (?$(5#5(B 0) | ||
| 877 | (?$(5#6(B 0) | ||
| 878 | (?$(5#7(B 0) | ||
| 879 | (?$(5#8(B 0) | ||
| 880 | (?$(5#9(B 0) | ||
| 881 | (?$(5#:(B 0) | ||
| 882 | (?$(5#;(B 0) | ||
| 883 | (?$(5#<(B 0) | ||
| 884 | (?$(5#=(B 0) | ||
| 885 | (?$(5#>(B 0) | ||
| 886 | (?$(5#?(B 0) | ||
| 887 | (?$(5#@(B 0) | ||
| 888 | (?$(5#A(B 0) | ||
| 889 | (?$(5#B(B 0) | ||
| 890 | (?$(5#C(B 0) | ||
| 891 | (?$(5#D(B 0) | ||
| 892 | (?$(5#E(B 0) | ||
| 893 | (?$(5#F(B 0) | ||
| 894 | (?$(5#G(B 0) | ||
| 895 | (?$(5#H(B 0) | ||
| 896 | (?$(5#I(B 0) | ||
| 897 | (?$(5#J(B 0) | ||
| 898 | (?$(5#K(B 0 (br . tr)) | ||
| 899 | (?$(5#L(B 0 (br . tr)) | ||
| 900 | (?$(5#M(B 0 (br . tr)) | ||
| 901 | (?$(5#N(B 0) | ||
| 902 | (?$(5#O(B 0) | ||
| 903 | (?$(5#P(B 0) | ||
| 904 | (?$(5#Q(B 0) | ||
| 905 | (?$(5#R(B 0) | ||
| 906 | (?$(5#S(B 0) | ||
| 907 | (?$(5#T(B 0) | ||
| 908 | (?$(5#U(B 0) | ||
| 909 | (?$(5#V(B 0) | ||
| 910 | (?$(5#W(B 0) | ||
| 911 | (?$(5#X(B 0) | ||
| 912 | (?$(5#Y(B 0) | ||
| 913 | (?$(5#Z(B 0) | ||
| 914 | (?$(5#[(B 0) | ||
| 915 | (?$(5#\(B 0) | ||
| 916 | (?$(5#](B 0) | ||
| 917 | (?$(5#^(B 0) | ||
| 918 | (?$(5#_(B 0) | ||
| 919 | (?$(5#`(B 0) | ||
| 920 | (?$(5#a(B 0) | ||
| 921 | (?$(5#b(B 0) | ||
| 922 | (?$(5#c(B 0) | ||
| 923 | (?$(5#d(B 0) | ||
| 924 | (?$(5#e(B 0) | ||
| 925 | (?$(5#f(B 0) | ||
| 926 | (?$(5#g(B 0) | ||
| 927 | (?$(5#h(B 0) | ||
| 928 | (?$(5#i(B 0) | ||
| 929 | (?$(5#j(B 0) | ||
| 930 | (?$(5#k(B 0) | ||
| 931 | (?$(5#l(B 0) | ||
| 932 | (?$(5#m(B 0) | ||
| 933 | (?$(5#n(B 0) | ||
| 934 | (?$(5#o(B 0) | ||
| 935 | (?$(5#p(B 0) | ||
| 936 | (?$(5#q(B 0) | ||
| 937 | (?$(5#r(B 0) | ||
| 938 | (?$(5#s(B 0) | ||
| 939 | (?$(5#t(B 0) | ||
| 940 | (?$(5#u(B 0) | ||
| 941 | (?$(5#v(B 0) | ||
| 942 | (?$(5#w(B 0) | ||
| 943 | (?$(5#x(B 0) | ||
| 944 | (?$(5#y(B 0) | ||
| 945 | (?$(5#z(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$+(B 0) | ||
| 961 | (?$(5$,(B 0) | ||
| 962 | (?$(5$-(B 0) | ||
| 963 | (?$(5$.(B 0) | ||
| 964 | (?$(5$/(B 0) | ||
| 965 | (?$(5$0(B 0) | ||
| 966 | (?$(5$1(B 0) | ||
| 967 | (?$(5$2(B 0) | ||
| 968 | (?$(5$3(B 0) | ||
| 969 | (?$(5$4(B 0) | ||
| 970 | (?$(5$5(B 0) | ||
| 971 | (?$(5$6(B 0) | ||
| 972 | (?$(5$7(B 0) | ||
| 973 | (?$(5$8(B 0) | ||
| 974 | (?$(5$9(B 0) | ||
| 975 | (?$(5$:(B 0) | ||
| 976 | (?$(5$;(B 0) | ||
| 977 | (?$(5$<(B 0) | ||
| 978 | (?$(5$=(B 0) | ||
| 979 | (?$(5$>(B 0) | ||
| 980 | (?$(5$?(B 0) | ||
| 981 | (?$(5$@(B 0) | ||
| 982 | (?$(5$A(B 0) | ||
| 983 | (?$(5$B(B 0) | ||
| 984 | (?$(5$C(B 0) | ||
| 985 | (?$(5$D(B 0) | ||
| 986 | (?$(5$E(B 0) | ||
| 987 | (?$(5$F(B 0) | ||
| 988 | (?$(5$G(B 0) | ||
| 989 | (?$(5$H(B 0) | ||
| 990 | (?$(5$I(B 0) | ||
| 991 | (?$(5$J(B 0) | ||
| 992 | (?$(5$K(B 0) | ||
| 993 | (?$(5$L(B 0) | ||
| 994 | (?$(5$M(B 0) | ||
| 995 | (?$(5$N(B 0) | ||
| 996 | (?$(5$O(B 0) | ||
| 997 | (?$(5$P(B 0) | ||
| 998 | (?$(5$Q(B 0) | ||
| 999 | (?$(5$R(B 0) | ||
| 1000 | (?$(5$S(B 0) | ||
| 1001 | (?$(5$T(B 0) | ||
| 1002 | (?$(5$U(B 0) | ||
| 1003 | (?$(5$V(B 0) | ||
| 1004 | (?$(5$W(B 0) | ||
| 1005 | (?$(5$X(B 0) | ||
| 1006 | (?$(5$Y(B 0) | ||
| 1007 | (?$(5$Z(B 0) | ||
| 1008 | (?$(5$[(B 0) | ||
| 1009 | (?$(5$\(B 0) | ||
| 1010 | (?$(5$](B 0) | ||
| 1011 | (?$(5$^(B 0) | ||
| 1012 | (?$(5$_(B 0) | ||
| 1013 | (?$(5$`(B 0) | ||
| 1014 | (?$(5$a(B 0) | ||
| 1015 | (?$(5$b(B 0) | ||
| 1016 | (?$(5$c(B 0) | ||
| 1017 | (?$(5$d(B 0) | ||
| 1018 | (?$(5$e(B 0) | ||
| 1019 | (?$(5$f(B 0) | ||
| 1020 | (?$(5$g(B 0) | ||
| 1021 | (?$(5$h(B 0) | ||
| 1022 | (?$(5$i(B 0) | ||
| 1023 | (?$(5$j(B 0) | ||
| 1024 | (?$(5$k(B 0) | ||
| 1025 | (?$(5$l(B 0) | ||
| 1026 | (?$(5$m(B 0) | ||
| 1027 | (?$(5$n(B 0) | ||
| 1028 | (?$(5$o(B 0) | ||
| 1029 | (?$(5$p(B 0) | ||
| 1030 | (?$(5$q(B 0) | ||
| 1031 | (?$(5$r(B 0) | ||
| 1032 | (?$(5$s(B 0) | ||
| 1033 | (?$(5$t(B 0) | ||
| 1034 | (?$(5$u(B 0) | ||
| 1035 | (?$(5$v(B 0) | ||
| 1036 | (?$(5$w(B 0) | ||
| 1037 | (?$(5$x(B 0) | ||
| 1038 | (?$(5$y(B 0) | ||
| 1039 | (?$(5$z(B 0) | ||
| 1040 | (?$(5${(B 0) | ||
| 1041 | (?$(5$|(B 0) | ||
| 1042 | (?$(5$}(B 0) | ||
| 1043 | (?$(5$~(B 0) | ||
| 1044 | )) | 460 | )) |
| 461 | (defvar dev-glyph-glyph-hash | ||
| 462 | (let* ((hash (makehash 'equal))) | ||
| 463 | (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) | ||
| 464 | dev-glyph-glyph) | ||
| 465 | hash)) | ||
| 466 | (defvar dev-glyph-glyph-regexp | ||
| 467 | (regexp-of-hashtbl-keys dev-glyph-glyph-hash)) | ||
| 468 | |||
| 469 | |||
| 470 | ;; yet another glyph-to-glyph conversions. | ||
| 471 | (defvar dev-glyph-glyph-2 | ||
| 472 | '(("$,4"*(B" . "$,4".(B") | ||
| 473 | ("$,4"+(B" . "$,4"/(B") | ||
| 474 | ("$,4",(B" . "$,4"0(B") | ||
| 475 | ("$,4"-(B" . "$,4"1(B"))) | ||
| 476 | (defvar dev-glyph-glyph-2-hash | ||
| 477 | (let* ((hash (makehash 'equal))) | ||
| 478 | (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) | ||
| 479 | dev-glyph-glyph-2) | ||
| 480 | hash)) | ||
| 481 | (defvar dev-glyph-glyph-2-regexp | ||
| 482 | (regexp-of-hashtbl-keys dev-glyph-glyph-2-hash)) | ||
| 483 | |||
| 484 | |||
| 485 | (defun dev-charseq (from &optional to) | ||
| 486 | (if (null to) (setq to from)) | ||
| 487 | (mapcar (function (lambda (x) (indian-glyph-char x 'devanagari))) | ||
| 488 | (range from to))) | ||
| 489 | |||
| 490 | (defvar dev-glyph-cvn | ||
| 491 | (append | ||
| 492 | (dev-charseq #x2b) | ||
| 493 | (dev-charseq #x3c #xc1) | ||
| 494 | (dev-charseq #xc3)) | ||
| 495 | "Devanagari Consonants/Vowels/Nukta Glyphs") | ||
| 496 | |||
| 497 | (defvar dev-glyph-space | ||
| 498 | (dev-charseq #xf0 #xfe) | ||
| 499 | "Devanagari Spacing Glyphs") | ||
| 500 | |||
| 501 | (defvar dev-glyph-right-modifier | ||
| 502 | (append | ||
| 503 | (dev-charseq #xc9) | ||
| 504 | (dev-charseq #xd2 #xd5)) | ||
| 505 | "Devanagari Modifiers attached at the right side.") | ||
| 506 | |||
| 507 | (defvar dev-glyph-right-modifier-regexp | ||
| 508 | (concat "[" dev-glyph-right-modifier "]")) | ||
| 509 | |||
| 510 | (defvar dev-glyph-left-matra | ||
| 511 | (dev-charseq #xca #xd1) | ||
| 512 | "Devanagari Matras attached at the left side.") | ||
| 513 | |||
| 514 | (defvar dev-glyph-top-matra | ||
| 515 | (dev-charseq #xe0 #xef) | ||
| 516 | "Devanagari Matras attached at the top side.") | ||
| 517 | |||
| 518 | (defvar dev-glyph-bottom-modifier | ||
| 519 | (append | ||
| 520 | (dev-charseq #xd6 #xdf) | ||
| 521 | (dev-charseq #xc2)) | ||
| 522 | "Devanagari Modifiers attached at the bottom.") | ||
| 523 | |||
| 524 | (defvar dev-glyph-order | ||
| 525 | `((,dev-glyph-cvn . 1) | ||
| 526 | (,dev-glyph-space . 2) | ||
| 527 | (,dev-glyph-right-modifier . 3) | ||
| 528 | (,dev-glyph-left-matra . 3) ;; processed by reference point. | ||
| 529 | (,dev-glyph-top-matra . 4) | ||
| 530 | (,(dev-charseq #xc7 #xc8) . 5) | ||
| 531 | (,(dev-charseq #xc6) . 6) | ||
| 532 | (,(dev-charseq #xc5) . 7) | ||
| 533 | (,dev-glyph-bottom-modifier . 8))) | ||
| 534 | |||
| 535 | (mapc | ||
| 536 | (function (lambda (x) | ||
| 537 | (mapc | ||
| 538 | (function (lambda (y) | ||
| 539 | (put-char-code-property y 'composition-order (cdr x)))) | ||
| 540 | (car x)))) | ||
| 541 | dev-glyph-order) | ||
| 542 | |||
| 543 | (mapc | ||
| 544 | (function (lambda (x) | ||
| 545 | (put-char-code-property x 'reference-point '(3 . 5)))) | ||
| 546 | dev-glyph-left-matra) | ||
| 547 | |||
| 548 | (defun devanagari-compose-syllable-string (string) | ||
| 549 | (with-temp-buffer | ||
| 550 | (insert (decompose-string string)) | ||
| 551 | (devanagari-compose-syllable-region (point-min) (point-max)) | ||
| 552 | (buffer-string))) | ||
| 553 | |||
| 554 | (defun devanagari-compose-syllable-region (from to) | ||
| 555 | "Compose devanagari syllable in region FROM to TO." | ||
| 556 | (let ((glyph-str nil) (cons-num 0) glyph-str-list | ||
| 557 | (last-halant nil) (preceding-r nil) (last-modifier nil) | ||
| 558 | (last-char (char-before to)) match-str | ||
| 559 | glyph-block split-pos) | ||
| 560 | (save-excursion | ||
| 561 | (save-restriction | ||
| 562 | ;;; *** char-to-glyph conversion *** | ||
| 563 | ;; Special rule 1. -- Last halant must be preserved. | ||
| 564 | (if (eq last-char ?$,16-(B) | ||
| 565 | (progn | ||
| 566 | (setq last-halant t) | ||
| 567 | (narrow-to-region from (1- to))) | ||
| 568 | (narrow-to-region from to) | ||
| 569 | ;; note if the last char is modifier. | ||
| 570 | (if (or (eq last-char ?$,15A(B) (eq last-char ?$,15B(B)) | ||
| 571 | (setq last-modifier t))) | ||
| 572 | (goto-char (point-min)) | ||
| 573 | ;; Special rule 2. -- preceding "r halant" must be modifier. | ||
| 574 | (when (looking-at "$,15p6-(B.") | ||
| 575 | (setq preceding-r t) | ||
| 576 | (goto-char (+ 2 (point)))) | ||
| 577 | ;; translate the rest characters into glyphs | ||
| 578 | (while (re-search-forward dev-char-glyph-regexp nil t) | ||
| 579 | (setq match-str (match-string 0)) | ||
| 580 | (setq glyph-str | ||
| 581 | (concat glyph-str | ||
| 582 | (gethash match-str dev-char-glyph-hash))) | ||
| 583 | ;; count the number of consonant-glyhs. | ||
| 584 | (if (string-match devanagari-consonant match-str) | ||
| 585 | (setq cons-num (1+ cons-num)))) | ||
| 586 | ;; preceding-r must be attached before the anuswar if exists. | ||
| 587 | (if preceding-r | ||
| 588 | (if last-modifier | ||
| 589 | (setq glyph-str (concat (substring glyph-str 0 -1) | ||
| 590 | "$,4"'(B" (substring glyph-str -1))) | ||
| 591 | (setq glyph-str (concat glyph-str "$,4"'(B")))) | ||
| 592 | (if last-halant (setq glyph-str (concat glyph-str "$,4""(B"))) | ||
| 593 | ;;; *** glyph-to-glyph conversion *** | ||
| 594 | (when (string-match dev-glyph-glyph-regexp glyph-str) | ||
| 595 | (setq glyph-str | ||
| 596 | (replace-match (gethash (match-string 0 glyph-str) | ||
| 597 | dev-glyph-glyph-hash) | ||
| 598 | nil t glyph-str)) | ||
| 599 | (if (and (> cons-num 1) | ||
| 600 | (string-match dev-glyph-glyph-2-regexp glyph-str)) | ||
| 601 | (setq glyph-str | ||
| 602 | (replace-match (gethash (match-string 0 glyph-str) | ||
| 603 | dev-glyph-glyph-2-hash) | ||
| 604 | nil t glyph-str)))) | ||
| 605 | ;;; *** glyph reordering *** | ||
| 606 | (while (setq split-pos (string-match "$,4""(B\\|.$" glyph-str)) | ||
| 607 | (setq glyph-block (substring glyph-str 0 (1+ split-pos))) | ||
| 608 | (setq glyph-str (substring glyph-str (1+ split-pos))) | ||
| 609 | (setq | ||
| 610 | glyph-block | ||
| 611 | (if (string-match dev-glyph-right-modifier-regexp glyph-block) | ||
| 612 | (sort (string-to-list glyph-block) | ||
| 613 | (function (lambda (x y) | ||
| 614 | (< (get-char-code-property x 'composition-order) | ||
| 615 | (get-char-code-property y 'composition-order))))) | ||
| 616 | (sort (string-to-list glyph-block) | ||
| 617 | (function (lambda (x y) | ||
| 618 | (let ((xo (get-char-code-property x 'composition-order)) | ||
| 619 | (yo (get-char-code-property y 'composition-order))) | ||
| 620 | (if (= xo 2) nil (if (= yo 2) t (< xo yo))))))))) | ||
| 621 | (setq glyph-str-list (nconc glyph-str-list glyph-block))) | ||
| 622 | ;; concatenate and attach reference-points. | ||
| 623 | (setq glyph-str | ||
| 624 | (cdr | ||
| 625 | (apply | ||
| 626 | 'nconc | ||
| 627 | (mapcar | ||
| 628 | (function (lambda (x) | ||
| 629 | (list | ||
| 630 | (or (get-char-code-property x 'reference-point) | ||
| 631 | '(5 . 3) ;; default reference point. | ||
| 632 | ) | ||
| 633 | x))) | ||
| 634 | glyph-str-list)))))) | ||
| 635 | (compose-region from to glyph-str))) | ||
| 1045 | 636 | ||
| 1046 | ;; Determine composition priority and rule of the array of Glyphs. | ||
| 1047 | ;; Sort the glyphs with their priority. | ||
| 1048 | |||
| 1049 | (defun devanagari-reorder-glyphs-for-composition (string start end) | ||
| 1050 | (let ((pos start) | ||
| 1051 | (ordered-glyphs nil)) | ||
| 1052 | (while (< pos end) | ||
| 1053 | (let ((glyph (aref string pos))) | ||
| 1054 | (setq pos (1+ pos)) | ||
| 1055 | (setq ordered-glyphs | ||
| 1056 | (append ordered-glyphs | ||
| 1057 | (list (assq glyph devanagari-composition-rules)))))) | ||
| 1058 | (sort ordered-glyphs '(lambda (x y) (< (car (cdr x)) (car (cdr y))))))) | ||
| 1059 | |||
| 1060 | ! ;;(devanagari-compose-to-one-glyph "$(5"5!X![(B") => "4$(6!Xv#"5t%![0!X"5![1(B" | ||
| 1061 | |||
| 1062 | (defun devanagari-compose-to-one-glyph (devanagari-string) | ||
| 1063 | (let* ((o-glyph-list (devanagari-reorder-glyphs-for-composition | ||
| 1064 | devanagari-string 0 (length devanagari-string))) | ||
| 1065 | ;; List of glyphs to be composed. | ||
| 1066 | (cmp-glyph-list (list (car (car o-glyph-list)))) | ||
| 1067 | (o-glyph-list (cdr o-glyph-list))) | ||
| 1068 | (while o-glyph-list | ||
| 1069 | (let* ((o-glyph (car o-glyph-list)) | ||
| 1070 | (glyph (if (< 2 (length o-glyph)) | ||
| 1071 | ;; default composition | ||
| 1072 | (list (car (cdr (cdr o-glyph))) (car o-glyph)) | ||
| 1073 | ;; composition with a specified rule | ||
| 1074 | (list '(mr . ml) (car o-glyph))))) | ||
| 1075 | (setq o-glyph-list (cdr o-glyph-list)) | ||
| 1076 | (setq cmp-glyph-list (append cmp-glyph-list glyph)))) | ||
| 1077 | ;; Before applying compose-chars, convert glyphs to | ||
| 1078 | ;; 1-column width if possible. | ||
| 1079 | (setq cmp-glyph-list (devanagari-wide-to-narrow cmp-glyph-list)) | ||
| 1080 | (if (= (length cmp-glyph-list) 1) (char-to-string (car cmp-glyph-list)) | ||
| 1081 | (apply 'compose-chars cmp-glyph-list)))) | ||
| 1082 | |||
| 1083 | (defun devanagari-composition-component (string &optional start end) | ||
| 1084 | (or start (setq start 0)) | ||
| 1085 | (or end (setq end (length string))) | ||
| 1086 | (let* ((o-glyph-list (devanagari-reorder-glyphs-for-composition | ||
| 1087 | string start end)) | ||
| 1088 | ;; List of glyphs to be composed. | ||
| 1089 | (cmp-glyph-list (list (car (car o-glyph-list))))) | ||
| 1090 | (setq o-glyph-list (cdr o-glyph-list)) | ||
| 1091 | (while o-glyph-list | ||
| 1092 | (let* ((o-glyph (car o-glyph-list)) | ||
| 1093 | (glyph (if (< 2 (length o-glyph)) | ||
| 1094 | ;; default composition | ||
| 1095 | (list (car (cdr (cdr o-glyph))) (car o-glyph)) | ||
| 1096 | ;; composition with a specified rule | ||
| 1097 | (list '(mr . ml) (car o-glyph))))) | ||
| 1098 | (setq o-glyph-list (cdr o-glyph-list)) | ||
| 1099 | (setq cmp-glyph-list (append cmp-glyph-list glyph)))) | ||
| 1100 | ;; Convert glyphs to 1-column width if possible. | ||
| 1101 | (devanagari-wide-to-narrow cmp-glyph-list))) | ||
| 1102 | |||
| 1103 | ;; Utility function for Phase 2.5 | ||
| 1104 | |||
| 1105 | ;; Check whether GLYPH is a Devanagari vertical modifier or not. | ||
| 1106 | ;; If it is a vertical modifier, whether it should be 1-column shape or not | ||
| 1107 | ;; depends on previous non-vertical modifier. | ||
| 1108 | (defun devanagari-vertical-modifier-p (glyph) | ||
| 1109 | (string-match (char-to-string glyph) | ||
| 1110 | "[$(5!"!]!^!_!`!a!b!c!h!i"p"q"r#K#L#M(B]")) | ||
| 1111 | |||
| 1112 | (defun devanagari-non-vertical-modifier-p (glyph) | ||
| 1113 | (string-match (char-to-string glyph) | ||
| 1114 | ; "[$(5!Z![!\!d!e!f!g(B]")) | ||
| 1115 | "[$(5![(B]")) | ||
| 1116 | |||
| 1117 | (defun devanagari-wide-to-narrow-char (char) | ||
| 1118 | "Convert Devanagari character CHAR to the corresponding narrow character. | ||
| 1119 | If there's no corresponding narrow character, return CHAR as is." | ||
| 1120 | (let ((narrow (cdr (assq char devanagari-1-column-char)))) | ||
| 1121 | (or narrow char))) | ||
| 1122 | |||
| 1123 | ;; | ||
| 1124 | ;; Phase 2.5 Convert appropriate character to 1-column shape. | ||
| 1125 | ;; | ||
| 1126 | ;; This is temporary and should be removed out when Emacs supports | ||
| 1127 | ;; variable width characters. | ||
| 1128 | ;; | ||
| 1129 | ;; This will convert the composing glyphs (2 column glyphs) | ||
| 1130 | ;; to narrow (1 column) glyphs if they exist. | ||
| 1131 | ;; | ||
| 1132 | ;; devanagari-wide-to-narrow-old converts glyphs simply. | ||
| 1133 | ;; devanagari-wide-to-narrow takes care of upper/lower apply-glyphs | ||
| 1134 | ;; with 2 column base-glyph. | ||
| 1135 | ;; | ||
| 1136 | ;; Execution Examples | ||
| 1137 | ;;(devanagari-wide-to-narrow '(?$(5!3(B (ml . ml) ?$(5!a(B)) | ||
| 1138 | ;;(devanagari-wide-to-narrow '(?$(5!F(B (ml . ml) ?$(5!a(B)) | ||
| 1139 | |||
| 1140 | (defun devanagari-wide-to-narrow (src-list) | ||
| 1141 | (devanagari-wide-to-narrow-iter src-list t)) | ||
| 1142 | |||
| 1143 | (defun devanagari-wide-to-narrow-iter (src-list 2-col-glyph) | ||
| 1144 | (let ((glyph (car src-list))) | ||
| 1145 | (cond ((null src-list) '()) | ||
| 1146 | ; not glyph code | ||
| 1147 | ((not (numberp glyph)) | ||
| 1148 | (cons glyph | ||
| 1149 | (devanagari-wide-to-narrow-iter (cdr src-list) 2-col-glyph))) | ||
| 1150 | ; glyphs to be processed regardless of the value of "2-col-glyph" | ||
| 1151 | ((devanagari-non-vertical-modifier-p glyph) | ||
| 1152 | (cons (devanagari-wide-to-narrow-char glyph) | ||
| 1153 | (devanagari-wide-to-narrow-iter (cdr src-list) 2-col-glyph))) | ||
| 1154 | ; glyphs which are depends on the value of "2-col-glyph" | ||
| 1155 | ((devanagari-vertical-modifier-p glyph) | ||
| 1156 | (if 2-col-glyph | ||
| 1157 | (cons glyph | ||
| 1158 | (devanagari-wide-to-narrow-iter (cdr src-list) t)) | ||
| 1159 | (cons (devanagari-wide-to-narrow-char glyph) | ||
| 1160 | (devanagari-wide-to-narrow-iter (cdr src-list) | ||
| 1161 | 2-col-glyph)))) | ||
| 1162 | ; normal glyph | ||
| 1163 | (t | ||
| 1164 | (if (cdr (assq glyph devanagari-1-column-char)) | ||
| 1165 | (cons (devanagari-wide-to-narrow-char glyph) | ||
| 1166 | (devanagari-wide-to-narrow-iter (cdr src-list) nil)) | ||
| 1167 | (cons glyph | ||
| 1168 | (devanagari-wide-to-narrow-iter (cdr src-list) t))))))) | ||
| 1169 | |||
| 1170 | |||
| 1171 | ;; | ||
| 1172 | ;; Summary | ||
| 1173 | ;; | ||
| 1174 | |||
| 1175 | ;; | ||
| 1176 | ;; Decomposition of composite sequence. | ||
| 1177 | ;; | ||
| 1178 | |||
| 1179 | ;;;###autoload | ||
| 1180 | (defun devanagari-decompose-string (str) | ||
| 1181 | "Decompose Devanagari string STR" | ||
| 1182 | (decompose-string (copy-sequence str))) | ||
| 1183 | |||
| 1184 | ;;;###autoload | ||
| 1185 | (defun devanagari-decompose-region (from to) | ||
| 1186 | (interactive "r") | ||
| 1187 | (decompose-region from to)) | ||
| 1188 | |||
| 1189 | ;;; | ||
| 1190 | ;;; Composition | ||
| 1191 | ;;; | ||
| 1192 | |||
| 1193 | ;;;###autoload | ||
| 1194 | (defun devanagari-compose-string (str &rest langs) | ||
| 1195 | (setq str (copy-sequence str)) | ||
| 1196 | (let ((idx 0) | ||
| 1197 | rest match-b match-e) | ||
| 1198 | (while (string-match devanagari-composite-glyph-unit str idx) | ||
| 1199 | (let* ((match-b (match-beginning 0)) | ||
| 1200 | (match-e (match-end 0)) | ||
| 1201 | (cmps (devanagari-composition-component | ||
| 1202 | (apply | ||
| 1203 | 'char-to-glyph-devanagari | ||
| 1204 | (cons (substring str match-b match-e) langs))))) | ||
| 1205 | (compose-string str match-b match-e cmps) | ||
| 1206 | (setq idx match-e)))) | ||
| 1207 | str) | ||
| 1208 | |||
| 1209 | ;;;###autoload | ||
| 1210 | (defun devanagari-compose-region (from to &rest langs) | ||
| 1211 | (interactive "r") | ||
| 1212 | (save-excursion | ||
| 1213 | (save-restriction | ||
| 1214 | (narrow-to-region from to) | ||
| 1215 | (goto-char (point-min)) | ||
| 1216 | (while (re-search-forward devanagari-composite-glyph-unit nil t) | ||
| 1217 | (let* ((match-b (match-beginning 0)) (match-e (match-end 0)) | ||
| 1218 | (cmps (devanagari-composition-component | ||
| 1219 | (apply | ||
| 1220 | 'char-to-glyph-devanagari | ||
| 1221 | (cons (buffer-substring match-b match-e) langs))))) | ||
| 1222 | (compose-region match-b match-e cmps)))))) | ||
| 1223 | |||
| 1224 | ;; For pre-write and post-read conversion | ||
| 1225 | |||
| 1226 | ;;;###autoload | ||
| 1227 | (defun devanagari-compose-from-is13194-region (from to) | ||
| 1228 | "Compose IS 13194 characters in the region to Devanagari characters." | ||
| 1229 | (interactive "r") | ||
| 1230 | (save-excursion | ||
| 1231 | (save-restriction | ||
| 1232 | (narrow-to-region from to) | ||
| 1233 | (indian-to-devanagari-region (point-min) (point-max)) | ||
| 1234 | (devanagari-compose-region (point-min) (point-max)) | ||
| 1235 | (- (point-max) (point-min))))) | ||
| 1236 | |||
| 1237 | ;;;###autoload | ||
| 1238 | (defun in-is13194-devanagari-post-read-conversion (len) | ||
| 1239 | (let ((pos (point))) | ||
| 1240 | (devanagari-compose-from-is13194-region pos (+ pos len)))) | ||
| 1241 | |||
| 1242 | ;;;###autoload | ||
| 1243 | (defun devanagari-decompose-to-is13194-region (from to) | ||
| 1244 | "Decompose Devanagari characters in the region to IS 13194 characters." | ||
| 1245 | (interactive "r") | ||
| 1246 | (save-excursion | ||
| 1247 | (save-restriction | ||
| 1248 | (narrow-to-region from to) | ||
| 1249 | (devanagari-decompose-region (point-min) (point-max)) | ||
| 1250 | (devanagari-to-indian-region (point-min) (point-max))))) | ||
| 1251 | |||
| 1252 | ;;;###autoload | ||
| 1253 | (defun in-is13194-devanagari-pre-write-conversion (from to) | ||
| 1254 | (let ((old-buf (current-buffer))) | ||
| 1255 | (set-buffer (generate-new-buffer " *temp*")) | ||
| 1256 | (if (stringp from) | ||
| 1257 | (insert from) | ||
| 1258 | (insert-buffer-substring old-buf from to)) | ||
| 1259 | (devanagari-decompose-to-is13194-region (point-min) (point-max)) | ||
| 1260 | ;; Should return nil as annotations. | ||
| 1261 | nil)) | ||
| 1262 | |||
| 1263 | ;; For input/output of ITRANS | ||
| 1264 | |||
| 1265 | ;;;###autoload | ||
| 1266 | (defun devanagari-encode-itrans-region (from to) | ||
| 1267 | (interactive "r") | ||
| 1268 | (save-restriction | ||
| 1269 | (narrow-to-region from to) | ||
| 1270 | (devanagari-decompose-to-is13194-region (point-min) (point-max)) | ||
| 1271 | (indian-encode-itrans-region (point-min) (point-max)))) | ||
| 1272 | |||
| 1273 | ;;;###autoload | ||
| 1274 | (defun devanagari-decode-itrans-region (from to) | ||
| 1275 | (interactive "r") | ||
| 1276 | (save-restriction | ||
| 1277 | (narrow-to-region from to) | ||
| 1278 | (indian-decode-itrans-region (point-min) (point-max)) | ||
| 1279 | (devanagari-compose-from-is13194-region (point-min) (point-max)))) | ||
| 1280 | |||
| 1281 | ;; | ||
| 1282 | (provide 'devan-util) | 637 | (provide 'devan-util) |
| 1283 | |||
| 1284 | ;; Local Variables: | ||
| 1285 | ;; coding: iso-2022-7bit | ||
| 1286 | ;; End: | ||
| 1287 | |||
| 1288 | ;;; devan-util.el ends here | ||
diff --git a/lisp/language/devanagari.el b/lisp/language/devanagari.el index e0f3e783b0a..0d9c62c2cc6 100644 --- a/lisp/language/devanagari.el +++ b/lisp/language/devanagari.el | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | ;;; devanagari.el --- support for Devanagari -*- coding: iso-2022-7bit; -*- | 1 | ;;; devanagari.el --- Support for Devanagari -*- coding: iso-2022-7bit; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996, 2001 Free Software Foundation, Inc. |
| 4 | |||
| 5 | ;; Author: KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | ||
| 6 | 4 | ||
| 5 | ;; Maintainer: KAWABATA, Taichi <batta@beige.ocn.ne.jp> | ||
| 7 | ;; Keywords: multilingual, Indian, Devanagari | 6 | ;; Keywords: multilingual, Indian, Devanagari |
| 8 | 7 | ||
| 9 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| @@ -25,481 +24,24 @@ | |||
| 25 | 24 | ||
| 26 | ;;; Commentary: | 25 | ;;; Commentary: |
| 27 | 26 | ||
| 28 | ;; History: | 27 | ;; This file defines language-info of Devanagari script, and provides |
| 29 | ;; 1996.10.18 written by KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | 28 | ;; compatibility support of old implementation of Devanagari script. |
| 30 | ;; 1997.1.20 fixed some bugs. | ||
| 31 | 29 | ||
| 32 | ;;; Code: | 30 | ;;; Code: |
| 33 | 31 | ||
| 34 | (make-coding-system | ||
| 35 | 'in-is13194-devanagari 2 ?D | ||
| 36 | "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)" | ||
| 37 | '(ascii indian-is13194 nil nil | ||
| 38 | nil ascii-eol) | ||
| 39 | '((safe-charsets ascii indian-is13194) | ||
| 40 | (post-read-conversion . in-is13194-devanagari-post-read-conversion) | ||
| 41 | (pre-write-conversion . in-is13194-devanagari-pre-write-conversion))) | ||
| 42 | |||
| 43 | (define-coding-system-alias 'devanagari 'in-is13194-devanagari) | ||
| 44 | |||
| 45 | (set-language-info-alist | 32 | (set-language-info-alist |
| 46 | "Devanagari" '((charset indian-is13194 indian-2-column indian-1-column) | 33 | "Devanagari" '((charset indian-is13194 mule-unicode-0100-24ff |
| 47 | (coding-system in-is13194-devanagari) | 34 | indian-2-column indian-glyph ;; comment out later |
| 48 | (coding-priority in-is13194-devanagari) | 35 | ) |
| 49 | (input-method . "devanagari-itrans") | 36 | (coding-system in-is13194) |
| 37 | (coding-priority in-is13194) | ||
| 38 | (input-method . "dev-aiba") | ||
| 50 | (features devan-util) | 39 | (features devan-util) |
| 51 | (documentation . "\ | 40 | (documentation . "\ |
| 52 | Such languages using Devanagari script as Hindi and Marathi | 41 | Such languages using Devanagari script as Hindi and Marathi |
| 53 | are supported in this language environment.")) | 42 | are supported in this language environment.")) |
| 54 | '("Indian")) | 43 | '("Indian")) |
| 55 | 44 | ||
| 56 | ;; | ||
| 57 | ;; Devanagari Glyph List | ||
| 58 | ;; | ||
| 59 | ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f | ||
| 60 | ;;2120 $(5!!!"!#!$!%!&!'!(!)!*!+!,!-!.!/(B | ||
| 61 | ;;2130 $(5!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?(B | ||
| 62 | ;;2140 $(5!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O(B | ||
| 63 | ;;2150 $(5!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_(B | ||
| 64 | ;;2160 $(5!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o(B | ||
| 65 | ;;2170 $(5!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~(B | ||
| 66 | ;; | ||
| 67 | ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f | ||
| 68 | ;;2220 $(5"!"""#"$"%"&"'"(")"*"+","-"."/(B | ||
| 69 | ;;2230 $(5"0"1"2"3"4"5"6"7"8"9":";"<"=">"?(B | ||
| 70 | ;;2240 $(5"@"A"B"C"D"E"F"G"H"I"J"K"L"M"N"O(B | ||
| 71 | ;;2250 $(5"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_(B | ||
| 72 | ;;2260 $(5"`"a"b"c"d"e"f"g"h"i"j"k"l"m"n"o(B | ||
| 73 | ;;2270 $(5"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~(B | ||
| 74 | ;; | ||
| 75 | ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f | ||
| 76 | ;;2320 $(5#!#"###$#%#&#'#(#)#*#+#,#-#.#/(B | ||
| 77 | ;;2330 $(5#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?(B | ||
| 78 | ;;2340 $(5#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O(B | ||
| 79 | ;;2350 $(5#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_(B | ||
| 80 | ;;2360 $(5#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o(B | ||
| 81 | ;;2370 $(5#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~(B | ||
| 82 | ;; | ||
| 83 | ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f | ||
| 84 | ;;2420 $(5$!$"$#$$$%$&$'$($)$*$+$,$-$.$/(B | ||
| 85 | ;;2430 $(5$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?(B | ||
| 86 | ;;2440 $(5$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O(B | ||
| 87 | ;;2450 $(5$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_(B | ||
| 88 | ;;2460 $(5$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o(B | ||
| 89 | ;;2470 $(5$p$q$r$s$t$u$v$w$x$y$z${$|$}$~(B | ||
| 90 | ;; | ||
| 91 | ;; 0123456789abcdef | ||
| 92 | ;;2120 $(6!!!"!#!$!%!&!'!(!)!*!+!,!-!.!/(B | ||
| 93 | ;;2130 $(6!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?(B | ||
| 94 | ;;2140 $(6!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O(B | ||
| 95 | ;;2150 $(6!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_(B | ||
| 96 | ;;2160 $(6!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o(B | ||
| 97 | ;;2170 $(6!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~(B | ||
| 98 | ;; | ||
| 99 | ;; 0123456789abcdef | ||
| 100 | ;;2220 $(6"!"""#"$"%"&"'"(")"*"+","-"."/(B | ||
| 101 | ;;2230 $(6"0"1"2"3"4"5"6"7"8"9":";"<"=">"?(B | ||
| 102 | ;;2240 $(6"@"A"B"C"D"E"F"G"H"I"J"K"L"M"N"O(B | ||
| 103 | ;;2250 $(6"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_(B | ||
| 104 | ;;2260 $(6"`"a"b"c"d"e"f"g"h"i"j"k"l"m"n"o(B | ||
| 105 | ;;2270 $(6"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~(B | ||
| 106 | ;;2320 $(6#!#"###$#%#&#'#(#)#*#+#,#-#.#/(B | ||
| 107 | ;;2330 $(6#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?(B | ||
| 108 | ;;2340 $(6#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O(B | ||
| 109 | ;;2350 $(6#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_(B | ||
| 110 | ;;2360 $(6#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o(B | ||
| 111 | ;;2370 $(6#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~(B | ||
| 112 | ;; | ||
| 113 | ;; 0123456789abcdef | ||
| 114 | ;;2320 $(6$!$"$#$$$%$&$'$($)$*$+$,$-$.$/(B | ||
| 115 | ;;2430 $(6$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?(B | ||
| 116 | ;;2440 $(6$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O(B | ||
| 117 | ;;2450 $(6$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_(B | ||
| 118 | ;;2460 $(6$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o(B | ||
| 119 | ;;2470 $(6$p$q$r$s$t$u$v$w$x$y$z${$|$}$~(B | ||
| 120 | ;; | ||
| 121 | ;; | ||
| 122 | ;; Modify the following table if you change the set of 1-column font. | ||
| 123 | ;; | ||
| 124 | (defconst devanagari-1-column-char | ||
| 125 | '((?$(5!!(B . ?$(6!!(B) | ||
| 126 | (?$(5!"(B . ?$(6!"(B) | ||
| 127 | (?$(5!#(B . ?$(6!#(B) | ||
| 128 | (?$(5!$(B . nil) | ||
| 129 | (?$(5!%(B . nil) | ||
| 130 | (?$(5!&(B . ?$(6!&(B) | ||
| 131 | (?$(5!'(B . ?$(6!'(B) | ||
| 132 | (?$(5!((B . ?$(6!((B) | ||
| 133 | (?$(5!)(B . nil) | ||
| 134 | (?$(5!*(B . nil) | ||
| 135 | (?$(5!+(B . nil) | ||
| 136 | (?$(5!,(B . nil) | ||
| 137 | (?$(5!-(B . nil) | ||
| 138 | (?$(5!.(B . nil) | ||
| 139 | (?$(5!/(B . nil) | ||
| 140 | (?$(5!0(B . nil) | ||
| 141 | (?$(5!1(B . nil) | ||
| 142 | (?$(5!2(B . nil) | ||
| 143 | (?$(5!3(B . nil) | ||
| 144 | (?$(5!4(B . nil) | ||
| 145 | (?$(5!5(B . ?$(6!5(B) | ||
| 146 | (?$(5!6(B . nil) | ||
| 147 | (?$(5!7(B . nil) | ||
| 148 | (?$(5!8(B . nil) | ||
| 149 | (?$(5!9(B . nil) | ||
| 150 | (?$(5!:(B . nil) | ||
| 151 | (?$(5!;(B . nil) | ||
| 152 | (?$(5!<(B . nil) | ||
| 153 | (?$(5!=(B . ?$(6!=(B) | ||
| 154 | (?$(5!>(B . ?$(6!>(B) | ||
| 155 | (?$(5!?(B . ?$(6!?(B) | ||
| 156 | (?$(5!@(B . ?$(6!@(B) | ||
| 157 | (?$(5!A(B . nil) | ||
| 158 | (?$(5!B(B . ?$(6!B(B) | ||
| 159 | (?$(5!C(B . ?$(6!C(B) | ||
| 160 | (?$(5!D(B . ?$(6!D(B) | ||
| 161 | (?$(5!E(B . ?$(6!E(B) | ||
| 162 | (?$(5!F(B . ?$(6!F(B) | ||
| 163 | (?$(5!G(B . ?$(6!G(B) | ||
| 164 | (?$(5!H(B . ?$(6!H(B) | ||
| 165 | (?$(5!I(B . nil) | ||
| 166 | (?$(5!J(B . ?$(6!J(B) | ||
| 167 | (?$(5!K(B . ?$(6!K(B) | ||
| 168 | (?$(5!L(B . ?$(6!L(B) | ||
| 169 | (?$(5!M(B . ?$(6!M(B) | ||
| 170 | (?$(5!N(B . ?$(6!N(B) | ||
| 171 | (?$(5!O(B . ?$(6!O(B) | ||
| 172 | (?$(5!P(B . ?$(6!P(B) | ||
| 173 | (?$(5!Q(B . nil) | ||
| 174 | (?$(5!R(B . nil) | ||
| 175 | (?$(5!S(B . nil) | ||
| 176 | (?$(5!T(B . ?$(6!T(B) | ||
| 177 | (?$(5!U(B . nil) | ||
| 178 | (?$(5!V(B . ?$(6!V(B) | ||
| 179 | (?$(5!W(B . ?$(6!W(B) | ||
| 180 | (?$(5!X(B . ?$(6!X(B) | ||
| 181 | (?$(5!Y(B . nil) | ||
| 182 | (?$(5!Z(B . ?$(6!Z(B) | ||
| 183 | (?$(5 | ||
| 186 | (?$(5!^(B . ?$(6!^(B) | ||
| 187 | (?$(5!_(B . ?$(6!_(B) | ||
| 188 | (?$(5!`(B . ?$(6!`(B) | ||
| 189 | (?$(5!a(B . ?$(6!a(B) | ||
| 190 | (?$(5!b(B . ?$(6!b(B) | ||
| 191 | (?$(5!c(B . ?$(6!c(B) | ||
| 192 | (?$(5!d(B . ?$(6!d(B) | ||
| 193 | (?$(5!e(B . ?$(6!e(B) | ||
| 194 | (?$(5!f(B . ?$(6!f(B) | ||
| 195 | (?$(5!g(B . ?$(6!g(B) | ||
| 196 | (?$(5!h(B . ?$(6!h(B) | ||
| 197 | (?$(5!i(B . ?$(6!i(B) | ||
| 198 | (?$(5!j(B . ?$(6!j(B) | ||
| 199 | (nil . nil) | ||
| 200 | (nil . nil) | ||
| 201 | (nil . nil) | ||
| 202 | (nil . nil) | ||
| 203 | (nil . nil) | ||
| 204 | (nil . nil) | ||
| 205 | (?$(5!q(B . ?$(6!q(B) | ||
| 206 | (?$(5!r(B . ?$(6!r(B) | ||
| 207 | (?$(5!s(B . ?$(6!s(B) | ||
| 208 | (?$(5!t(B . ?$(6!t(B) | ||
| 209 | (?$(5!u(B . ?$(6!u(B) | ||
| 210 | (?$(5!v(B . ?$(6!v(B) | ||
| 211 | (?$(5!w(B . ?$(6!w(B) | ||
| 212 | (?$(5!x(B . ?$(6!x(B) | ||
| 213 | (?$(5!y(B . ?$(6!y(B) | ||
| 214 | (?$(5!z(B . ?$(6!z(B) | ||
| 215 | (nil . nil) | ||
| 216 | (nil . nil) | ||
| 217 | (nil . nil) | ||
| 218 | (nil . nil) | ||
| 219 | (?$(5"!(B . nil) | ||
| 220 | (?$(5""(B . nil) | ||
| 221 | (?$(5"#(B . nil) | ||
| 222 | (?$(5"$(B . ?$(6"$(B) | ||
| 223 | (?$(5"%(B . ?$(6"%(B) | ||
| 224 | (?$(5"&(B . ?$(6"&(B) | ||
| 225 | (?$(5"'(B . nil) | ||
| 226 | (?$(5"((B . nil) | ||
| 227 | (?$(5")(B . nil) | ||
| 228 | (?$(5"*(B . nil) | ||
| 229 | (?$(5"+(B . nil) | ||
| 230 | (?$(5",(B . ?$(6",(B) | ||
| 231 | (?$(5"-(B . nil) | ||
| 232 | (?$(5".(B . ?$(6".(B) | ||
| 233 | (?$(5"/(B . nil) | ||
| 234 | (?$(5"0(B . nil) | ||
| 235 | (?$(5"1(B . nil) | ||
| 236 | (?$(5"2(B . nil) | ||
| 237 | (?$(5"3(B . ?$(6"3(B) | ||
| 238 | (?$(5"4(B . ?$(6"4(B) | ||
| 239 | (?$(5"5(B . ?$(6"5(B) | ||
| 240 | (?$(5"6(B . ?$(6"6(B) | ||
| 241 | (?$(5"7(B . nil) | ||
| 242 | (?$(5"8(B . ?$(6"8(B) | ||
| 243 | (?$(5"9(B . nil) | ||
| 244 | (?$(5":(B . ?$(6":(B) | ||
| 245 | (?$(5";(B . ?$(6";(B) | ||
| 246 | (?$(5"<(B . ?$(6"<(B) | ||
| 247 | (?$(5"=(B . nil) | ||
| 248 | (?$(5">(B . nil) | ||
| 249 | (?$(5"?(B . nil) | ||
| 250 | (?$(5"@(B . nil) | ||
| 251 | (?$(5"A(B . ?$(6"A(B) | ||
| 252 | (?$(5"B(B . ?$(6"B(B) | ||
| 253 | (?$(5"C(B . ?$(6"C(B) | ||
| 254 | (?$(5"D(B . nil) | ||
| 255 | (?$(5"E(B . ?$(6"E(B) | ||
| 256 | (?$(5"F(B . ?$(6"F(B) | ||
| 257 | (?$(5"G(B . ?$(6"G(B) | ||
| 258 | (?$(5"H(B . ?$(6"H(B) | ||
| 259 | (?$(5"I(B . ?$(6"I(B) | ||
| 260 | (?$(5"J(B . ?$(6"J(B) | ||
| 261 | (?$(5"K(B . ?$(6"K(B) | ||
| 262 | (?$(5"L(B . ?$(6"L(B) | ||
| 263 | (?$(5"M(B . ?$(6"M(B) | ||
| 264 | (?$(5"N(B . ?$(6"N(B) | ||
| 265 | (?$(5"O(B . nil) | ||
| 266 | (?$(5"P(B . nil) | ||
| 267 | (?$(5"Q(B . ?$(6"Q(B) | ||
| 268 | (?$(5"R(B . nil) | ||
| 269 | (?$(5"S(B . nil) | ||
| 270 | (?$(5"T(B . ?$(6"T(B) | ||
| 271 | (?$(5"U(B . ?$(6"U(B) | ||
| 272 | (?$(5"V(B . ?$(6"V(B) | ||
| 273 | (?$(5"W(B . ?$(6"W(B) | ||
| 274 | (?$(5"X(B . nil) | ||
| 275 | (?$(5"Y(B . nil) | ||
| 276 | (?$(5"Z(B . nil) | ||
| 277 | (?$(5"[(B . nil) | ||
| 278 | (?$(5"\(B . nil) | ||
| 279 | (?$(5"](B . ?$(6"](B) | ||
| 280 | (?$(5"^(B . nil) | ||
| 281 | (?$(5"_(B . nil) | ||
| 282 | (?$(5"`(B . ?$(6"`(B) | ||
| 283 | (?$(5"a(B . ?$(6"a(B) | ||
| 284 | (?$(5"b(B . ?$(6"b(B) | ||
| 285 | (?$(5"c(B . ?$(6"c(B) | ||
| 286 | (?$(5"d(B . ?$(6"d(B) | ||
| 287 | (?$(5"e(B . ?$(6"e(B) | ||
| 288 | (?$(5"f(B . ?$(6"f(B) | ||
| 289 | (?$(5"g(B . ?$(6"g(B) | ||
| 290 | (?$(5"h(B . ?$(6"h(B) | ||
| 291 | (?$(5"i(B . ?$(6"i(B) | ||
| 292 | (?$(5"j(B . ?$(6"j(B) | ||
| 293 | (?$(5"k(B . ?$(6"k(B) | ||
| 294 | (?$(5"l(B . ?$(6"l(B) | ||
| 295 | (?$(5"m(B . ?$(6"m(B) | ||
| 296 | (?$(5"n(B . nil) | ||
| 297 | (?$(5"o(B . nil) | ||
| 298 | (?$(5"p(B . ?$(6"p(B) | ||
| 299 | (?$(5"q(B . ?$(6"q(B) | ||
| 300 | (?$(5"r(B . ?$(6"r(B) | ||
| 301 | (?$(5"s(B . ?$(6"s(B) | ||
| 302 | (?$(5"t(B . ?$(6"t(B) | ||
| 303 | (?$(5"u(B . ?$(6"u(B) | ||
| 304 | (?$(5"v(B . nil) | ||
| 305 | (?$(5"w(B . nil) | ||
| 306 | (?$(5"x(B . nil) | ||
| 307 | (?$(5"y(B . ?$(6"y(B) | ||
| 308 | (?$(5"z(B . ?$(6"z(B) | ||
| 309 | (?$(5"{(B . nil) | ||
| 310 | (?$(5"|(B . nil) | ||
| 311 | (?$(5"}(B . nil) | ||
| 312 | (?$(5"~(B . nil) | ||
| 313 | (?$(5#!(B . nil) | ||
| 314 | (?$(5#"(B . nil) | ||
| 315 | (?$(5##(B . nil) | ||
| 316 | (?$(5#$(B . nil) | ||
| 317 | (?$(5#%(B . nil) | ||
| 318 | (?$(5#&(B . nil) | ||
| 319 | (?$(5#'(B . nil) | ||
| 320 | (?$(5#((B . nil) | ||
| 321 | (?$(5#)(B . nil) | ||
| 322 | (?$(5#*(B . nil) | ||
| 323 | (?$(5#+(B . nil) | ||
| 324 | (?$(5#,(B . nil) | ||
| 325 | (?$(5#-(B . nil) | ||
| 326 | (?$(5#.(B . nil) | ||
| 327 | (?$(5#/(B . nil) | ||
| 328 | (?$(5#0(B . nil) | ||
| 329 | (?$(5#1(B . nil) | ||
| 330 | (?$(5#2(B . nil) | ||
| 331 | (?$(5#3(B . nil) | ||
| 332 | (?$(5#4(B . nil) | ||
| 333 | (?$(5#5(B . ?$(6#5(B) | ||
| 334 | (?$(5#6(B . nil) | ||
| 335 | (?$(5#7(B . nil) | ||
| 336 | (?$(5#8(B . nil) | ||
| 337 | (?$(5#9(B . nil) | ||
| 338 | (?$(5#:(B . nil) | ||
| 339 | (?$(5#;(B . nil) | ||
| 340 | (?$(5#<(B . nil) | ||
| 341 | (?$(5#=(B . nil) | ||
| 342 | (?$(5#>(B . nil) | ||
| 343 | (?$(5#?(B . ?$(6#?(B) | ||
| 344 | (?$(5#@(B . ?$(6#@(B) | ||
| 345 | (?$(5#A(B . nil) | ||
| 346 | (?$(5#B(B . nil) | ||
| 347 | (?$(5#C(B . nil) | ||
| 348 | (?$(5#D(B . nil) | ||
| 349 | (?$(5#E(B . nil) | ||
| 350 | (?$(5#F(B . nil) | ||
| 351 | (?$(5#G(B . nil) | ||
| 352 | (?$(5#H(B . nil) | ||
| 353 | (?$(5#I(B . nil) | ||
| 354 | (?$(5#J(B . ?$(6#J(B) | ||
| 355 | (?$(5#K(B . ?$(6#K(B) | ||
| 356 | (?$(5#L(B . ?$(6#L(B) | ||
| 357 | (?$(5#M(B . ?$(6#M(B) | ||
| 358 | (?$(5#N(B . nil) | ||
| 359 | (?$(5#O(B . nil) | ||
| 360 | (?$(5#P(B . nil) | ||
| 361 | (?$(5#Q(B . nil) | ||
| 362 | (?$(5#R(B . ?$(6#R(B) | ||
| 363 | (?$(5#S(B . nil) | ||
| 364 | (?$(5#T(B . nil) | ||
| 365 | (?$(5#U(B . nil) | ||
| 366 | (?$(5#V(B . nil) | ||
| 367 | (?$(5#W(B . nil) | ||
| 368 | (?$(5#X(B . nil) | ||
| 369 | (?$(5#Y(B . nil) | ||
| 370 | (?$(5#Z(B . nil) | ||
| 371 | (?$(5#[(B . nil) | ||
| 372 | (?$(5#\(B . nil) | ||
| 373 | (?$(5#](B . nil) | ||
| 374 | (?$(5#^(B . nil) | ||
| 375 | (?$(5#_(B . nil) | ||
| 376 | (?$(5#`(B . nil) | ||
| 377 | (?$(5#a(B . ?$(6#a(B) | ||
| 378 | (?$(5#b(B . ?$(6#b(B) | ||
| 379 | (?$(5#c(B . nil) | ||
| 380 | (?$(5#d(B . nil) | ||
| 381 | (?$(5#e(B . nil) | ||
| 382 | (?$(5#f(B . nil) | ||
| 383 | (?$(5#g(B . nil) | ||
| 384 | (?$(5#h(B . nil) | ||
| 385 | (?$(5#i(B . nil) | ||
| 386 | (?$(5#j(B . ?$(6#j(B) | ||
| 387 | (?$(5#k(B . ?$(6#k(B) | ||
| 388 | (?$(5#l(B . ?$(6#l(B) | ||
| 389 | (?$(5#m(B . nil) | ||
| 390 | (?$(5#n(B . nil) | ||
| 391 | (?$(5#o(B . nil) | ||
| 392 | (?$(5#p(B . nil) | ||
| 393 | (?$(5#q(B . nil) | ||
| 394 | (?$(5#r(B . nil) | ||
| 395 | (?$(5#s(B . nil) | ||
| 396 | (?$(5#t(B . nil) | ||
| 397 | (?$(5#u(B . nil) | ||
| 398 | (?$(5#v(B . nil) | ||
| 399 | (?$(5#w(B . nil) | ||
| 400 | (?$(5#x(B . nil) | ||
| 401 | (?$(5#y(B . nil) | ||
| 402 | (?$(5#z(B . nil) | ||
| 403 | (?$(5#{(B . nil) | ||
| 404 | (?$(5#|(B . nil) | ||
| 405 | (?$(5#}(B . nil) | ||
| 406 | (?$(5#~(B . nil) | ||
| 407 | (?$(5$!(B . nil) | ||
| 408 | (?$(5$"(B . nil) | ||
| 409 | (?$(5$#(B . nil) | ||
| 410 | (?$(5$$(B . nil) | ||
| 411 | (?$(5$%(B . nil) | ||
| 412 | (?$(5$&(B . nil) | ||
| 413 | (?$(5$'(B . nil) | ||
| 414 | (?$(5$((B . nil) | ||
| 415 | (?$(5$)(B . nil) | ||
| 416 | (?$(5$*(B . nil) | ||
| 417 | (?$(5$+(B . nil) | ||
| 418 | (?$(5$,(B . nil) | ||
| 419 | (?$(5$-(B . nil) | ||
| 420 | (?$(5$.(B . nil) | ||
| 421 | (?$(5$/(B . nil) | ||
| 422 | (?$(5$0(B . nil) | ||
| 423 | (?$(5$1(B . nil) | ||
| 424 | (?$(5$2(B . nil) | ||
| 425 | (?$(5$3(B . nil) | ||
| 426 | (?$(5$4(B . nil) | ||
| 427 | (?$(5$5(B . nil) | ||
| 428 | (?$(5$6(B . nil) | ||
| 429 | (?$(5$7(B . nil) | ||
| 430 | (?$(5$8(B . nil) | ||
| 431 | (?$(5$9(B . nil) | ||
| 432 | (?$(5$:(B . nil) | ||
| 433 | (?$(5$;(B . nil) | ||
| 434 | (?$(5$<(B . nil) | ||
| 435 | (?$(5$=(B . nil) | ||
| 436 | (?$(5$>(B . nil) | ||
| 437 | (?$(5$?(B . nil) | ||
| 438 | (?$(5$@(B . nil) | ||
| 439 | (?$(5$A(B . ?$(6$A(B) | ||
| 440 | (?$(5$B(B . nil) | ||
| 441 | (?$(5$C(B . nil) | ||
| 442 | (?$(5$D(B . nil) | ||
| 443 | (?$(5$E(B . ?$(6$E(B) | ||
| 444 | (?$(5$F(B . nil) | ||
| 445 | (?$(5$G(B . nil) | ||
| 446 | (?$(5$H(B . ?$(6$H(B) | ||
| 447 | (?$(5$I(B . ?$(6$I(B) | ||
| 448 | (?$(5$J(B . ?$(6$J(B) | ||
| 449 | (?$(5$K(B . nil) | ||
| 450 | (?$(5$L(B . nil) | ||
| 451 | (?$(5$M(B . nil) | ||
| 452 | (?$(5$N(B . ?$(6$N(B) | ||
| 453 | (?$(5$O(B . nil) | ||
| 454 | (?$(5$P(B . ?$(6$P(B) | ||
| 455 | (?$(5$Q(B . ?$(6$Q(B) | ||
| 456 | (?$(5$R(B . ?$(6$R(B) | ||
| 457 | (?$(5$S(B . nil) | ||
| 458 | (?$(5$T(B . nil) | ||
| 459 | (?$(5$U(B . nil) | ||
| 460 | (?$(5$V(B . nil) | ||
| 461 | (?$(5$W(B . nil) | ||
| 462 | (?$(5$X(B . nil) | ||
| 463 | (?$(5$Y(B . nil) | ||
| 464 | (?$(5$Z(B . nil) | ||
| 465 | (?$(5$[(B . nil) | ||
| 466 | (?$(5$\(B . nil) | ||
| 467 | (?$(5$](B . nil) | ||
| 468 | (?$(5$^(B . nil) | ||
| 469 | (?$(5$_(B . nil) | ||
| 470 | (?$(5$`(B . nil) | ||
| 471 | (?$(5$a(B . nil) | ||
| 472 | (?$(5$b(B . nil) | ||
| 473 | (?$(5$c(B . nil) | ||
| 474 | (?$(5$d(B . nil) | ||
| 475 | (?$(5$e(B . nil) | ||
| 476 | (?$(5$f(B . nil) | ||
| 477 | (?$(5$g(B . nil) | ||
| 478 | (?$(5$h(B . ?$(6$h(B) | ||
| 479 | (?$(5$i(B . ?$(6$i(B) | ||
| 480 | (?$(5$j(B . ?$(6$j(B) | ||
| 481 | (?$(5$k(B . nil) | ||
| 482 | (?$(5$l(B . ?$(6$l(B) | ||
| 483 | (?$(5$m(B . ?$(6$m(B) | ||
| 484 | (?$(5$n(B . ?$(6$n(B) | ||
| 485 | (?$(5$o(B . nil) | ||
| 486 | (?$(5$p(B . ?$(6$p(B) | ||
| 487 | (?$(5$q(B . ?$(6$q(B) | ||
| 488 | (?$(5$r(B . ?$(6$r(B) | ||
| 489 | (?$(5$s(B . nil) | ||
| 490 | (?$(5$t(B . nil) | ||
| 491 | (?$(5$u(B . ?$(6$u(B) | ||
| 492 | (?$(5$v(B . ?$(6$v(B) | ||
| 493 | (?$(5$w(B . nil) | ||
| 494 | (?$(5$x(B . ?$(6$x(B) | ||
| 495 | (?$(5$y(B . ?$(6$y(B) | ||
| 496 | (?$(5$z(B . nil) | ||
| 497 | (?$(5${(B . nil) | ||
| 498 | (?$(5$|(B . nil) | ||
| 499 | (?$(5$}(B . nil) | ||
| 500 | (?$(5$~(B . nil) | ||
| 501 | )) | ||
| 502 | |||
| 503 | (provide 'devanagari) | 45 | (provide 'devanagari) |
| 504 | 46 | ||
| 505 | ;;; devanagari.el ends here | 47 | ;;; devanagari.el ends here |
diff --git a/lisp/language/indian.el b/lisp/language/indian.el index 617c20123be..28d313215db 100644 --- a/lisp/language/indian.el +++ b/lisp/language/indian.el | |||
| @@ -1,10 +1,9 @@ | |||
| 1 | ;;; indian.el --- support for Indian Languages -*- coding: iso-2022-7bit; -*- | 1 | ;;; indian.el --- Indian languages support -*- coding: iso-2022-7bit; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | 5 | ;; Maintainer: KAWABATA, Taichi <batta@beige.ocn.ne.jp> |
| 6 | 6 | ;; Keywords: multilingual, Indian | |
| 7 | ;; Keywords: multilingual, Indian | ||
| 8 | 7 | ||
| 9 | ;; This file is part of GNU Emacs. | 8 | ;; This file is part of GNU Emacs. |
| 10 | 9 | ||
| @@ -25,290 +24,95 @@ | |||
| 25 | 24 | ||
| 26 | ;;; Commentary: | 25 | ;;; Commentary: |
| 27 | 26 | ||
| 28 | ;; History: | 27 | ;; This file defines in-is13194 coding system and relationship between |
| 29 | ;; 1996.10.18 written by KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> | 28 | ;; indian-glyph character-set and various CDAC fonts. |
| 30 | |||
| 31 | ;; For Indian, the character set IS 13194 is supported. | ||
| 32 | ;; | ||
| 33 | ;; IS 13194 does not specifically assign glyphs for each characters. | ||
| 34 | ;; Following code is not specific to each Indian language. | ||
| 35 | ;; | ||
| 36 | ;; Eventually, this code will support generic information about | ||
| 37 | ;; following scripts. | ||
| 38 | ;; | ||
| 39 | ;; Devanagari | ||
| 40 | ;; Bengali | ||
| 41 | ;; Gurmukhi | ||
| 42 | ;; Gujarati | ||
| 43 | ;; Oriya | ||
| 44 | ;; Tamil | ||
| 45 | ;; Telgu | ||
| 46 | ;; Kannada | ||
| 47 | ;; Malayalam | ||
| 48 | ;; | ||
| 49 | ;; In this file, charsets other than charset-ascii and charset-indian-is13194 | ||
| 50 | ;; should not be used except in the comment. | ||
| 51 | 29 | ||
| 52 | ;;; Code: | 30 | ;;; Code: |
| 53 | 31 | ||
| 54 | ;; Followings are what you see when you refer to the Emacs | 32 | (make-coding-system |
| 55 | ;; representations of IS 13194 charcters. However, this is merely | 33 | 'in-is13194 2 ?D |
| 56 | ;; tentative apperance, and you must convert them by | 34 | "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)" |
| 57 | ;; indian-to-xxxxxx(specific script) function to use them. | 35 | '(ascii indian-is13194 nil nil |
| 58 | ;; Devanagari is not an exception of this rule. | 36 | nil ascii-eol) |
| 59 | 37 | '((safe-charsets ascii indian-is13194) | |
| 60 | ;; 0xa0 //(5!"#$%&'()*+,-./(B | 38 | (post-read-conversion . in-is13194-post-read-conversion) |
| 61 | ;; 0xb0 (50123456789:;<=>?(B | 39 | (pre-write-conversion . in-is13194-pre-write-conversion))) |
| 62 | ;; 0xc0 (5@ABCDEFGHIJKLMNO(B | 40 | |
| 63 | ;; 0xd0 (5PQRSTUVWXYZ[\]^_(B | 41 | (defvar indian-script-table |
| 64 | ;; 0xe0 (5`abcdefghijklmno(B | 42 | '[ |
| 65 | ;; 0xf0 (5pqrstuvwxyz{|}~(B// | 43 | devanagari |
| 66 | 44 | sanskrit | |
| 67 | ;; Note - In IS 13194, several symbols are obtained by special | 45 | bengali |
| 68 | ;; combination of several characters and Nukta sign. | 46 | tamil |
| 69 | ;; | 47 | telugu |
| 70 | ;; Sanskrit Vowel R -> (5*(B + (5i(B | 48 | assamese |
| 71 | ;; Sanskrit Vowel L -> (5&(B + (5i(B | 49 | oriya |
| 72 | ;; Sanskrit Vowel LL -> (5'(B + (5i(B | 50 | kannada |
| 73 | ;; Sanskrit Avagrah -> (5j(B + (5i(B | 51 | malayalam |
| 74 | ;; OM -> (5!(B + (5i(B | 52 | gujarati |
| 75 | ;; | 53 | punjabi |
| 76 | ;; Note - IS 13194 defines ATR(0xEF) and EXT(0xF0), but they are | 54 | ] |
| 77 | ;; not used in Emacs. | 55 | "Vector of Indian script names.") |
| 78 | ;; | 56 | |
| 79 | ;; Note - the above characters DO NOT represent any script. For | 57 | (let ((len (length indian-script-table)) |
| 80 | ;; example, if you want to obtain Devanagari character, you must do | 58 | (i 0)) |
| 81 | ;; something like the following. | 59 | (while (< i len) |
| 82 | ;; | 60 | (put (aref indian-script-table i) 'indian-glyph-code-offset (* 256 i)) |
| 83 | ;; (char-to-string (indian-to-devanagari ?(5$(B)) | 61 | (setq i (1+ i)))) |
| 84 | ;; "$(5!$(B" | 62 | |
| 85 | 63 | (defvar indian-default-script 'devanagari | |
| 86 | ;;; ITRANS | 64 | "Default script for Indian languages. |
| 87 | ;; | 65 | Each Indian language environment sets this value |
| 88 | ;; ITRANS is one of the most popular method to exchange indian scripts | 66 | to one of `indian-script-table' (which see). |
| 89 | ;; electronically. Here is the table to convert between ITRANS code and | 67 | The default value is `devanagari'.") |
| 90 | ;; IS 13194 code. | 68 | |
| 91 | 69 | (defun indian-glyph-char (index &optional script) | |
| 92 | (defvar indian-itrans-consonant-alist | 70 | "Return character of charset `indian-glyph' made from glyph index INDEX. |
| 93 | '( | 71 | The variable `indian-default-script' specifies the script of the glyph. |
| 94 | ("k" . "(53(B") | 72 | Optional argument SCRIPT, if non-nil, overrides `indian-default-script'. |
| 95 | ("kh" . "(54(B") | 73 | See also the function `indian-char-glyph'." |
| 96 | ("g" . "(55(B") | 74 | (or script |
| 97 | ("gh" . "(56(B") | 75 | (setq script indian-default-script)) |
| 98 | ("N^" . "(57(B") | 76 | (let ((offset (get script 'indian-glyph-code-offset))) |
| 99 | ("ch" . "(58(B") | 77 | (or (integerp offset) |
| 100 | ("chh" . "(59(B") | 78 | (error "Invalid script name: %s" script)) |
| 101 | ("j" . "(5:(B") | 79 | (or (and (>= index 0) (< index 256)) |
| 102 | ("jh" . "(5;(B") | 80 | (error "Invalid glyph index: %d" index)) |
| 103 | ("JN" . "(5<(B") | 81 | (setq index (+ offset index)) |
| 104 | ("T" . "(5=(B") | 82 | (make-char 'indian-glyph (+ (/ index 96) 32) (+ (% index 96) 32)))) |
| 105 | ("Th" . "(5>(B") | 83 | |
| 106 | ("D" . "(5?(B") | 84 | (defvar indian-glyph-max-char |
| 107 | ("Dh" . "(5@(B") | 85 | (indian-glyph-char |
| 108 | ("N" . "(5A(B") | 86 | 255 (aref indian-script-table (1- (length indian-script-table)))) |
| 109 | ("t" . "(5B(B") | 87 | "The maximum valid code of characters in the charset `indian-glyph'") |
| 110 | ("th" . "(5C(B") | 88 | |
| 111 | ("d" . "(5D(B") | 89 | (defun indian-char-glyph (char) |
| 112 | ("dh" . "(5E(B") | 90 | "Return information about the glphy code for CHAR of `indian-glyph' charset. |
| 113 | ("n" . "(5F(B") | 91 | The value is (INDEX . SCRIPT), where INDEX is the glyph index |
| 114 | ("nh" . "(5G(B") ; For transcription of non-Devanagari Languages. | 92 | in the font that Indian script name SCRIPT specifies. |
| 115 | ("p" . "(5H(B") | 93 | See also the function `indian-glyph-char'." |
| 116 | ("ph" . "(5I(B") | 94 | (let ((split (split-char char)) |
| 117 | ("b" . "(5J(B") | 95 | code) |
| 118 | ("bh" . "(5K(B") | 96 | (or (eq (car split) 'indian-glyph) |
| 119 | ("m" . "(5L(B") | 97 | (error "Charset of `%c' is not indian-glyph" char)) |
| 120 | ("y" . "(5M(B") | 98 | (or (<= char indian-glyph-max-char) |
| 121 | ("yh" . "(5N(B") ; For transcription of non-Devanagari Languages. | 99 | (error "Invalid indian-glyph char: %d" char)) |
| 122 | ("r" . "(5O(B") | 100 | (setq code (+ (* (- (nth 1 split) 32) 96) (nth 2 split) -32)) |
| 123 | ("rh" . "(5P(B") ; For transcription of non-Devanagari Languages. | 101 | (cons (% code 256) (aref indian-script-table (/ code 256))))) |
| 124 | ("l" . "(5Q(B") | 102 | |
| 125 | ("v" . "(5T(B") | 103 | (define-ccl-program ccl-encode-indian-glyph-font |
| 126 | ("sh" . "(5U(B") | 104 | `(0 |
| 127 | ("shh" . "(5V(B") | 105 | ;; Shorten (r1 = (((((r1 - 32) * 96) + r2) - 32) % 256)) |
| 128 | ("s" . "(5W(B") | 106 | (r1 = ((((r1 * 96) + r2) - ,(+ (* 32 96) 32)) % 256)))) |
| 129 | ("h" . "(5X(B") | 107 | |
| 130 | ("ld" . "(5R(B") | 108 | (setq font-ccl-encoder-alist |
| 131 | ("L" . "(5R(B") | 109 | (cons (cons "-CDAC" 'ccl-encode-indian-glyph-font) |
| 132 | ("ksh" . "$(5!3!h!V(B") | 110 | font-ccl-encoder-alist)) |
| 133 | ("GY" . "***GY***") ; Must check out later. | 111 | |
| 134 | ;; special consonants | 112 | (setq font-ccl-encoder-alist |
| 135 | ("q" . "(53i(B") | 113 | (cons '("ISO10646.*-1" . ccl-encode-unicode-font) |
| 136 | ("K" . "(54i(B") | 114 | font-ccl-encoder-alist)) |
| 137 | ("G" . "(55i(B") | ||
| 138 | ("z" . "(5:i(B") | ||
| 139 | ("f" . "(5Ii(B") | ||
| 140 | (".D" . "(5?i(B") | ||
| 141 | (".Dh" . "(5@i(B") | ||
| 142 | )) | ||
| 143 | |||
| 144 | (defvar indian-itrans-vowel-sign-alist | ||
| 145 | '( | ||
| 146 | ;; Special treatment unique to IS 13194 Transliteration | ||
| 147 | ("" . "(5h(B") | ||
| 148 | ("a" . "") | ||
| 149 | ;; Matra (Vowel Sign) | ||
| 150 | ("aa" . "(5Z(B") | ||
| 151 | ("A" . "(5Z(B") | ||
| 152 | ("i" . "(5[(B") | ||
| 153 | ("ii" . "(5\(B") | ||
| 154 | ("I" . "(5\(B") | ||
| 155 | ("u" . "(5](B") | ||
| 156 | ("uu" . "(5^(B") | ||
| 157 | ("U" . "(5^(B") | ||
| 158 | ("R^i" . "(5_(B") ; These must be checked out later. | ||
| 159 | ("R^I" . "(5_i(B") | ||
| 160 | ("L^i" . "(5[i(B") | ||
| 161 | ("L^I" . "(5\i(B") | ||
| 162 | ("E" . "(5`(B") ; For transcription of non-Devanangri Languages. | ||
| 163 | ("e" . "(5a(B") | ||
| 164 | ("ai" . "(5b(B") | ||
| 165 | ;; ("e.c" . "(5c(B") ; Tentatively suppressed. | ||
| 166 | ("O" . "(5d(B") ; For transcription of non-Devanagari Languages. | ||
| 167 | ("o" . "(5e(B") | ||
| 168 | ("au" . "(5f(B") | ||
| 169 | ;; ("o.c" . "(5g(B") ; Tentatively suppressed. | ||
| 170 | )) | ||
| 171 | |||
| 172 | ;; | ||
| 173 | ;; Independent vowels and other signs. | ||
| 174 | ;; | ||
| 175 | |||
| 176 | (defvar indian-itrans-other-letters-alist | ||
| 177 | '( | ||
| 178 | ("a" . "(5$(B") | ||
| 179 | ("aa" . "(5%(B") | ||
| 180 | ("A" . "(5%(B") | ||
| 181 | ("i" . "(5&(B") | ||
| 182 | ("ii" . "(5'(B") | ||
| 183 | ("I" . "(5'(B") | ||
| 184 | ("u" . "(5((B") | ||
| 185 | ("uu" . "(5)(B") | ||
| 186 | ("U" . "(5)(B") | ||
| 187 | ("R^i" . "(5*(B") | ||
| 188 | ("R^I" . "(5*i(B") | ||
| 189 | ("L^i" . "(5&i(B") | ||
| 190 | ("L^I" . "(5'i(B") | ||
| 191 | ("E" . "(5+(B") ; For transcription of non-Devanagari Languages. | ||
| 192 | ("e" . "(5,(B") | ||
| 193 | ("ai" . "(5-(B") | ||
| 194 | ;; ("e.c" . "(5.(B") ; Candra E | ||
| 195 | ("O" . "(5/(B") ; For transcription of non-Devanagari Languages. | ||
| 196 | ("o" . "(50(B") | ||
| 197 | ("au" . "(51(B") | ||
| 198 | ;; ("o.c" . "(52(B") ; Candra O | ||
| 199 | ("M" . "(5$(B") | ||
| 200 | ("H" . "(5#(B") | ||
| 201 | ("AUM" . "(5!i(B") | ||
| 202 | ("OM" . "(5!i(B") | ||
| 203 | (".r" . "(5Oh(B") | ||
| 204 | (".n" . "(5"(B") | ||
| 205 | (".N" . "(5!(B") | ||
| 206 | (".h" . "(5h(B") ; Halant | ||
| 207 | (".." . "(5j(B") | ||
| 208 | (".a" . "(5ji(B") ; Avagrah | ||
| 209 | ("0" . "(5q(B") | ||
| 210 | ("1" . "(5r(B") | ||
| 211 | ("2" . "(5s(B") | ||
| 212 | ("3" . "(5t(B") | ||
| 213 | ("4" . "(5u(B") | ||
| 214 | ("5" . "(5v(B") | ||
| 215 | ("6" . "(5w(B") | ||
| 216 | ("7" . "(5x(B") | ||
| 217 | ("8" . "(5y(B") | ||
| 218 | ("9" . "(5z(B") | ||
| 219 | )) | ||
| 220 | |||
| 221 | ;; Regular expression matching single Indian character represented | ||
| 222 | ;; by ITRANS. | ||
| 223 | |||
| 224 | (defvar indian-itrans-regexp | ||
| 225 | (let ((consonant "\\([cs]hh?\\)\\|[kgjTDnpbyr]h?\\|\\(N\\^?\\)\\|\\(jN\\)\\|[mvqKGzfs]\\|\\(ld?\\)\\|\\(ksh\\)\\|\\(GY\\)\\|\\(\\.Dh?\\)") | ||
| 226 | (vowel "\\(a[aiu]\\)\\|\\(ii\\)\\|\\(uu\\)\\|\\([RL]\\^[iI]\\)\\|[AIEOeoaiu]") | ||
| 227 | (misc "[MH0-9]\\|\\(AUM\\)\\|\\(OM\\)\\|\\(\\.[rnNh\\.a]\\)") | ||
| 228 | (lpre "\\(") (rpre "\\)") (orre "\\|")) | ||
| 229 | (concat lpre misc rpre orre | ||
| 230 | lpre lpre consonant rpre "?" lpre vowel rpre rpre orre | ||
| 231 | lpre consonant rpre ))) | ||
| 232 | |||
| 233 | ;; | ||
| 234 | ;; Regular expression matching single ITRANS unit for IS 13194 characters. | ||
| 235 | ;; | ||
| 236 | |||
| 237 | (defvar itrans-indian-regexp | ||
| 238 | (let ((vowel "[(5$(B-(52(B]") | ||
| 239 | (consonant "[(53(B-(5X(B]") | ||
| 240 | (matra "[(5Z(B-(5g(B]") | ||
| 241 | (misc "[(5q(B-(5z(B]") | ||
| 242 | (lpre "\\(") (rpre "\\)") (orre "\\|")) | ||
| 243 | (concat misc orre | ||
| 244 | lpre consonant matra "?" rpre orre | ||
| 245 | vowel))) | ||
| 246 | |||
| 247 | ;; | ||
| 248 | ;; IS13194 - ITRANS conversion table for string matching above regexp. | ||
| 249 | ;; | ||
| 250 | |||
| 251 | (defvar indian-itrans-alist | ||
| 252 | (let ((cl indian-itrans-consonant-alist) | ||
| 253 | (ml indian-itrans-other-letters-alist) rules) | ||
| 254 | (while cl | ||
| 255 | (let ((vl indian-itrans-vowel-sign-alist)) | ||
| 256 | (while vl | ||
| 257 | (setq rules | ||
| 258 | (cons (cons (concat (car (car cl)) (car (car vl))) | ||
| 259 | (concat (cdr (car cl)) (cdr (car vl)))) | ||
| 260 | rules)) | ||
| 261 | (setq vl (cdr vl)))) | ||
| 262 | (setq cl (cdr cl))) | ||
| 263 | (while ml | ||
| 264 | (setq rules (cons (cons (car (car ml)) | ||
| 265 | (cdr (car ml))) | ||
| 266 | rules)) | ||
| 267 | (setq ml (cdr ml))) | ||
| 268 | rules)) | ||
| 269 | |||
| 270 | ;; | ||
| 271 | ;; Utility program to convert from ITRANS to IS 13194 in specified region. | ||
| 272 | ;; | ||
| 273 | |||
| 274 | (defun indian-decode-itrans-region (from to) | ||
| 275 | "Convert `ITRANS' mnemonics of the current region to Indian characters. | ||
| 276 | When called from a program, expects two arguments, | ||
| 277 | positions (integers or markers) specifying the stretch of the region." | ||
| 278 | (interactive "r") | ||
| 279 | (save-restriction | ||
| 280 | (narrow-to-region from to) | ||
| 281 | (goto-char (point-min)) | ||
| 282 | (while (re-search-forward indian-itrans-regexp nil t) | ||
| 283 | (let* ((itrans (buffer-substring (match-beginning 0) (match-end 0))) | ||
| 284 | (ch (cdr (assoc itrans indian-itrans-alist)))) | ||
| 285 | (if ch | ||
| 286 | (progn | ||
| 287 | (delete-region (match-beginning 0) (match-end 0)) | ||
| 288 | (insert ch))))) | ||
| 289 | (goto-char (point-min)) | ||
| 290 | (while (re-search-forward "\\((5h(B\\)[^\\c0]" nil t) | ||
| 291 | (delete-region (match-beginning 1) (match-end 1))))) | ||
| 292 | |||
| 293 | ;; | ||
| 294 | ;; Utility program to convert from IS 13194 to ITRANS in specified region. | ||
| 295 | ;; | ||
| 296 | |||
| 297 | (defun indian-encode-itrans-region (from to) | ||
| 298 | "Convert indian region to ITRANS mnemonics." | ||
| 299 | (interactive "r") | ||
| 300 | (save-restriction | ||
| 301 | (narrow-to-region from to) | ||
| 302 | (goto-char (point-min)) | ||
| 303 | (while (re-search-forward itrans-indian-regexp nil t) | ||
| 304 | (let* ((indian (buffer-substring (match-beginning 0) (match-end 0))) | ||
| 305 | (ch (car (rassoc indian indian-itrans-alist)))) | ||
| 306 | (if ch | ||
| 307 | (progn | ||
| 308 | (delete-region (match-beginning 0) (match-end 0)) | ||
| 309 | (insert ch))))) | ||
| 310 | (goto-char (point-min)))) | ||
| 311 | 115 | ||
| 312 | (provide 'indian) | 116 | (provide 'indian) |
| 313 | 117 | ||
| 314 | ;;; indian.el ends here | 118 | ;;; indian.el ends here |