diff options
| author | Kenichi Handa | 2003-03-22 01:07:17 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-03-22 01:07:17 +0000 |
| commit | 098d86d57115097d259604be0b8526bfe19df0bd (patch) | |
| tree | 26e316d01cf4085001dec1de79785774c71171ea | |
| parent | d6156ce8447b59bfd9e014c939652875ade88816 (diff) | |
| download | emacs-098d86d57115097d259604be0b8526bfe19df0bd.tar.gz emacs-098d86d57115097d259604be0b8526bfe19df0bd.zip | |
(indian-font-foundry): New variable.
(indian-script-language-alist): New variable.
(indian-font-char-index-table): New variable.
(indian-font-char): New function.
(indian-font-char-range): New function.
(font-ccl-encoder-alist): Add entry for AKRUTI font.
| -rw-r--r-- | lisp/language/indian.el | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/lisp/language/indian.el b/lisp/language/indian.el index 16435d7710d..993a084cf61 100644 --- a/lisp/language/indian.el +++ b/lisp/language/indian.el | |||
| @@ -45,6 +45,89 @@ | |||
| 45 | 45 | ||
| 46 | (define-coding-system-alias 'devanagari 'in-is13194) | 46 | (define-coding-system-alias 'devanagari 'in-is13194) |
| 47 | 47 | ||
| 48 | (defvar indian-font-foundry 'cdac | ||
| 49 | "Font foundry for Indian characters. | ||
| 50 | Currently supported foundries are `cdac' and `akruti'.") | ||
| 51 | |||
| 52 | (defvar indian-script-language-alist | ||
| 53 | "Alist of Indian scripts vs the corresponding language list and font foundry. | ||
| 54 | Each element has this form: | ||
| 55 | |||
| 56 | (SCRIPT LANGUAGE-LIST FONT-FOUNDRY) | ||
| 57 | |||
| 58 | SCRIPT is one of Indian script names. | ||
| 59 | |||
| 60 | LANGUAGE-LIST is a list of Indian langauge names SCRIPT is used for. | ||
| 61 | The list is in the priority order. | ||
| 62 | |||
| 63 | FONT-FOUNDRY is a font foundry representing a group of Indian | ||
| 64 | fonts. If the value is nil, the value of `indian-font-foundry' | ||
| 65 | is used." | ||
| 66 | '((devanagari (hindi sanskrit) nil) | ||
| 67 | (bengali (bengali assamese) nil) | ||
| 68 | (gurmukhi (punjabi) nil) | ||
| 69 | (gujarati (gujarati) nil) | ||
| 70 | (oriya (oriya) nil) | ||
| 71 | (tamil (tamil) nil) | ||
| 72 | (telugu (telugu) nil) | ||
| 73 | (kannada (kannada) nil) | ||
| 74 | (malayalam (malayalam) nil))) | ||
| 75 | |||
| 76 | (defconst indian-font-char-index-table | ||
| 77 | '( ; for which language(s) | ||
| 78 | ;; CDAC fonts | ||
| 79 | (#x0000 . cdac:dv-ttsurekh) ; hindi, etc | ||
| 80 | (#x0100 . cdac:sd-ttsurekh) ; sanskrit | ||
| 81 | (#x0200 . cdac:bn-ttdurga) ; bengali | ||
| 82 | (#x0300 . cdac:as-ttdurga) ; assamese | ||
| 83 | (#x0400 . cdac:pn-ttamar) ; punjabi | ||
| 84 | (#x0500 . cdac:gj-ttavantika) ; gujarati | ||
| 85 | (#x0600 . cdac:or-ttsarala) ; oriya | ||
| 86 | (#x0700 . cdac:tm-ttvalluvar) ; tamil | ||
| 87 | (#x0800 . cdac:tl-tthemalatha) ; telugu | ||
| 88 | (#x0900 . cdac:kn-ttuma) ; kannada | ||
| 89 | (#x0A00 . cdac:ml-ttkarthika) ; malayalam | ||
| 90 | |||
| 91 | ;; AKRUTI fonts | ||
| 92 | (#x0B00 . akruti:dev) ; hindi, etc | ||
| 93 | (#x0C00 . akruti:bng) ; bengali | ||
| 94 | (#x0D00 . akruti:pnj) ; punjabi | ||
| 95 | (#x0E00 . akruti:guj) ; gujarati | ||
| 96 | (#x0F00 . akruti:ori) ; oriya | ||
| 97 | (#x1000 . akruti:tml) ; tamil | ||
| 98 | (#x1100 . akruti:tlg) ; telugu | ||
| 99 | (#x1200 . akruti:knd) ; kannada | ||
| 100 | (#x1300 . akruti:mal) ; malayalam | ||
| 101 | ) | ||
| 102 | "Aliat of indices of `indian-glyph' character vs Indian font identifiers. | ||
| 103 | Each element has this form: (INDEX . FONT-IDENTIFIER) | ||
| 104 | |||
| 105 | INDEX is an index number of the first character in the charset | ||
| 106 | `indian-glyph' assigned for glyphs in the font specified by | ||
| 107 | FONT-IDENTIFIER. Currently FONT-IDENTIFIERs are defined for CDAC | ||
| 108 | and AKRUTI font groups.") | ||
| 109 | |||
| 110 | (defun indian-font-char (index font-identifier) | ||
| 111 | "Return character of charset `indian-glyph' made from glyph index INDEX. | ||
| 112 | FONT-IDENTIFIER is an identifier of an Indian font listed in the | ||
| 113 | variable `indian-font-char-index-table'. It specifies which | ||
| 114 | font INDEX is for." | ||
| 115 | (if (or (< index 0) (> index 255)) | ||
| 116 | (error "Invalid glyph index: %d" index)) | ||
| 117 | (let ((start (car (rassq font-identifier indian-font-char-index-table)))) | ||
| 118 | (if (not start) | ||
| 119 | (error "Unknown font identifier: %s" font-identifier)) | ||
| 120 | (setq index (+ start index)) | ||
| 121 | (make-char 'indian-glyph (+ (/ index 96) 32) (+ (% index 96) 32)))) | ||
| 122 | |||
| 123 | ;; Return a range of characters (cons of min and max character) of the | ||
| 124 | ;; charset `indian-glyph' for displaying SCRIPT in LANGUAGE by a font | ||
| 125 | ;; of FOUNDRY. | ||
| 126 | |||
| 127 | (defun indian-font-char-range (font-identifier) | ||
| 128 | (cons (indian-font-char 0 font-identifier) | ||
| 129 | (indian-font-char 255 font-identifier))) | ||
| 130 | |||
| 48 | (defvar indian-script-table | 131 | (defvar indian-script-table |
| 49 | '[ | 132 | '[ |
| 50 | devanagari | 133 | devanagari |
| @@ -82,6 +165,10 @@ The default value is `devanagari'.") | |||
| 82 | (cons (cons "-CDAC" 'ccl-encode-indian-glyph-font) | 165 | (cons (cons "-CDAC" 'ccl-encode-indian-glyph-font) |
| 83 | font-ccl-encoder-alist)) | 166 | font-ccl-encoder-alist)) |
| 84 | 167 | ||
| 168 | (setq font-ccl-encoder-alist | ||
| 169 | (cons (cons "-AKRUTI" 'ccl-encode-indian-glyph-font) | ||
| 170 | font-ccl-encoder-alist)) | ||
| 171 | |||
| 85 | (provide 'indian) | 172 | (provide 'indian) |
| 86 | 173 | ||
| 87 | ;;; indian.el ends here | 174 | ;;; indian.el ends here |