GNU bug report logs - #28339
25.2; Emacs shows ZWNJ character (Zero Width non-Joiner) as Space

Previous Next

Package: emacs;

Reported by: Nima Aryan <nimawebgard <at> gmail.com>

Date: Sun, 3 Sep 2017 16:41:01 UTC

Severity: normal

Found in version 25.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 28339 <at> debbugs.gnu.org (full text, mbox):

From: handa <handa <at> gnu.org>
To: Nima Aryan <nimawebgard <at> gmail.com>
Cc: eliz <at> gnu.org, 28339 <at> debbugs.gnu.org
Subject: Re: bug#28339: 25.2; Emacs shows ZWNJ character (Zero Width
 non-Joiner) as Space
Date: Mon, 11 Sep 2017 08:08:08 +0900
[Message part 1 (text/plain, inline)]
Hi,

I found why Emacs shows ZWNJ with space.
Emacs on GNU/Linux renders ZWNJ (unless it is absorbed by a rendering
engine) with a glyph defined in a font.  As Vazir Code (and Dejavu Sans)
defines a spacing glyph for ZWNJ, Emacs displays a space.  As Courier New
defines a vertical bar glyph for ZWNJ, Emacs displays a vertivcal bar.
And as Freeserif defines a zero-width glyph, Emacs displays a 1-dot
width space.

So, please try this:

At first, load the attached code to tell Emacs that a glyph of ZWNJ have
1-dot width.

Then, tell Emacs to use the same font for Arabic and ZWNJ as this;

(let ((spec (font-spec :family "Vazir Code")))
  (set-fontset-font nil 'arabic spec)
  (set-fontset-font nil #x200c spec))

One problem with this solution is that if a font has some actual glyph
 (e.g. vertical bar as Courier New), that bar is anyway displayed.

---
K. Handa
handa <at> gnu.org

[arabic-shape.el (application/emacs-lisp, attachment)]

This bug report was last modified 4 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.