Subject: bug#55667: [PATCH] Add support for the Javanese script

From: समीर सिंह Sameer Singh <[email-masked]>
Date: Fri, 27 May 2022 06:27:01 +0530

The Javanese script is added to Emacs this time.
There was already a Javanese greeting in etc/HELLO so I have not touched
that.

Please review the Patch.
Thank you.

BTW, does the "set-language-environment" not change the input method?
From 710e1b6708c9f1b49be0403c572549ef5e8ca451 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: Thu, 26 May 2022 11:36:15 +0530
Subject: [PATCH] Add support for the Javanese script

* lisp/language/indonesian.el ("Javanese"): New language environment.
Add composition rules for Javanese.  Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
: Support Javanese.
* lisp/leim/quail/indonesian.el ("javanese"): New input method.

* etc/NEWS: Announce the new language environment and its
input method.
---
 etc/NEWS                      |   1 +
 lisp/international/fontset.el |   2 +-
 lisp/language/indonesian.el   |  30 +++++++++
 lisp/leim/quail/indonesian.el | 113 ++++++++++++++++++++++++++++++++++
 4 files changed, 145 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index d6221d5586..c03ec850c6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -824,6 +824,7 @@ corresponding language environments are:
 **** Tagbanwa script and language environment
 **** Limbu script and language environment
 **** Balinese script and language environment
+**** Javanese script and language environment
 
 ---
 *** The "Oriya" language environment was renamed to "Odia".
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index a7d7109c8d..6b51125629 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -203,7 +203,7 @@ font-encoding-charset-alist
 	(han #x5B57)
 	(yi #xA288)
         (syloti-nagri #xA807 #xA823 #xA82C)
-	(javanese #xA980)
+	(javanese #xA98F #xA9B4 #xA9CA)
 	(cham #xAA00)
 	(tai-viet #xAA80)
 	(hangul #xAC00)
diff --git a/lisp/language/indonesian.el b/lisp/language/indonesian.el
index 9a86135d89..994be2484a 100644
--- a/lisp/language/indonesian.el
+++ b/lisp/language/indonesian.el
@@ -36,6 +36,15 @@
               (documentation . "\
 Balinese language and its script are supported in this language environment.")))
 
+(set-language-info-alist
+ "Javanese" '((charset unicode)
+              (coding-system utf-8)
+              (coding-priority utf-8)
+              (input-method . "javanese")
+              (sample-text . "Javanese (ꦲꦏ꧀ꦱꦫꦗꦮ)	ꦲꦭꦺꦴ")
+              (documentation . "\
+Javanese language and its script are supported in this language environment.")))
+
 
 ;; Balinese composition rules
 (let ((consonant            "[\x1B13-\x1B33\x1B45-\x1B4B]")
@@ -59,6 +68,27 @@
                                        vowel "?" modifier-above "?" musical-symbol "?")
                                1 'font-shape-gstring))))
 
+;; Javanese composition rules
+(let ((consonant            "[\xA98F-\xA9B2]")
+      (independent-vowel    "[\xA984-\xA98E]")
+      (telu                 "\xA9B3")
+      (vowel                "[\xA9B4-\xA9BC]")
+      (dependant-consonant  "[\xA9BD-\xA9BF]")
+      (modifier-above       "[\xA980-\xA983]")
+      (pangkon              "\xA9C0"))
+  (set-char-table-range composition-function-table
+                        '(#xA9B3 . #xA9C0)
+                        (list (vector
+                               ;; Consonant based syllables
+                               (concat consonant telu "?" "\\(?:" pangkon consonant
+                                       telu "?\\)*\\(?:" pangkon "\\|" vowel "*" telu
+                                       "?" modifier-above "?" dependant-consonant "?\\)")
+                               1 'font-shape-gstring)
+                              (vector
+                               ;; Vowels based syllables
+                               (concat independent-vowel telu "?" pangkon "?"
+                                       vowel "?" modifier-above "?" dependant-consonant "?")
+                               1 'font-shape-gstring))))
 
 (provide 'indonesian)
 ;;; indonesian.el ends here
diff --git a/lisp/leim/quail/indonesian.el b/lisp/leim/quail/indonesian.el
index 46dafc89f5..82d0a2c269 100644
--- a/lisp/leim/quail/indonesian.el
+++ b/lisp/leim/quail/indonesian.el
@@ -173,5 +173,118 @@
  ("`m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