[Bug]: Devanāgarī characters not rendered correctly
Problem description
In termux (and as a result, vim in termux) devanāgarī characters are not rendered correctly: the compound phonemes are rendered separately, which results in weird jumps in the cursor position when going through a word character by character.
It seems something needs to be changed in the terminal, I couldn't find much information, but see e.g. https://askubuntu.com/questions/182642/devnagari-script-in-terminal
Steps to reproduce the behavior.
Type the following characters:
स्वर
It is shown in Termux as:
I.e. the first two characters should be merged but aren't, these are the three separate characters with spaces: स् व र
Removing the spaces should merge the first two characters. It is the same for other compound characters.
What is the expected behavior?
It should show as:
System information
- Termux application version: googleplay.2025.01.18
- Android OS version: 14
- Device model: Samsung Galaxy S21 5G
Thank you for the great software!
Termux application version: googleplay.2025.01.18
Nothing we can do about playstore app here. Is issue reproducible in termux from F-Droid or https://github.com/termux/termux-app/releases? Otherwise please open an issue in playstore repo: https://github.com/termux-play-store/termux-issues
I can reproduce the issue in termux-app built from source. I copied the characters from this issue and pasted it in termux app window. copy-paste does not change the word in Firefox Android which shows it correctly.
Maybe an example that more clearly demonstrates the issue, as it has more compound characters:
योगश्चित्तवृत्तिनिरोधः
Should look like
But renders in Termux as:
This also messes up navigation using the cursor keys and text selection.
Is this issue related with zero width joiner? https://en.wikipedia.org/wiki/Zero-width_joiner
Is this issue related with zero width joiner? https://en.wikipedia.org/wiki/Zero-width_joiner
I think it's related but not exclusively. For example, the example they give on the wiki without ZWJ:
[ka क] [virāma ्] [ṣa ष] क्ष
Renders in Termux as:
So I think it happens for all conjuncts, see e.g. https://en.m.wikipedia.org/wiki/Conjunct_consonant
Experiencing the same issue, but I don't think it has to do with ZWJ but rather combining characters. I must've tested with all fonts out there with devanagari support but the issue still persists. It's termux specifically which does not have the engine to combine separating characters.