5

I recently read about Contextual Swashes for Arabic fonts from here. They have shown an example of how it would look. I've already read this question and it helped me set up my MWE. Here is a quick visual explanation, I wish to achieve the effect on the right:

Arabic Noon Swash

Here is my less than MWE:

\documentclass{article}
\usepackage{fontspec}
\usepackage[paperheight=2cm, paperwidth=5cm, textheight=1cm, textwidth=2.5cm]{geometry}
\usepackage{polyglossia}

\setmainlanguage{arabic}
\fontspec[Scale=3.5, Script=Arabic, Contextuals=Swash]{Arabic Typesetting}
\setmainfont[Ligatures=TeX, Contextuals=Swash]{Arabic Typesetting}
\newfontfamily\arabicfont[Scale=2.4, Script=Arabic, Contextuals=Swash]{Arabic Typesetting}
\begin{document}
\pagestyle{empty}
من محمد
\end{document}

The reason I used the 'Arabic Typsetting' font is because I saw it use these swashes in a sample file which you can download from here. If you know any other font which can do it, feel free to replace it (Arabic Typesetting is available on Windows 7 and 8, and I assume 10 as well. It should also come with an Office installation).

So my question is two-fold:

  1. Can this actually be done in XeLaTeX? I'm open to manual methods or hacks.
  2. Is there a better way to enable this, i.e. using LuaTeX? I have not learned or use LuaTeX.

Thanks for your time.

1
  • I’m afraid the answer to your question will have to come from someone who owns the particular font you’re using. None of the many fonts on my system that support Arabic has the cswh feature, and myfonts.com can’t find one either (myfonts.com/search/ot_exact%3Acswh+charset%3Aarab/fonts).
    – Thérèse
    Sep 8, 2015 at 0:00

1 Answer 1

3

There is no cswh feature in Arabic Typesetting font.

However, you can switch on ligatures (liga), and justification alternates (jalt), and then apply some manual kerning, to almost get something like in the illustration.

kerned

There is a final form that possibly matches the illustration, but it is under fina (final), not cswh.

MWE

\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{persian}
\newfontfamily\persianfont[Scale=4,
    Script=Arabic,
    ]{Arabic Typesetting}
\begin{document}
\addfontfeature{RawFeature=-liga}
1 من محمد 

\bigskip
\addfontfeature{RawFeature=+liga}
2 من محمد 

\bigskip
\addfontfeature{RawFeature=+jalt}
3 من محمد 

\bigskip


4 من\kern-0.85em محمد 

\bigskip
\bigskip
من  ﺾﺿﺾ

من محمد 
من  ﺾﺿﺾ
%\bigskip
%\addfontfeature{RawFeature=+fina}
%من
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .