comparison lisp/language/indian.el @ 97841:10312e057a97

Fix setting up of composition-function-table. (devanagari-composable-pattern) (tamil-composable-pattern, kannada-composable-pattern) (malayalam-composable-pattern): New variables.
author Kenichi Handa <handa@m17n.org>
date Fri, 29 Aug 2008 08:01:22 +0000
parents 55b7f25d920a
children a9dc0e7c3f2b
comparison
equal deleted inserted replaced
97840:8e246e0bdbba 97841:10312e057a97
127 (input-method . "malayalam-itrans") 127 (input-method . "malayalam-itrans")
128 (documentation . "\ 128 (documentation . "\
129 South Indian language Malayalam is supported in this language environment.")) 129 South Indian language Malayalam is supported in this language environment."))
130 '("Indian")) 130 '("Indian"))
131 131
132 (defconst devanagari-composable-pattern
133 (concat
134 "\\([अ-औॠॡ][ँं]?\\)\\|[ः।]"
135 "\\|\\("
136 "\\(?:\\(?:[क-हक़-य़]्\\)?\\(?:[क-हक़-य़]्\\)?\\(?:[क-हक़-य़]्\\)?[क-हक़-य़]्\\)?"
137 "[क-हक़-य़]\\(?:्\\|[ा-्ॢॣ]?[ंँ]?\\)?"
138 "\\)")
139 "Regexp matching a composable sequence of Devanagari characters.")
140
141 (defconst tamil-composable-pattern
142 (concat
143 "\\([அ-ஔ]\\)\\|"
144 "[ஂஃ]\\|" ;; vowel modifier considered independent
145 "\\(\\(?:\\(?:க்ஷ\\)\\|[க-ஹ]\\)[்ா-ௌ]?\\)\\|"
146 "\\(ஷ்ரீ\\)")
147 "Regexp matching a composable sequence of Tamil characters.")
148
149 (defconst kannada-composable-pattern
150 (concat
151 "\\([ಂ-ಔೠಌ]\\)\\|[ಃ]"
152 "\\|\\("
153 "\\(?:\\(?:[ಕ-ಹ]್\\)?\\(?:[ಕ-ಹ]್\\)?\\(?:[ಕ-ಹ]್\\)?[ಕ-ಹ]್\\)?"
154 "[ಕ-ಹ]\\(?:್\\|[ಾ-್ೕೃ]?\\)?"
155 "\\)")
156 "Regexp matching a composable sequence of Kannada characters.")
157
158 (defconst malayalam-composable-pattern
159 (concat
160 "\\([അ-ഔ][ം]?\\)\\|ഃ"
161 "\\|\\("
162 "\\(?:\\(?:[ക-ഹ]്\\)?\\(?:[ക-ഹ]്\\)?\\(?:[ക-ഹ]്\\)?[ക-ഹ]്\\)?"
163 "[ക-ഹ]\\(?:്\\|[ാ-ൃെേൈൊൊോൌ]?[ം്]?\\)?"
164 "\\)")
165 "Regexp matching a composable sequence of Malayalam characters.")
166
132 (let ((script-regexp-alist 167 (let ((script-regexp-alist
133 '((devanagari . "[\x900-\x9FF\x200C\x200D]+") 168 `((devanagari . ,devanagari-composable-pattern)
134 (bengali . "[\x980-\x9FF\x200C\x200D]+") 169 (bengali . "[\x980-\x9FF\x200C\x200D]+")
135 (gurmukhi . "[\xA00-\xA7F\x200C\x200D]+") 170 (gurmukhi . "[\xA00-\xA7F\x200C\x200D]+")
136 (gujarati . "[\xA80-\xAFF\x200C\x200D]+") 171 (gujarati . "[\xA80-\xAFF\x200C\x200D]+")
137 (oriya . "[\xB00-\xB7F\x200C\x200D]+") 172 (oriya . "[\xB00-\xB7F\x200C\x200D]+")
138 (tamil . "[\xB80-\xBFF\x200C\x200D]+") 173 (tamil . ,tamil-composable-pattern)
139 (telugu . "[\xC00-\xC7F\x200C\x200D]+") 174 (telugu . "[\xC00-\xC7F\x200C\x200D]+")
140 (kannada . "[\xC80-\xCFF\x200C\x200D]+") 175 (kannada . ,kannada-composable-pattern)
141 (malayalam . "[\xD00-\xD7F\x200C\x200D]+")))) 176 (malayalam . ,malayalam-composable-pattern))))
142 (map-char-table #'(lambda (key val) 177 (map-char-table
143 (let ((slot (assq val script-regexp-alist))) 178 #'(lambda (key val)
144 (if slot 179 (let ((slot (assq val script-regexp-alist)))
145 (set-char-table-range 180 (if slot
146 composition-function-table key 181 (set-char-table-range
147 (list (cons (cdr slot) 'font-shape-text)))))) 182 composition-function-table key
148 char-script-table)) 183 (list (vector (cdr slot) 0 'font-shape-gstring))))))
184 char-script-table))
149 185
150 (provide 'indian) 186 (provide 'indian)
151 187
152 ;; arch-tag: 83aa8fc7-7ee2-4364-a6e5-498f5e3b8c2f 188 ;; arch-tag: 83aa8fc7-7ee2-4364-a6e5-498f5e3b8c2f
153 ;;; indian.el ends here 189 ;;; indian.el ends here