From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82307 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: Automatic replacement? Date: Fri, 3 May 2013 18:40:59 +0200 Message-ID: References: <5183D5B6.8040204@mmnetz.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1831754518==" X-Trace: ger.gmane.org 1367599278 13155 80.91.229.3 (3 May 2013 16:41:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 May 2013 16:41:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri May 03 18:41:17 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UYJ2r-000266-Ax for gctc-ntg-context-518@m.gmane.org; Fri, 03 May 2013 18:41:17 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 16EC5101EA; Fri, 3 May 2013 18:41:17 +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 1fmlJyapKVR1; Fri, 3 May 2013 18:41:12 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E8EF6101E5; Fri, 3 May 2013 18:41:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1B3FF101E5 for ; Fri, 3 May 2013 18:41:11 +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 If5lK-gNhGqs for ; Fri, 3 May 2013 18:41:10 +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 3F6FC101E4 for ; Fri, 3 May 2013 18:41:00 +0200 (CEST) Original-Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r43H3uuQ029091 for ; Fri, 3 May 2013 19:03:57 +0200 Original-Received: by mail-la0-f50.google.com with SMTP id fl20so1698050lab.9 for ; Fri, 03 May 2013 09:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=ptVUrzUstut7Izy6lvGrAsF7160J0hZsJTozdQ3rYww=; b=Ujpagcyu16dyx7vxtI8JkLV316O/UkwfUpVjoUka0+yse5IgzthYffE0CG7VbqAb6F O1NhIyB0GDipAN82YLosvH/fzcExGFGmud3PIrncNLkC3KseLda6KGGHzlr9Sd31D1Ba B01y+Bcuq6bre9DfOlDfNNXhxRRxavVoJaK6VAHQ57UyV7ZekMQ9HB7aZQboXOR50/Mv BjSu7YeGP23o6g8S54HHded+f2SHzFQoYm0kA3PbT1JmOHkBZX2AiD8XdTyNBSGVRZFO Bdz3dVdXT5nYxTmSCQGmkw1ONROPH6jndDiWmtwmaZ2OtNPfMdR6CeJZheHqcdyrI5uJ MFGg== X-Received: by 10.112.180.2 with SMTP id dk2mr4571733lbc.43.1367599259123; Fri, 03 May 2013 09:40:59 -0700 (PDT) Original-Received: by 10.114.187.69 with HTTP; Fri, 3 May 2013 09:40:59 -0700 (PDT) In-Reply-To: <5183D5B6.8040204@mmnetz.de> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4010:c03::232; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01Jvt3VCG - 29dda203242e - 20130503 (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:82307 Archived-At: --===============1831754518== Content-Type: multipart/alternative; boundary=089e011828480906aa04dbd30460 --089e011828480906aa04dbd30460 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, May 3, 2013 at 5:20 PM, "H. =C3=96zoguz" wrot= e: > Thanks luigi, but it does not work for my characters, see here: > > \definefont[tradoa][name:**trado*arabic at 20pt] % or > file:amiri-regular.ttf*... file:alq.ttf > > \directlua{ local function replace_txt (buffer) > buffer=3Dstring.gsub(buffer,"**=D8=A7=D9=84=D9=84=D9=87=D9=90","=D8=A7=D9= =84=D9=84=D9=91=D9=8E=D9=80=D9=87") return buffer end > callback.register("process_**input_buffer",replace_txt) > } > \starttext > my text {\setupalign[r2l] \tradoa =D8=A7=D9=84=D9=84=D9=91=D9=8E=D9=80=D9= =87} > \stoptext > > "trado" ist just the font "traditional arabic", nearly every system have > it, so you should be able to compile this. It does not replace the > character. > > my fault, sorry. In the string library the function are not unicode aware (of course, I should say...) . --089e011828480906aa04dbd30460 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Fri, May 3, 2013 at 5:20 PM, "H. =C3=96zoguz" <h.oe= zoguz@mmnetz.de> wrote:
Thanks luigi, but it does not work for my ch= aracters, see here:

\definefont[tradoa][name:trado*arabic at 20pt] % or file:amiri-regul= ar.ttf*... file:alq.ttf

\directlua{ local function replace_txt (buffer)
buffer=3Dstring.gsub(buffer,"=D8=A7=D9=84=D9=84=D9=87=D9=90&quo= t;,"=D8=A7=D9=84=D9=84=D9=91=D9=8E=D9=80=D9=87") return buffer en= d
callback.register("process_input_buffer",replace_txt)
}
\starttext
my text {\setupalign[r2l] \tradoa =D8=A7=D9=84=D9=84=D9=91=D9=8E=D9=80=D9= =87}
\stoptext

"trado" ist just the font "traditional arabic", nearly = every system have it, so you should be able to compile this. It does not re= place the character.

my fault, sorry.
In the=C2=A0 string librar= y=C2=A0 the function are not unicode aware (of course, I should say...) .

--089e011828480906aa04dbd30460-- --===============1831754518== 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 ___________________________________________________________________________________ --===============1831754518==--