Subject: bug#55313: [PATCH] Add support for the Tirhuta script

From: समीर सिंह Sameer Singh <[email-masked]>
Date: Sun, 8 May 2022 17:57:00 +0530

I have added support for the Tirhuta script in Emacs.
Please check for any mistakes.
From b1eb7d338c35878ce23abe9b7d922f61acb60c99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0=20=E0=A4=B8=E0=A4=BF?=
 =?UTF-8?q?=E0=A4=82=E0=A4=B9=20Sameer=20Singh?= <[email-masked]>
Date: Sun, 8 May 2022 17:42:35 +0530
Subject: [PATCH] Add support for the Tirhuta script

* lisp/language/indian.el ("Tirhuta"): New language environment.
Add composition rules for Tirhuta.  Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Tirhuta.
* lisp/leim/quail/indian.el ("tirhuta"): New input method.

* etc/HELLO: Add a Tirhuta greeting.
* etc/NEWS: Announce the new language environment and its
input method.
---
 etc/HELLO                     |   2 +
 etc/NEWS                      |   5 ++
 lisp/international/fontset.el |   3 +-
 lisp/language/indian.el       |  24 ++++++++
 lisp/leim/quail/indian.el     | 107 ++++++++++++++++++++++++++++++++++
 5 files changed, 140 insertions(+), 1 deletion(-)

diff --git a/etc/HELLO b/etc/HELLO
index ac0cb823ea..bd33c32b7a 100644
--- a/etc/HELLO
+++ b/etc/HELLO
@@ -86,6 +86,8 @@ TaiViet (ꪁꪫꪱꪣ ꪼꪕ)	ꪅꪰꪙꫂ ꪨꪮꫂ ꪁꪫꪱ / ꪅꪽ ꪨꪷ 
 Thai (ภาษาไทย)	สวัสดีครับ / สวัสดีค่ะ
 Tibetan (བོད་སྐད་)	བཀྲ་ཤིས་བདེ་ལེགས༎
 Tigrigna (ትግርኛ)	ሰላማት
+
+Tirhuta (𑒞𑒱𑒩𑒯𑒳𑒞𑒰)	𑒣𑓂𑒩𑒢𑒰𑒧 / 𑒮𑒲𑒞𑒰𑒩𑒰𑒧
 Turkish (Türkçe)	Merhaba
 Ukrainian (українська)	Вітаю
 Vietnamese (tiếng Việt)	Chào bạn
diff --git a/etc/NEWS b/etc/NEWS
index 6a60231b3a..0039ce82b2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -737,6 +737,11 @@ an important writing system of the past mainly used for administrative
 purposes.  A new input method, 'kaithi', is provided to type text in
 this script.
 
+*** New language environment "Tirhuta".
+This language environment supports Tirhuta or Mithilaakshar, which is
+used to write the Maithili language.  A new input method, 'tirhuta',
+is provided to type text in this script.
+
 
 * Changes in Specialized Modes and Packages in Emacs 29.1
 
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 66f5068cf7..2d417d632f 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -238,7 +238,7 @@ font-encoding-charset-alist
 	(khudawadi #x112B0)
 	(grantha #x11305)
 	(newa #x11400)
-	(tirhuta #x11481)
+	(tirhuta #x11481 #x1148F #x114D0)
 	(siddham #x11580)
 	(modi #x11600)
 	(takri #x11680)
@@ -774,6 +774,7 @@ setup-default-fontset
                     old-uyghur
                     brahmi
                     kaithi
+                    tirhuta
 		    makasar
                     dives-akuru
 		    cuneiform
diff --git a/lisp/language/indian.el b/lisp/language/indian.el
index b240403b0a..e499750b00 100644
--- a/lisp/language/indian.el
+++ b/lisp/language/indian.el
@@ -147,6 +147,17 @@ 'devanagari
 which used the Kaithi script are supported in this language environment."))
  '("Indian"))
 
+(set-language-info-alist
+ "Tirhuta" '((charset unicode)
+             (coding-system utf-8)
+             (coding-priority utf-8)
+             (input-method . "tirhuta")
+             (sample-text . "Tirhuta (𑒞𑒱𑒩𑒯𑒳𑒞𑒰)        𑒣𑓂𑒩𑒢𑒰𑒧")
+             (documentation . "\
+Maithili language and its script Tirhuta is supported in this
+language environment."))
+ '("Indian"))
+
 
 ;; Replace mnemonic characters in REGEXP according to TABLE.  TABLE is
 ;; an alist of (MNEMONIC-STRING . REPLACEMENT-STRING).
@@ -465,4 +476,17 @@ malayalam-composable-pattern
 
 (provide 'indian)
 
+;; Tirhuta composition rules
+(let ((consonant            "[\x1148F-\x114AF]")
+      (nukta                "\x114C3")
+      (vowel                "[\x114B0-\x114BE]")
+      (anusvara-candrabindu "[\x114BF\x114C0]")
+      (virama               "\x114C2"))
+  (set-char-table-range composition-function-table
+                        '(#x114B0 . #x114C3)
+                        (list (vector
+                               (concat consonant nukta "?\\(?:" virama consonant nukta "?\\)*\\(?:"
+                                       virama "\\|" vowel "*" nukta "?" anusvara-candrabindu "?\\)")
+                               1 'font-shape-gstring))))
+
 ;;; indian.el ends here
diff --git a/lisp/leim/quail/indian.el b/lisp/leim/quail/indian.el
index a52d44bc08..f730a5ca0f 100644
--- a/lisp/leim/quail/indian.el
+++ b/lisp/leim/quail/indian.el
@@ -860,6 +860,7 @@ "||"
 ("8"  ?८)
 ("`8" ?8)
 ("9"  ?९)
+("`9" ?9)
 ("0"  ?०)
 ("`0" ?0)
 ("`\)" ?𑂻)
@@ -936,5 +937,111 @@ "||"
 ("`m" ?𑂀)
 )
 
+(quail-define-package
+ "tirhuta" "Tirhuta" "𑒞𑒱" t "Tirhuta phonetic input method.
+
+ `\\=`' is used to switch levels instead of Alt-Gr.
+" nil t t t t nil nil nil nil nil t)
+
+(quail-define-rules
+("``" ?₹)
+("1"  ?𑓑)
+("`1" ?1)
+("2"  ?𑓒)
+("`2" ?2)
+("3"  ?𑓓)
+("`3" ?3)
+("4"  ?𑓔)
+("`4" ?4)
+("5"  ?𑓕)
+("`5" ?5)
+("6"  ?𑓖)
+("`6" ?6)
+("7"  ?𑓗)
+("`7" ?7)
+("8"  ?𑓘)
+("`8" ?8)
+("9"  ?𑓙)
+("`9" ?9)
+("0"  ?𑓐)
+("`0" ?0)
+("`\)" ?𑓆)
+("`\\" ?।)
+("`|" ?॥)
+("`"  ?𑒙)
+("q"  ?𑒙)
+("Q"  ?𑒚)
+("w"  ?𑒛)
+("W"  ?𑒜)
+("e"  ?𑒺)
+("E"  ?𑒹)
+("`e" ?𑒋)
+("r"  ?𑒩)
+("R"  ?𑒵)
+("`r" ?𑒇)
+("t"  ?𑒞)
+("T"  ?𑒟)
+("y"  ?𑒨)
+("Y"  ?𑒻)
+("`y" ?𑒌)
+("u"  ?𑒳)
+("U"  ?𑒴)
+("`u" ?𑒅)
+("`U" ?𑒆)
+("i"  ?𑒱)
+("I"  ?𑒲)
+("`i" ?𑒃)
+("`I" ?𑒄)
+("o"  ?𑒽)
+("O"  ?𑒼)
+("`o" ?𑒍)
+("p"  ?𑒣)
+("P"  ?𑒤)
+("a"  ?𑒰)
+("A"  ?𑒂)
+("`a" ?𑒁)
+("s"  ?𑒮)
+("S"  ?𑒬)
+("d"  ?𑒠)
+("D"  ?𑒡)
+("f"  ?𑓂)
+("F" ?𑒶)
+("`f" ?𑒈)
+("g"  ?𑒑)
+("G"  ?𑒒)
+("h"  ?𑒯)
+("H"  ?𑓁)
+("j"  ?𑒖)
+("J"  ?𑒗)
+("k"  ?𑒏)
+("K"  ?𑒐)
+("l"  ?𑒪)
+("L" ?𑒷)
+("`l" ?𑒉)
+("z"  ?𑒘)
+("Z"  ?𑒓)
+("`z" ?𑒸)
+("`Z" ?𑒊)
+("x"  ?𑒭)
+("X"  ?𑓃)
+("c"  ?𑒔)
+("C"  ?𑒕)
+("`c" #x200C)  ; ZWNJ
+("v"  ?𑒫)
+("V" ?𑒾)
+("`v" ?𑒎)
+("b"  ?𑒥)
+("B"  ?𑒦)
+("`b" ?𑒀)
+("`B" ?𑓄)
+("n"  ?𑒢)
+("N"  ?𑒝)
+("`n" ?𑓇)
+("`N" ?𑓅)
+("m"  ?𑒧)
+("M"  ?𑓀)
+("`m" ?𑒿)
+)
+
 
 ;;; indian.el ends here
-- 
2.36.1