ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Arabic Letters are disjointed and reversed in headers and margin
@ 2016-01-17 18:47 Ibn Saeed
  2016-01-17 19:15 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Ibn Saeed @ 2016-01-17 18:47 UTC (permalink / raw)
  To: ntg-context

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



here is the screenshot:

http://postimg.org/image/too54uv7r/




___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Arabic Letters are disjointed and reversed in headers and margin
  2016-01-17 18:47 Arabic Letters are disjointed and reversed in headers and margin Ibn Saeed
@ 2016-01-17 19:15 ` Hans Hagen
  2016-01-18  6:48   ` Ibn Saeed
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2016-01-17 19:15 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Arabic Letters are disjointed and reversed in headers and margin
  2016-01-17 19:15 ` Hans Hagen
@ 2016-01-18  6:48   ` Ibn Saeed
  2016-01-18  7:15     ` Ibn Saeed
  0 siblings, 1 reply; 7+ messages in thread
From: Ibn Saeed @ 2016-01-18  6:48 UTC (permalink / raw)
  To: ntg-context


> 
> \setupmargindata
>   [margintext]
>   [align=r2l]
> 
> use \setupalign[r2l] and \righttoleft and not the dir primitives
> 


I did not understand how to use 

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

Do you mean that i should remove these lines ?

\pagedir TRT
\bodydir TRT
\pardir TRT
\textdir TRT


How should i use \setupalign[r21] and \righttoleft

i have added your code above the starttext area and it did not make any 
change



___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re:  Arabic Letters are disjointed and reversed in headers and margin
  2016-01-18  6:48   ` Ibn Saeed
@ 2016-01-18  7:15     ` Ibn Saeed
  2016-01-18  8:50       ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Ibn Saeed @ 2016-01-18  7:15 UTC (permalink / raw)
  To: ntg-context

Ibn Saeed <ibnsaeed <at> gmail.com> writes:

> 
> 
> > 
> > \setupmargindata
> >   [margintext]
> >   [align=r2l]
> > 
> > use \setupalign[r2l] and \righttoleft and not the dir primitives
> > 
> 
> I did not understand how to use 
> 
> "use \setupalign[r2l] and \righttoleft and not the dir primitives"
> 
> Do you mean that i should remove these lines ?
> 
> \pagedir TRT
> \bodydir TRT
> \pardir TRT
> \textdir TRT
> 
> How should i use \setupalign[r21] and \righttoleft
> 
> i have added your code above the starttext area and it did not make any 
> change
> 
> 


By using right 

\setupmargindata
 [margintext]
 [align=r2l]

and 
\setupalign[r2l]

The margin arabic text appears correctly

But the arabic texts in the header is still the same.



___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Arabic Letters are disjointed and reversed in headers and margin
  2016-01-18  7:15     ` Ibn Saeed
@ 2016-01-18  8:50       ` Wolfgang Schuster
  2016-01-18  9:11         ` Ibn Saeed
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2016-01-18  8:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 311 bytes --]

> Ibn Saeed <mailto:ibnsaeed@gmail.com>
> 18. Januar 2016 um 08:15
>
>
> By using right
>
> \setupmargindata
> [margintext]
> [align=r2l]
>
> and
> \setupalign[r2l]
>
> The margin arabic text appears correctly
>
> But the arabic texts in the header is still the same.
\setupheader[style=\righttoleft]

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1314 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Arabic Letters are disjointed and reversed in headers and margin
  2016-01-18  8:50       ` Wolfgang Schuster
@ 2016-01-18  9:11         ` Ibn Saeed
  2016-01-18 18:22           ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 7+ messages in thread
From: Ibn Saeed @ 2016-01-18  9:11 UTC (permalink / raw)
  To: ntg-context

Wolfgang Schuster <schuster.wolfgang <at> gmail.com> writes:

> 
> \setupheader[style=\righttoleft]
> Wolfgang
>

Thank you very much. 

This solves the issue of the arabic text in header as well.



___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Arabic Letters are disjointed and reversed in headers and margin
  2016-01-18  9:11         ` Ibn Saeed
@ 2016-01-18 18:22           ` Mohammad Hossein Bateni
  0 siblings, 0 replies; 7+ messages in thread
From: Mohammad Hossein Bateni @ 2016-01-18 18:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1176 bytes --]

This makes all the text LTR, for instance if one has an English word
embedded in the RTL text, that will be shown incorrectly.  Or even if one
of the headers (say, on the left side) is plain English.

Why wouldn't something like the following work?

\startsetups setup:bidi

\setupdirections[bidi=on,method=default,fences=no]

\stopsetups

\setupheader[setups=setup:bidi]



On Mon, Jan 18, 2016 at 4:11 AM, Ibn Saeed <ibnsaeed@gmail.com> wrote:

> Wolfgang Schuster <schuster.wolfgang <at> gmail.com> writes:
>
> >
> > \setupheader[style=\righttoleft]
> > Wolfgang
> >
>
> Thank you very much.
>
> This solves the issue of the arabic text in header as well.
>
>
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2296 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-18 18:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-17 18:47 Arabic Letters are disjointed and reversed in headers and margin Ibn Saeed
2016-01-17 19:15 ` Hans Hagen
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

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).