[XeTeX] Traditional Arabic font and ArabXeTeX

François Charette firmicus at ankabut.net
Mon Jun 8 17:16:57 CEST 2009


Dear Juan,
(cc to the xetex list)

Juan Acevedo a écrit :
> Dear François,
>
> I do hope it is not too much bothering you with this query.
>
> I am using ArabXeTeX for a book in English with Unicode Arabic
> inserted in footnotes throughout and I am rather puzzled at the
> results I am getting with the font Traditional Arabic.
>
> This is my minimal example, with the output attached:
>
> ----------------
> %!TEX TS-program = xelatex
> %!TEX encoding = UTF-8 Unicode
>
>
> \documentclass{article}
> \usepackage[utf]{arabxetex}
>     \newfontfamily\arabicfont[Script=Arabic,ExternalLocation]{Traditional
> Arabic}
>
> \begin{document}
> \huge
>
> \textarab{%
> وَسُبْحَانَ اللهِ وَالْحَمْدُ لِلهِ وَلَا إِلَهَ إِلَّا اللهُ وَاللهُ أَكْبَرُ.
> }
>
> \end{document}
>
> ----------------
>
> I wonder if you will see in your email client or text editor the same
> I have here (Mac Leopard, using TeXShop); the problem is the lam-alif
> ligature: in the shahada the first one comes fine in the editor and
> wrong in the pdf, while the situation reverses in the following
> lam-alif of illa! Anything to do with the ExternalLocation of the
> font? simply a problem with this font?

It is a problem with the font. Many commercial Arabic fonts commonly
found on Windows (or in this case also on Mac) expect the vowel, shadda,
etc. to be entered *after* the lām-alif ligature. So instead of
LAM-FATHA-ALIF you must input LAM-ALIF-FATHA, and likewise with illa:
LAM-SHADDA-FATHA-ALIF -> LAM-ALIF-SHADDA-FATHA

The next version of ArabXeTeX will come with a fontmapping that
automatically fixes this (it was done by default until the penultimate
version IIRC, but I have disabled it). To try it now, save  the attached
files either in your working directory or under
<TEXMF>/fonts/misc/xetex/fontmapping/arabxetex/ (where <TEXMF> can be
for instance $TEXMFHOME or $TEXMFLOCAL). Then \arabicfont can be defined
thus:

\newfontfamily\arabicfont[Script=Arabic,Mapping=fixlamalif]{Traditional
Arabic}

> More generally, I could probably use Scheherazade, were it not for the
> "sub-optimal" FDF2 glyph, and the fact that this is a book on da'awat
> by Ghazali, where the name of God appears all the time. I had started
> trying a macro to insert Traditional Arabic just for FDF2, within text
> in Scheherazade, and I would much appreciate your advice on this kind
> of usage, or any hint.

To replace the glyph for ALLAH in Scheherazade with the one from
Traditional Arabic, you can try something like this:

\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}
\newfontfamily\tradarabic[Script=Arabic,Scale=1]{Traditional Arabic}
\catcode `ﷲ = \active
\def ﷲ{{\char"627\relax\raisebox{-.15ex}{\tradarabic\char"FDF2\relax}}}

\begin{document}
\huge

\textarab{%
وَسُبْحَانَ ﷲ وَالْحَمْدُ لِلهِ وَلَا إِلَهَ إِلَّا ﷲ وَﷲ أَكْبَرُ.
}

But this is probably not a very good idea ...

BTW, you should refrain from placing vowels within the word Allah, as it
prevents the ligature U+FDF2. I usually directly input U+FDF2 (with a
keyboard shortcut) when writing the name of God in Arabic. Note also
that U+FDF2 followed by a fatha or damma does not look nice with
Traditional Arabic, as it overlaps with the "dagger alif" (Scheherazade
is better in this respect).

> Please feel free to reply through the XeTeX list if you think this
> might be of more general interest.
>
> With muchísimas gracias in advance (and in retrospective for your
> excellent packages!),
>
> Juan
>

Regards,

FC
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixlamalif.map
URL: <http://tug.org/pipermail/xetex/attachments/20090608/bdf1ffb1/attachment.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixlamalif.tec
Type: application/octet-stream
Size: 258 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20090608/bdf1ffb1/attachment.obj>


More information about the XeTeX mailing list