changeset 53356:8e5d406a10a5

(ccl-encode-koi8-font): Make it work for characters of mule-unicode-0100-24ff. (ccl-encode-windows-1251-font): New CCL program. ("Bulgarian"): Specify overriding-fontspec. ("Belarusian"): Likewise.
author Kenichi Handa <handa@m17n.org>
date Mon, 29 Dec 2003 07:10:51 +0000
parents fea694690fc7
children 01e8a4191802
files lisp/language/cyrillic.el
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/language/cyrillic.el	Mon Dec 29 07:10:09 2003 +0000
+++ b/lisp/language/cyrillic.el	Mon Dec 29 07:10:51 2003 +0000
@@ -204,6 +204,9 @@
 ;; The table is set up later to encode both Unicode and 8859-5.
 (define-ccl-program ccl-encode-koi8-font
   `(0
+    (if (r2 >= 0)
+	((r1 <<= 7)
+	 (r1 += r2)))
     (translate-character cyrillic-koi8-r-encode-table r0 r1))
   "CCL program to encode Cyrillic chars to KOI font.")
 
@@ -472,10 +475,25 @@
       (setcdr slot (cdr elt))
     (push elt ctext-non-standard-encodings-alist)))
 
+(define-ccl-program ccl-encode-windows-1251-font
+  '(0
+    ((r1 <<= 7)
+     (r1 += r2)
+     (translate-character encode-windows-1251 r0 r1)
+     )))
+
+(add-to-list 'font-ccl-encoder-alist
+	     '("microsoft-cp1251" . ccl-encode-windows-1251-font))
+
 (set-language-info-alist
  "Bulgarian" `((coding-system windows-1251)
 	       (coding-priority windows-1251)
 	       (ctext-non-standard-encodings "microsoft-cp1251")
+	       (overriding-fontspec
+		(,(get 'encode-windows-1251 'translation-table)
+		 . (nil . "microsoft-cp1251"))
+		(,(get 'cyrillic-koi8-r-encode-table 'translation-table)
+		 . (nil . "koi8-r")))
 	       (nonascii-translation
 		. ,(get 'decode-windows-1251 'translation-table))
 	       (input-method . "bulgarian-bds")
@@ -488,6 +506,11 @@
  "Belarusian" `((coding-system windows-1251)
 		(coding-priority windows-1251)
 		(ctext-non-standard-encodings "microsoft-cp1251")
+		(overriding-fontspec
+		 (,(get 'encode-windows-1251 'translation-table)
+		  . (nil . "microsoft-cp1251"))
+		 (,(get 'cyrillic-koi8-r-encode-table 'translation-table)
+		  . (nil . "koi8-r")))
 		(nonascii-translation
 		 . ,(get 'decode-windows-1251 'translation-table))
 		(input-method . "belarusian")