4

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.

  • 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 '15 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.