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:
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:
- Can this actually be done in XeLaTeX? I'm open to manual methods or hacks.
- Is there a better way to enable this, i.e. using LuaTeX? I have not learned or use LuaTeX.
Thanks for your time.
cswh
feature, and myfonts.com can’t find one either (myfonts.com/search/ot_exact%3Acswh+charset%3Aarab/fonts).