Reputation: 192
Emacs version 24.3 does not display the contextual forms of Arabic characters correctly on my system (Mac OS X Mavericks; see this link at Wikipedia if you are unfamiliar with what contextual forms are). The characters are displayed in their unconnected form no matter where they appear in the word, making it practically unreadable. Emacs exhibits this behavior with the Arabic that is displayed when I open the "Hello" file (C-h h
) if you would like to try to replicate this issue.
UPDATE:
I have tried some of the suggestions listed in the answers below. I am now including the following in my .emacs file:
(when window-system (set-fontset-font "fontset-default" '(#x600 . #x6ff) "FONT"))
Where FONT is one of the Arabic fonts listed when I evaluate (print (font-family-list))
in Emacs or type fc-list : family
in the terminal.
This has included trying, as suggested, Deja Vu Sans Mono, as well as Simplified Arabic and a number of other Arabic fonts from my system. I am still encountering the same problem with each one: it displays the characters in the correct font but they are unconnected.
Since I initially posted my question, I also found this conversation on a google groups forum where someone using Mac OS X had a similar problem but was never able to resolve it.
Upvotes: 2
Views: 1942
Reputation: 5369
Try switching your font to DejaVu Sans Mono. I use that one because it fully supports Arabic.
Updated: try using Aquamacs, as there may be a problem with Carbon Emacs on OSX.
Upvotes: 1
Reputation: 3590
You didn't provide an example screen shot; however, I assume that (when you refer to the "contextual forms of characters"), you are referring to the diacritic marks that would appear above/below/beside a letter. In order to correctly enter/display text that uses Unicode combining marks for diacritics (http://en.wikipedia.org/wiki/Diacritic) in languages like Hebrew and Arabic, you need to have both editor support (which Emacs does now in version 24) and font support. It is probably the case that you are not using a font in Emacs that correctly renders Arabic diacritic marks and that is why the diacritic marks are not "connected" to the letters that they're supposed to be connected to and, instead, are appearing beside the letters.
I don't speak/write Arabic; however, I've written a couple of blog posts about using Emacs 24 and Hebrew and these might be of help since both Hebrew and Arabic are RTL languages with diacritics (Part 1: http://beresheit.blogspot.ca/2010/07/hebrew-and-bidi-text-in-emacs24.html and Part 2: http://beresheit.blogspot.ca/2010/07/hebrew-and-bidi-text-in-emacs24-part-2.html).
Another article that I wrote describing a problem with font rendering of diacritics described how font design can affect the "correct" representation of diacritics (http://beresheit.blogspot.ca/2012/02/yiddishhebrew-font-display-differences.html). In this particular case, it was a case of Yiddish and Hebrew both using the same alphabet and diacritics but having different "renderings" for certain combinations.
Lastly, you might find the following snippet of elisp code useful. I use it to automatically change the font to a Hebrew-friendly font (the Ezra SIL font: http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ezrasil_home)when I start typing Hebrew characters (which are in the Unicode range #x590 through #x5ff). Adapting it to the Arabic Unicode range of characters and specifying an Arabic-friendly font should go a long way towards solving your issue:
(when window-system (set-fontset-font "fontset-default" '(#x590 . #x5ff) "Ezra_SIL"))
Note also that you can use the Emacs command C-u C-x = (which calls describe-char) to display font at point. This will tell you what font Emacs is currently using (in case it's not obvious).
Upvotes: 1