% engine=luatex 
%
% Font
\definefontfeature
   [arabic]
   [mode=node,language=dflt,script=arab,
    init=yes,medi=yes,fina=yes,isol=yes,
    liga=yes,dlig=yes,rlig=yes,clig=yes,
    mark=yes,mkmk=yes,kern=yes,curs=yes]

\starttypescript [serif] [arabic]
  \definefontsynonym [Arabic-Light]          [name:arabtype]     [features=arabic]
  \definefontsynonym [Arabic-Bold]           [name:arabtype]      [features=arabic]
  \definefontsynonym [Arabic-Italic]         [name:arabtype]     [features=arabic]
  \definefontsynonym [Arabic-Bold-Italic]    [name:arabtype]      [features=arabic]
 \stoptypescript

\starttypescript [serif] [arabic] [name]
  \usetypescript[serif][fallback]
  \definefontsynonym [Serif]                   [Arabic-Light]                   [features=arabic]
  \definefontsynonym [SerifItalic]             [Arabic-Italic]                  [features=arabic]
  \definefontsynonym [SerifBold]               [Arabic-Bold]                    [features=arabic]
  \definefontsynonym [SerifBoldItalic]         [Arabic-Bold-Italic]             [features=arabic]
\stoptypescript

\starttypescript [Arabic]
  \definetypeface [Arabic] [rm] [serif] [arabic] [default] 
\stoptypescript 

\usetypescript[Arabic]
\setupbodyfont[Arabic,20pt]

% directionality
\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT
%
\setcharactermirroring[1]

% hyperlinks
\setupinteraction
  [state=start,
   color=red,
   style=bold]

\starttext
\startstandardmakeup
  \midaligned{كيف تكتب عربي في كنتكست}
  \midaligned{كتبه}
  \midaligned{خالد حسني}
\stopstandardmakeup
\completecontent
%\placecontent
\chapter{مقدمة}
... كلام\index{عنصر فهرس} ...
\chapter{أول فصل}
\section[firstsection]{أول باب}
... كلام ...
\section{ثاني باب}
... كلام\index{فهرس آخر} ...
\subsection{ثاني مسألة}
... كلام\index{index entry} ...
\section{ثالث باب}
... كلام ...
\chapter{فصل آخر}
... كلام ...
\chapter[lastchapter]{آخر فصل}
... كلام ...
\completeindex
\stoptext
