From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84212 Path: news.gmane.org!not-for-mail From: Vafa Khalighi Newsgroups: gmane.comp.tex.context Subject: Re: wrong behaviour with ConTeXt unicode bidi Date: Wed, 11 Sep 2013 01:45:12 +1000 Message-ID: References: <522F3A33.6070809@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0948517236==" X-Trace: ger.gmane.org 1378827936 23112 80.91.229.3 (10 Sep 2013 15:45:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2013 15:45:36 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 10 17:45:41 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJQ8K-0006dK-QE for gctc-ntg-context-518@m.gmane.org; Tue, 10 Sep 2013 17:45:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 54FDA101E5; Tue, 10 Sep 2013 17:43:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hEGmCUJQYa+4; Tue, 10 Sep 2013 17:43:50 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3E4BA10261; Tue, 10 Sep 2013 17:43:41 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 244A510267 for ; Tue, 10 Sep 2013 17:43:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GX8BOO-N9Nyw for ; Tue, 10 Sep 2013 17:43:35 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id F1BD510215 for ; Tue, 10 Sep 2013 17:43:34 +0200 (CEST) Original-Received: from mail-qe0-x22c.google.com (mail-qe0-x22c.google.com [IPv6:2607:f8b0:400d:c02::22c]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r8AFkh3p031550 for ; Tue, 10 Sep 2013 17:46:43 +0200 Original-Received: by mail-qe0-f44.google.com with SMTP id 3so3040862qeb.31 for ; Tue, 10 Sep 2013 08:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=SIKB7i0UJSN+MlUTd/goPK2RlVG+/dzHlqdZl6YH1hY=; b=N706VAluUDmF/lKGKu1DK5e9VNhpN0AMlLCNdADQb/if+3qffuAOnjPvYX2a00VM9V WX28K8DQj5j2+rwEdLqeR1dV57Wb9CH+D/hYgryJeqQV9Wa4syy57ID1K71gwdSZ6ckP iCYyWyrl0KeZzzsM7B3ujDf7RO+8Mk8pC5R6t1ZU8XkzrJxu6E5HrZIE8/J8FEcfOevr 4xerKyRGqRqJV6WoonJAgfGxu9bfyTpMJ1TTAcDg3OHni0/tJlc/BRD1gLq+0Y6/cvB/ eX09M6u4oEL9461tw8skAmc27DZO4Qb3XhYe+UZWVcd1sN1oNfxUEZtQf4op4rqZdt4H aOOQ== X-Received: by 10.229.191.7 with SMTP id dk7mr26131955qcb.4.1378827912699; Tue, 10 Sep 2013 08:45:12 -0700 (PDT) Original-Received: by 10.49.98.102 with HTTP; Tue, 10 Sep 2013 08:45:12 -0700 (PDT) In-Reply-To: <522F3A33.6070809@wxs.nl> X-Google-Sender-Auth: DKcSmNTAtILlqK6PyMGUdHELVAE X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2607:f8b0:400d:c02::22c; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01KnrKHqH - fdef292d056c - 20130910 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:84212 Archived-At: --===============0948517236== Content-Type: multipart/alternative; boundary=001a11344d42f1822404e60963cd --001a11344d42f1822404e60963cd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks. That is now fixed. On Wed, Sep 11, 2013 at 1:26 AM, Hans Hagen wrote: > On 9/10/2013 2:57 PM, Vafa Khalighi wrote: > >> Hi >> >> The following document shows the wrong behaviour (the second parentheses >> is mirrored incorrectly and it should be after the number not before the >> number). >> >> Assuming "test" is an RTL word when I write (test 1363) I expect to get >> exactly that but somehow I get (test (1363 >> > > new beta ... also with fix for issue khaled mentioned > > \starttext > > \setupalign[r2l] > > \definefont[arabicfont][Arial***arabic at 20pt] > > \enabletrackers[typesetters.**directions.one] > \enabletrackers[typesetters.**directions.two] > > \setupdirections[bidi=3Dglobal,**method=3Ddefault] \arabicfont =D8=A7=DB= =8C=D9=86 (=DB=8C=DA=A9 =D8=A2=D8=B2=D9=85=D8=A7=DB=8C=D8=B4 > 1363) =D8=A7=D8=B3=D8=AA. \par > \setupdirections[bidi=3Dglobal,**method=3Done] \arabicfont =D8=A7=DB= =8C=D9=86 (=DB=8C=DA=A9 =D8=A2=D8=B2=D9=85=D8=A7=DB=8C=D8=B4 > 1363) =D8=A7=D8=B3=D8=AA. \par > \setupdirections[bidi=3Dglobal,**method=3Dtwo] \arabicfont =D8=A7=DB= =8C=D9=86 (=DB=8C=DA=A9 =D8=A2=D8=B2=D9=85=D8=A7=DB=8C=D8=B4 > 1363) =D8=A7=D8=B3=D8=AA. \par > > \stoptext > > > One related question: is it possible to change font automatically when >> luatex sees a LTR word? >> > > no, but you can define start\stop commands that deal with such switches > > also, you can combine fonts (and there a yet not documented auto > script/language switcher .. i have no time now to explain that one) > > btw, never use \textdir and \pardir directly (i might even define them as > no-ops some day) but use the higher level alignment commands > > 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 > ______________________________**______________________________** > _______________________ --001a11344d42f1822404e60963cd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks. That is now fixed.


On Wed, Sep 11, 2013 at 1:26 AM, Hans H= agen <pragma@wxs.nl> wrote:
On 9/10/2013 2:57 PM, Vafa= Khalighi wrote:
Hi

The following document shows the wrong behaviour (the second parentheses is mirrored incorrectly and it should be after the number not before the number).

Assuming "test" is an RTL word when I write (test 1363) I expect = to get
exactly that but somehow I get (test (1363

new beta ... also with fix for issue khaled mentioned

\starttext

\setupalign[r2l]

\definefont[arabicfont][Arial*arabic at 20pt]

\enabletrackers[typesetters.directions.one]
\enabletrackers[typesetters.directions.two]

\setupdirections[bidi=3Dglobal,method=3Ddefault] \arabicfont =D8=A7= =DB=8C=D9=86 (=DB=8C=DA=A9 =D8=A2=D8=B2=D9=85=D8=A7=DB=8C=D8=B4 1363) =D8= =A7=D8=B3=D8=AA. \par
\setupdirections[bidi=3Dglobal,method=3Done] =C2=A0 =C2=A0 \arabicfo= nt =D8=A7=DB=8C=D9=86 (=DB=8C=DA=A9 =D8=A2=D8=B2=D9=85=D8=A7=DB=8C=D8=B4 13= 63) =D8=A7=D8=B3=D8=AA. \par
\setupdirections[bidi=3Dglobal,method=3Dtwo] =C2=A0 =C2=A0 \arabicfo= nt =D8=A7=DB=8C=D9=86 (=DB=8C=DA=A9 =D8=A2=D8=B2=D9=85=D8=A7=DB=8C=D8=B4 13= 63) =D8=A7=D8=B3=D8=AA. \par

\stoptext


One related question: is it possible to change font automatically when
luatex sees a LTR word?

no, but you can define start\stop commands that deal with such switches

also, you can combine fonts (and there a yet not documented auto script/lan= guage switcher .. i have no time now to explain that one)

btw, never use \textdir and \pardir directly (i might even define them as n= o-ops some day) but use the higher level alignment commands

Hans

-------------------------------------------------------------= ----
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 H= ans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Ridderstraat 27 | 8061 GH = Hasselt | The Netherlands
=C2=A0 =C2=A0 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| www.p= ragma-pod.nl
-------------------------------------------------------------= ----
_____________________________________________________________= ______________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =C2=A0:
http= ://www.pragma-ade.nl / http://tex.aanhet.net
archive =C2=A0: http://foundry.supelec.fr/projects/contextrev/=
wiki =C2=A0 =C2=A0 : http://contextgarden.net
_____________________________________________________________= ______________________

--001a11344d42f1822404e60963cd-- --===============0948517236== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0948517236==--