Localization/Arabic
This article describes how to set up Arabic language environment.
Applications
- Bidirectional text includes text direction support among applications. In particular, Firefox
Ctrl+Shift+X
is the only supported shortcut for switching text direction. - Ayaspell offers Arabic spellchecking extensions for applications like LibreOffice, Firefox, and also system-wide dictionaries using hunspell-arAUR.
- Islamic tools: for Hijri date conversion.
- LibreOffice: set up Bidi support, then install Ayaspell dictionary from Tools > Language > More Dictionaries Online > Arabic.
Vim
- Vim still lacks support for bidi. If you're using Vim from a terminal, consider using a compatible terminal like Konsole.
- Since Vim doesn't map by default Arabic characters given by input method, commands like motion commands don't work. The current workaround is to either map it manually in vimrc or add
set keymap=arabic
to vimrc and switch between the layouts viaCtrl-^
. - Other useful Vim commands include
:set rightleft
,:set norightleft
.
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.
- ttf-arabeyes-fontsAUR — Collection of free Arabic fonts
- ttf-ubuntu-arabicAUR
- ttf-dejavu-ibAUR
- ttf-qurancomplex-fontsAUR — Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah
- ttf-scheherazade-new — Unicode Arabic font from SIL (Alternative for Traditional Arabic font)
- ttf-sil-lateefAUR — Unicode Arabic font from SIL
- ttf-amiriAUR — A classical Arabic typeface in Naskh style pioneered by Amiria Press. Its Latin characters are based on Crimson (otf-crimson) [1] [2]
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.
- xim.
- IBus: supported since v1.5.28.
- ibus-typing-booster: supported since 2.19.0
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
.
AltGr
key. The default compose table is located in /usr/share/X11/xkb/symbols/ara
.Fix Arabic legibility when using Noto Fonts
The Nastaliq Urdu fonts are chosen by default for Arabic. Use the following configuration to blacklist them, ensuring the system uses a proper Arabic font.
/etc/fonts/conf.d/66-noto-reject-nastaliq.conf
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <selectfont> <rejectfont> <glob>/usr/share/fonts/noto/NotoNastaliq*</glob> </rejectfont> </selectfont> </fontconfig>