termux-app icon indicating copy to clipboard operation
termux-app copied to clipboard

[Bug]: Devanāgarī characters not rendered correctly

Open rbnvrw opened this issue 8 months ago • 6 comments

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:

Image

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:

Image

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!

rbnvrw avatar Apr 14 '25 12:04 rbnvrw

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

Grimler91 avatar Apr 14 '25 13:04 Grimler91

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.

Biswa96 avatar Apr 14 '25 14:04 Biswa96

Maybe an example that more clearly demonstrates the issue, as it has more compound characters:

योगश्चित्तवृत्तिनिरोधः

Should look like

Image

But renders in Termux as:

Image

This also messes up navigation using the cursor keys and text selection.

rbnvrw avatar Apr 17 '25 14:04 rbnvrw

Is this issue related with zero width joiner? https://en.wikipedia.org/wiki/Zero-width_joiner

Biswa96 avatar Apr 17 '25 16:04 Biswa96

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:

Image

So I think it happens for all conjuncts, see e.g. https://en.m.wikipedia.org/wiki/Conjunct_consonant

rbnvrw avatar Apr 17 '25 16:04 rbnvrw

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.

sud0xenn avatar Aug 13 '25 05:08 sud0xenn