Skip to content

Fix ZWNJ and ZWJ in the Kannada KGP layout - #876

Merged
srish merged 3 commits into
wikimedia:masterfrom
prasadus92:kn-kgp-zwnj-zwj
Nov 25, 2026
Merged

srish merged 3 commits into
wikimedia:masterfrom
prasadus92:kn-kgp-zwnj-zwj

Conversation

@prasadus92

Copy link
Copy Markdown
Contributor

Fixes #511.

In kn-kgp, a second f after a virama did nothing, so there was no way to type virama + ZWNJ, which Kannada uses to keep a visible virama before another consonant (ನ್‌ನ). And F always typed a bare ZWJ, so ArFy gave ರ‍ಯ instead of ಆರ‍್ಯ.

With this change, ff after a virama types ZWNJ, and F after ರ types ZWJ + virama in one stroke. That matches KaGaPa's Nudi mapping reference (kagapa-blr/kannada-nudi-core, docs/). The old rFf order still works, F elsewhere still types ZWJ, and I added KX for ಖ಼, which the same reference lists.

I ran the 741 key sequences from that reference through the rules. 80 gave a different result before this change and 16 still do; those 16 look like typos in the table (ಅರ್ಘ is listed as arfP, but P is ಫ). I added 5 fixtures. The full suite passes, and the new fixtures fail without the change.

@MayuraVerma, does this match what you were after in #511?

cc @aravindavk, as the author of this layout.

In kn-kgp, ff after a virama now types virama + ZWNJ, so a visible
virama can sit before another consonant (ನ್‌ನ). F after ರ types
ZWJ + virama in one key, so ArFy gives ಆರ‍್ಯ instead of ರ‍ಯ. The old
rFf order still works and F elsewhere still types ZWJ. KX types ಖ಼.

Fixes wikimedia#511.

@srish srish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @prasadus92 for this PR!

One thing I noticed: after a letter with a nukta (ಜ಼, ಫ಼, ಖ಼), ff types a Latin "f" instead of the ZWNJ. For example, jXff gives ಜ಼್f. Changing maxKeyLength from 2 to 3 fixed this when I tried it, and the tests still pass. Could you take a look, and maybe add a test like jXff?

@prasadus92

Copy link
Copy Markdown
Contributor Author

Thanks, good catch. maxKeyLength is now 3, and I added jXff and PXff tests.

@MayuraVerma

Copy link
Copy Markdown

Second f is pretty straightforward
It should type ZWNJ ONLY in presence of a Kannada virama
Everywhere else f continue to function as before

if F is mapped to ZWJ today, it needs to be instead be ZWJ+virama
F must output only in presence of a ರ, otherwise it must not output anything

Think of F as second variant of f, special purposed for ರ to have a vattu and avoid arkavattu formation

Read #511

@prasadus92

Copy link
Copy Markdown
Contributor Author

Thanks. F now types ZWJ and virama only after ರ, and nothing anywhere else. I removed the 3 old rules that could leave a stray ZWJ, and added tests for F after a consonant, a vowel and a virama. ZWNJ still comes only from a second f after a virama.

@prasadus92
prasadus92 requested a review from srish November 24, 2026 16:37
@srish
srish merged commit 7513c1f into wikimedia:master Nov 25, 2026
2 checks passed
@srish

srish commented Nov 25, 2026

Copy link
Copy Markdown
Member

Thanks a lot @prasadus92 for these improvements and @MayuraVerma for explaining the expected behaviour so clearly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Issue in kn/kn-kgp.js

3 participants