[XeTeX] Arabic Typography
Jonathan Kew
jfkthame at googlemail.com
Mon Mar 9 23:52:12 CET 2009
On 9 Mar 2009, at 22:18, Fr. Michael Gilmary wrote:
> I have a question about Arabic typesetting. Now, first of all, I
> haven't
> even learned the whole alphabet yet, so ....
>
> But when I use the Mac font "Al Bayan" with this:
>
> \documentclass[12pt]{article}
> \usepackage[no-math]{fontspec}
> \usepackage{xltxtra}
> \defaultfontfeatures{Mapping=tex-text}
> \setromanfont[Ligatures=Common, Numbers=OldStyle]{Garamond Premier
> Pro}
> \newfontfamily\Arabic[Scale=2]{Al Bayan}
> \usepackage{bidi}
> \newcommand\arabtxt[1]{{\setRL\Arabic{#1}}}
> \parindent=0in
>
> \begin{document}
>
> \arabtxt{
> يا خبز الحياة و قوت اﻷرواح وعربون
> النعيم\linebreak
> أنت ابن البشر أنت ابن الإله والإله
> هو الرحيم\linebreak
> الملائكة قيام بالخجل والوجل من بهاك
> العظيم\linebreak
> ونحن المسا كين كيف نقتبلك بغمنا ذا
> الأثيم\linebreak
>
> \end{document}
It's incidental to the actual question you're asking, but it looks
like you're lacking a } to terminate the argument to the \arabtxt
macro. Just a copy/paste slip, maybe?
>
> the text is typeset not only *with* the proper ligatures scripted
> (Note:
> *without* specifying the Script=Arabic option for fontspec) but also
> will stretch the text with the kashida fillers.
>
> But if I specify the fontspec option (Script=Arabic), then it scripts
> nothing and no kashida.
The fontspec [Script=....] option presupposes that OpenType "shaping"
is to be applied. Al Bayan (and the other Arabic, Indic, etc., fonts
that Apple ships) relies on AAT, not OpenType, for shaping behavior.
Left to itself, xetex will pick the appropriate rendering technology
based on what it finds in the font, but by specifying [Script] in
through fontspec you are overriding that, and insisting it use the
OpenType route. But Al Bayan doesn't include OpenType tables, so you
lose.
When using AAT fonts, xetex also tries to apply whatever justification
behavior the font provides, which may include kashidas in Arabic
fonts. There's no such support in the OpenType engine at the moment.
So... two different font technologies. (Note that AAT support is only
available on Mac OS X, so users on other platforms should disregard
this completely.)
JK
More information about the XeTeX
mailing list