ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* marginal material in Arabic, tei/xml context mkiv
@ 2011-06-03 23:41 Jon Crump
  2011-06-04 10:08 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Crump @ 2011-06-03 23:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

All,

Pardon for trying to boost the topic, but I still can't seem to gain
control over marginal material in an Arabic section using the new
typo-mar.mkiv. I confess, it's quite likely that I'm just not getting
something obvious.

I've rotated the page to landscape to show where the marginal material
winds up when margin is [right]. When it's [left], it overwrites the
beginning of the Arabic line

If anyone has thoughts on this, I'd be grateful.

context environment file:
~~~~~~~~~~~~~~~~~
\startxmlsetups xml:teisetups
        \xmlsetsetup{#1}{*}{-}
        \xmlsetsetup{#1}{body}{xml:*}
        \xmlsetsetup{#1}{div[@xml:id='arab']}{xml:div:arab}
        \xmlsetsetup{#1}{div[@xml:id='engl']}{xml:div:engl}
		\xmlsetsetup{#1}{lb}{xml:lb}
\stopxmlsetups

\setuppapersize[][A3,landscape]
\setuplayout[width=middle,textwidth=5in]
\xmlregistersetup{xml:teisetups}
\environment ara-sty

\startxmlsetups xml:body
    \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:lb
	\MarText{\tfxx{xml linebreak numbers}}
	\xmlflush{#1}
\stopxmlsetups

\definemargindata [MarText][right][color=red]

\startxmlsetups xml:div:arab
	\setarabic{\switchtobodyfont[Arabic] \xmlflush{#1}}
	\endgraf
\stopxmlsetups
	
\startxmlsetups xml:div:engl
	\setlatin{\xmlflush{#1}}
\stopxmlsetups
~~~~~~~~~~~~~~~~~~~

XML source:
~~~~~~~~~~
<?xml version="1.0" encoding="utf-8"?>
<body>
  <div type="month" xml:id="arab">
    <lb n="01" />فقد صممنا على السفر الى اورباو ممشانا من هنا سيكون
  </div>
  <div type="month" xml:id="engl">
    <lb n="01" />And so, we decided to travel to Europe. Our departure
from here will be
  </div>
</body>
~~~~~~~~~~

ara-sty.tex setting up ScheherazadeRegOT:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\startenvironment ara-sty

\mainlanguage[arabic]

% Font setup

\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:ScheherazadeRegOT]
[features=arabic]
 \definefontsynonym [Arabic-Bold]        [name:ScheherazadeRegOT]
[features=arabic]
 \definefontsynonym [Arabic-Italic]      [name:ScheherazadeRegOT]
[features=arabic]
 \definefontsynonym [Arabic-Bold-Italic] [name:ScheherazadeRegOT]
[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

\def\ArabicGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT}
\def\ArabicParDir    {\textdir TRT\pardir TRT}
\def\ArabicTextDir   {\textdir TRT}
\def\LatinParDir     {\textdir TLT\pardir TLT}
\def\LatinTextDir    {\textdir TLT}
\def\LatinGlobalDir  {\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT}

\define\setarabic
  {\ArabicGlobalDir%
   \usetypescript[Arabic]%
   \setupbodyfont[Arabic,20pt]}

\definestartstop
  [arabicpar]
  [commands=\Arabic\ArabicParDir]

\define[1]\RT
  {{\Arabic\ArabicTextDir#1}}

\define\setlatin
  {\LatinGlobalDir%
   \usetypescript[lm]%
   \setupbodyfont[lm,20pt]}

\definestartstop
  [latinpar]
  [commands=\Arabic\LatinParDir]

\define[1]\LT
  {{\LatinTextDir#1}}

\setupdirections[bidi=local]


\stopenvironment
___________________________________________________________________________________
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] 2+ messages in thread

* Re: marginal material in Arabic, tei/xml context mkiv
  2011-06-03 23:41 marginal material in Arabic, tei/xml context mkiv Jon Crump
@ 2011-06-04 10:08 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2011-06-04 10:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Idris Samawi Hamid

On 4-6-2011 1:41, Jon Crump wrote:

> \def\ArabicGlobalDir {\pagedir TRT\bodydir TRT\pardir TRT\textdir TRT}
> \def\ArabicParDir    {\textdir TRT\pardir TRT}
> \def\ArabicTextDir   {\textdir TRT}
> \def\LatinParDir     {\textdir TLT\pardir TLT}
> \def\LatinTextDir    {\textdir TLT}
> \def\LatinGlobalDir  {\pagedir TLT\bodydir TLT\pardir TLT\textdir TLT}

Start by staying away from pagedir and bodydir (I thought that I'd 
disabled them). Also consider using \setupalign[r2l] (and \lefttoright 
etc).

We're working on a proper directional layout model but it take while 
(maybe Idris can comment on that).

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | 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] 2+ messages in thread

end of thread, other threads:[~2011-06-04 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-03 23:41 marginal material in Arabic, tei/xml context mkiv Jon Crump
2011-06-04 10:08 ` Hans Hagen

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