ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Arabic Letters are disjointed and reversed in headers and margin
Date: Sun, 17 Jan 2016 20:15:49 +0100	[thread overview]
Message-ID: <569BE865.9060809@wxs.nl> (raw)
In-Reply-To: <loom.20160117T194547-16@post.gmane.org>

On 1/17/2016 7:47 PM, Ibn Saeed wrote:
> I have also made a post at tex.stackexchange.com
>
> I am trying to get Arabic Chapter Name in the header and some arabic text in
> the margins using ConTeXt MarkIV
>
> Here is the code:
>
> \mainlanguage[arabic]
>
> \setupdirections[bidi=global]
>
> \definefontfeature
>    [arabic]
>    [mode=node,language=dflt,script=arab,
>      init=yes,medi=yes,fina=yes,isol=yes,
>      liga=yes,dlig=yes,rlig=yes,tlig=yes,
>      calt=yes,trep=yes,clig=yes,
>      mark=yes,mkmk=yes,kern=yes,curs=yes]
>
>
> \starttypescript [serif] [arabic]
>    \definefontsynonym [Arabic-Regular] [file:ScheherazadeRegOT.ttf]
> [features=arabic]
>    \definefontsynonym [Arabic-Bold] [file:ScheherazadeRegOT.ttf]
> [features=arabic]
> \stoptypescript
>
> \starttypescript [serif] [arabic] [name]
>   \usetypescript[serif][fallback]
>   \definefontsynonym [Serif]     [Arabic-Regular] [features=arabic]
>   \definefontsynonym [SerifBold] [Arabic-Bold]    [features=arabic]
> \stoptypescript
>
> \starttypescript [Arabic]
>    \definetypeface [Arabic] [rm] [serif] [arabic] [default]
> \stoptypescript
>
>
> \def\ArabicGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT}
> \def\ArabicParDir    {\textdir TRT\pardir TRT}
> \def\ArabicTextDir   {\textdir TRT}
>
>
> \define\setarabic
>    {\ArabicGlobalDir%
>     \usetypescript[Arabic]%
>     \setupbodyfont[Arabic,20pt]}
>
> \definestartstop
>    [arabicpar]
>    [commands=\Arabic\ArabicParDir]
>
> \define[1]\RT
>    {{\Arabic\ArabicTextDir#1}}
>
>
> \pagedir TRT
> \bodydir TRT
> \pardir TRT
> \textdir TRT
>
>
>
>
> \setuppapersize[A4]
>
> \setuplayout[
>    grid=min,
>    backspace=55.999mm, width=130mm,
>    topspace=39.666mm, height=210mm,
>    header=12mm, footer=9mm,
>    ]
>
>
>
> \setupbodyfont[Arabic,24pt]
> \setupinterlinespace[line=42pt]
>
>
> \setupheads[number=no]
> \setuphead[chapter]
> [style=\bfd,before=,after=\blank,alternative=middle,grid=both]
> \setuphead[section][style=\bfc,before=\blank,after=,grid=both]
>
> \setupbackgrounds[header][text][frame=off, bottomframe=on]
>
> \setupheadertexts
>          [{\getmarking[chapter]}]    [{صفحة }]
>          [{صفحة }]        [{\getmarking[chapter]}]
>
> \setupinmargin[stack=yes]
>
>
> \starttext
>
> \chapter{الآجرومية}
>
> \margintext{الآجرومية}
>
> الحمد لله رب العالمين، وصلى الله وسلم وبارك على عبده ورسوله نبينا محمد وعلى
> آله وصحبه أجمعين، أما بعد:
> فلا يخفى على من له أدنى عناية بالعلم الشرعي لا سيما ما يتعلق بالكتاب
> العزيز والسنة النبوية لا يخفى عليه أهمية معرفة اللغة العربية بفنونها
> العشرة أو الإثني عشر:
>
>
>
> \stoptext

\setupmargindata
  [margintext]
  [align=r2l]

use \setupalign[r2l] and \righttoleft and not the dir primitives


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2016-01-17 19:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-17 18:47 Ibn Saeed
2016-01-17 19:15 ` Hans Hagen [this message]
2016-01-18  6:48   ` Ibn Saeed
2016-01-18  7:15     ` Ibn Saeed
2016-01-18  8:50       ` Wolfgang Schuster
2016-01-18  9:11         ` Ibn Saeed
2016-01-18 18:22           ` Mohammad Hossein Bateni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=569BE865.9060809@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).