1 ;;; persian.el --- Quail package for inputting Persian/Farsi keyboard -*- coding: utf-8;-*-
3 ;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
5 ;; Author: Mohsen BANAN <libre@mohsen.banan.1.byname.net>
6 ;; http://mohsen.banan.1.byname.net/contact
8 ;; Keywords: multilingual, input method, Farsi, Persian, keyboard
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;; This is a Halaal Poly-Existential intended to remain perpetually Halaal.
29 ;; This file contains a collection of input methods for
30 ;; Persian languages - Farsi, Urdu, Pashto (Afghani), ...
32 ;; At this time, the following input methods are specified:
34 ;; - (farsi) Persian Keyboard based on Islamic Republic of Iran's ISIR-9147
35 ;; - (farsi-translit) Intuitive transliteration keyboard layout for Persian
43 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49 ;; The keyboard mapping defined here is based on:
51 ;; Institute of Standards and Industrial Research of Iran
52 ;; Information Technology – Layout of Persian Letters and Symbols on Computer Keyboards
53 ;; ISIRI 9147 -- 1st edition
54 ;; http://www.isiri.org/UserStd/DownloadStd.aspx?id=9147
56 ;; Only layers 1 and 2 of ISIRI-9147 are applicable to emacs.
58 ;; This input method was built using the Farsi table in X Keyboard Configuration Data Base.
60 ;; 0) Selected gnome keyboard "USA"
61 ;; 1) Created a list of all keys
62 ;; 2) Selected gnome keyboard "Iran"
63 ;; 3) For each key just press it and get the mapped persian character
68 "farsi" "Farsi" " ف" nil
"Farsi input method.
70 Based on ISIRI-9149 Layout of Persian Letters and Symbols on Computer Keyboards.
71 " nil t t t t nil nil nil nil nil t
)
73 ;; +----------------------------------------------------------------+
74 ;; | ۱! | ۲٬ | ۳٫ | ۴﷼ | ۵٪ | ۶× | ۷، | ۸* | ۹) | ۰( | -ـ | =+ | `÷ |
75 ;; +----------------------------------------------------------------+
76 ;; | ضْ| صٌ| ثٍ| قً| فُ| غِ| عَ| هّ| خ] | ح[ | ج} | چ{ |
77 ;; +------------------------------------------------------------+
78 ;; | شؤ | سئ | یي | بإ | لأ | اآ | تة | ن» | م« | ک: | گ؛ | \| |
79 ;; +-----------------------------------------------------------+
80 ;; | ظك | طٓ| زژ | رٰ| ذB | دٔ| پء | و> | .< | /؟ |
81 ;; +-------------------------------------------+
96 ;;("`" ?\)) ;; اتصال مجازى
120 ("\\" ?
\\) ;; خط اريب وارو
145 ("Q" ?ْ
) ;; ساکن فارسى
146 ("W" ?ٌ
) ;; دو پيش فارسى -- تنوين رفع
147 ("E" ?ٍ
) ;; دو زير فارسى -- تنوين جر
148 ("R" ?ً
) ;; دو زبر فارسى -- تنوين نصب
149 ("T" ?ُ
) ;; پيش فارسى -- ضمه
150 ("Y" ?ِ
) ;; زير فارسى -- کسره
151 ("U" ?َ
) ;; زبر فارسى -- فتحه
152 ("I" ?ّ
) ;; تشديد فارسى
173 ;; ("B" ?) ;; فاصلهً مجازى
174 ("N" ?ٔ
) ;; همزه فارسى بالا
175 ("M" ?ء
) ;; harf farsi hamzeh
182 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
186 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188 ;;; This is a persian/farsi transliteration keyboard designed
190 ;;; - Know how to write in farsi
191 ;;; - Are comfortable with the qwerty keyboard
192 ;;; - Are familiar with two letter phonetic mapping to persian characters
193 ;;; (e.g.: gh, kh, ch, sh, zh, hh, lh)
195 ;;; This translit keyboard is designed to be intuitive such that
196 ;;; mapping are easy and natural to remember for a persian writer.
197 ;;; For some persian characters there are multiple ways of inputting
198 ;;; the same character.
200 ;;; The letter 'h' is used for a number of two character mappings,
201 ;;; this means that some character sequence inputs need to be repeated
202 ;;; followed by a backspace followed by the 'h'.
203 ;;; For example: سحر = 's' 's' '<bs>' 'h' 'h' 'r'
204 ;;; In practice such sequences are rare.
209 (quail-define-package
210 "farsi-translit" "Farsi" "پ" t
211 "Intuitive transliteration keyboard layout for persian/farsi.
212 " nil t t t t nil nil nil nil nil t
)
217 ("A" ?آ
) ;; alef madde
243 ("K" ?ك
) ;; Arabic kaf
254 ("th" ?ة
) ;; ta marbuteh
274 ("~" ?ّ
) ;; tashdid ;; تشديد فارسى
276 ("e" ?ِ
) ;; zir زير فارسى -- فتحه
277 ("E" ?ٍ
) ;; eizan ;; دو زير فارسى -- تنوين جر
278 ("#" ?ً
) ;; ً tanvin nasb ;; دو زبر فارسى -- تنوين نصب
279 ("@" ?ْ
) ;; ساکن فارسى
280 ("^" ?َ
) ;; zbar ;; زبر فارسى -- فتحه
281 ("o" ?ُ
) ;; peesh ;; پيش فارسى -- ضمه
282 ("O" ?ٌ
) ;; دو پيش فارسى -- تنوين رفع
283 ("?" ?؟
) ;; alamat soal
284 ("&" ?ٔ
) ;; همزه فارسى بالا
296 ;;; persian.el ends here