Localization/Arabic

From ArchWiki

This article describes how to set up Arabic language environment.

Applications

Shell

  • bash and zsh use "combining characters" (1) feature to merge diacritics and characters in one character.
  • zsh: to properly display diacritics add setopt COMBINING_CHARS to your .zshrc.

Vim

  • See Vim#Bidirectional support for setting up Bidi support.
  • Since Vim doesn't map Arabic characters given by input method, motion commands don't work. A possible workaround is to set keymap within Vim without changing X11 keymap. This can be done set keymap=arabic, then switching between layouts via Ctrl-^, or by manually set langmap in vimrc:
set langmap=ضصثقفغعهخحجد;qwertyuiop[],شسيبل;asdfg,اتنمكط;hjkl\;',ئءؤرلا;zxcvb,ىةوزظ;nm،./,لآB,آN,'M,؟?,ِA,ٍS,لأG,أH,ـJ,،K,ًW,ُE,ٌR,لإT,إY,÷I,×O,؛P

Fonts

Check Font configuration/Examples#Arabic for setting up font configuration. Persian fonts like vazirmatn-fontsAUR also include support for Arabic letters. A list of Persian fonts can be checked from Fonts#Persian.

Wide-character support:

Naskh (~Serif):

  • ttf-scheherazade-new — Unicode Arabic font from SIL (Alternative for Traditional Arabic font)
  • ttf-amiriAUR — A classical Arabic typeface in Naskh style pioneered by Amiria Press. Its Latin characters are based on Crimson (otf-crimson) [1] [2]
  • ttf-qurancomplex-fontsAUR — Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah

Ruqaa, Kufi (~Sans-Serif):

Monospace:

Bitmap:

Misc:

Troubleshooting

Common issues may be solved by checking Locale#Troubleshooting first. For problems related to text direction, check Bidi.

XKB Lam Alif problem

X keyboard layout sends Arabic ligature glyphs as a single glyph. For example, Laa+Alif ligature "لا" (U+0644, U+0627) is sent as "ﻻ" (U+FEFB), and similarly for (ﻷ، ﻵ، ﻹ). This is due to a known limitation in xkb which does not allow mapping a key to more than one character.

To solve this problem, set up a supported input method then restart X server. The following are input methods confirmed to work.

To set up input method (E.g: xim), either use im-config -n xim if you have it installed, or manually by adding the following to your environment variables:

XIM=none
XIM_PROGRAM=/bin/true
XIM_ARGS=
GTK_IM_MODULE=xim
QT_IM_MODULE=xim
SHORT_DESC="X compose table"

However, since most QT-based programs do not have this issue, it is enough to add export GTK_IM_MODULE=xim to ~/.xsessionrc or ~/.xprofile.

Tip: If XIM is set as the default input method, then XCompose table offers additional Arabic letters like: گ، ڤ، چ، پ, quotes «», as well as Wikipedia:Zero-width non-joiner, by pressing the AltGr key. The default compose table is located in /usr/share/X11/xkb/symbols/ara.

Fix Arabic legibility when using Noto Fonts

See Font configuration/Examples#Excluding Arabic script from other languages.

See also