Subject: bug#28339: 25.2; Emacs shows ZWNJ character (Zero Width non-Joiner) as Space

From: handa <[email-masked]>
Date: Wed, 13 Sep 2017 23:02:56 +0900

In article <[email-masked]>, Nima Aryan <[email-masked]> writes:

> I can confirm that this code solves the problem for many fonts I tested
> including:
>    DejaVu Sans, Vazir Code, Inconsolata-g, Office Code Pro, Ubunto, Meslo,
> ...

Thank you for testing my code.

> The fonts I still see some problems are 'Droid Sans Regular' which shows
> hallow boxes and Noto Sans which shows a narrow width bar.

That's perhaps because they define those glyphs for ZWNJ.

To avoid that problem, there are two ways:
(1) display ZWNJ with a glyph for space (if the font has a glyph for space)
(2) do not generate a glypgh for ZWNJ

Please try the attached new version.  It tries (1).  If you change the
value of arabic-font-shape-gstring to
`arabic-font-shape-gstring-ZWNJ-absorb, it tries (2).

As an editor, I think (1) is better, but an Arabic/Persian user may have
different opinion.

---
K. Handa
[email-masked]